Implement basic game updater.

Resolves MMC-4: https://jira.forkk.net/browse/MMC-4
This commit is contained in:
Andrew
2013-05-08 12:56:43 -05:00
parent 2e62f6e8d8
commit 5f781b3053
17 changed files with 599 additions and 98 deletions

View File

@ -38,16 +38,21 @@ class MainWindow : public QMainWindow
{
Q_OBJECT
/*!
* The currently selected instance.
*/
Q_PROPERTY(Instance* selectedInstance READ selectedInstance STORED false)
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void closeEvent(QCloseEvent *event);
// Browser Dialog
void openWebPage(QUrl url);
private:
// Browser Dialog
void openWebPage(QUrl url);
Instance *selectedInstance();
private slots:
@ -82,11 +87,14 @@ private slots:
void on_actionChangeInstMCVersion_triggered();
void doLogin( QString inst, const QString& errorMsg = "" );
void doLogin(const QString& errorMsg = "");
void onLoginComplete( QString inst, LoginResponse response );
void onLoginFailed( QString inst, const QString& errorMsg );
void onLoginComplete(LoginResponse response);
void onGameUpdateComplete(LoginResponse response);
void onGameUpdateError(QString error);
void taskStart(Task *task);
void taskEnd(Task *task);
@ -95,6 +103,10 @@ public slots:
void instanceActivated ( QModelIndex );
void startTask(Task *task);
void launchInstance(LoginResponse response);
void launchInstance(QString instID, LoginResponse response);
void launchInstance(Instance *inst, LoginResponse response);
private:
Ui::MainWindow *ui;
@ -106,6 +118,11 @@ private:
MinecraftProcess *proc;
ConsoleWindow *console;
// A pointer to the instance we are actively doing stuff with.
// This is set when the user launches an instance and is used to refer to that
// instance throughout the launching process.
Instance *m_activeInst;
Task *m_versionLoadTask;
};