summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-08-03 23:58:39 +0200
committerPetr Mrázek <peterix@gmail.com>2013-08-03 23:58:39 +0200
commit4f73091bb5bdbdb91329b9a4ef647fc8286d423c (patch)
tree6bc63a2d9ca2265cd7ee6dcf683219b73e25a24e /gui
parent13b1b98f7cf8a3b3b2c15dd42f96537b02c00711 (diff)
downloadMultiMC-4f73091bb5bdbdb91329b9a4ef647fc8286d423c.tar
MultiMC-4f73091bb5bdbdb91329b9a4ef647fc8286d423c.tar.gz
MultiMC-4f73091bb5bdbdb91329b9a4ef647fc8286d423c.tar.lz
MultiMC-4f73091bb5bdbdb91329b9a4ef647fc8286d423c.tar.xz
MultiMC-4f73091bb5bdbdb91329b9a4ef647fc8286d423c.zip
Errr... I forgot.
Diffstat (limited to 'gui')
-rw-r--r--gui/mainwindow.cpp20
-rw-r--r--gui/mainwindow.h5
2 files changed, 12 insertions, 13 deletions
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index db3a2828..50d301ed 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -192,15 +192,13 @@ void MainWindow::on_actionAddInstance_triggered()
QString instDir = PathCombine(globalSettings->get("InstanceDir").toString(), instDirName);
auto &loader = InstanceFactory::get();
- auto error = loader.createInstance(newInstance, instDir);
- QString errorMsg = QString("Failed to create instance %1: ").arg(instDirName);
+ auto error = loader.createInstance(newInstance, newInstDlg->selectedVersion(), instDir);
+ QString errorMsg = QString("Failed to create instance %1: ").arg(instDirName);
switch (error)
{
case InstanceFactory::NoCreateError:
newInstance->setName(newInstDlg->instName());
- // FIXME:HACKERY
- // newInstance->setIntendedVersion(newInstDlg->selectedVersion()->descriptor());
instList.add(InstancePtr(newInstance));
return;
@@ -417,24 +415,25 @@ void MainWindow::onLoginComplete(LoginResponse response)
{
if(!m_activeInst)
return;
+ m_activeLogin = LoginResponse(response);
GameUpdateTask *updateTask = m_activeInst->doUpdate();
if(!updateTask)
{
- launchInstance(m_activeInst, response);
+ launchInstance(m_activeInst, m_activeLogin);
}
else
{
TaskDialog *tDialog = new TaskDialog(this);
- connect(updateTask, SIGNAL(gameUpdateComplete(LoginResponse)),SLOT(onGameUpdateComplete(LoginResponse)));
+ connect(updateTask, SIGNAL(gameUpdateComplete()),SLOT(onGameUpdateComplete()));
connect(updateTask, SIGNAL(gameUpdateError(QString)), SLOT(onGameUpdateError(QString)));
tDialog->exec(updateTask);
}
}
-void MainWindow::onGameUpdateComplete(LoginResponse response)
+void MainWindow::onGameUpdateComplete()
{
- launchInstance(m_activeInst, response);
+ launchInstance(m_activeInst, m_activeLogin);
}
void MainWindow::onGameUpdateError(QString error)
@@ -446,7 +445,7 @@ void MainWindow::launchInstance(BaseInstance *instance, LoginResponse response)
{
Q_ASSERT_X(instance != NULL, "launchInstance", "instance is NULL");
- proc = instance->prepareForLaunch(response.username(), response.sessionID());
+ proc = instance->prepareForLaunch(response.username, response.sessionID);
if(!proc)
return;
@@ -524,8 +523,7 @@ void MainWindow::on_actionChangeInstMCVersion_triggered()
VersionSelectDialog *vselect = new VersionSelectDialog(inst->versionList(), this);
if (vselect->exec() && vselect->selectedVersion())
{
- // FIXME:HACKERY
- // inst->setIntendedVersion(vselect->selectedVersion()->descriptor());
+ inst->setIntendedVersionId(vselect->selectedVersion()->descriptor());
}
}
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index 738dac0c..8ab90cc6 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -19,7 +19,7 @@
#include <QMainWindow>
#include "lists/InstanceList.h"
-#include "tasks/LoginResponse.h"
+#include "tasks/LoginTask.h"
#include "BaseInstance.h"
class InstanceModel;
@@ -100,7 +100,7 @@ private slots:
void onLoginComplete(LoginResponse response);
- void onGameUpdateComplete(LoginResponse response);
+ void onGameUpdateComplete();
void onGameUpdateError(QString error);
void taskStart(Task *task);
@@ -133,6 +133,7 @@ private:
// This is set when the user launches an instance and is used to refer to that
// instance throughout the launching process.
BaseInstance *m_activeInst;
+ LoginResponse m_activeLogin;
Task *m_versionLoadTask;
};