summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/AccountListDialog.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-08 17:34:45 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-08 17:34:45 +0100
commit0cb8ff40b26401a707781c2c4171d3ec6c114077 (patch)
tree0e075c830b67f8b15d5359d06d1026987dc5c124 /gui/dialogs/AccountListDialog.cpp
parentf028aa76bc5d28b7fc4d1ea4e194895690e9944e (diff)
downloadMultiMC-0cb8ff40b26401a707781c2c4171d3ec6c114077.tar
MultiMC-0cb8ff40b26401a707781c2c4171d3ec6c114077.tar.gz
MultiMC-0cb8ff40b26401a707781c2c4171d3ec6c114077.tar.lz
MultiMC-0cb8ff40b26401a707781c2c4171d3ec6c114077.tar.xz
MultiMC-0cb8ff40b26401a707781c2c4171d3ec6c114077.zip
Finish preliminary offline support
* ProgressProvider now has an abort() call * Abort button support added to the progress dialog * YggdrasilTask and MojangAccount adapted to support abort YggdrasilTask will time out after 10 seconds of no network activity, or when the user pushes the Play Offline button. In offline mode, all instance update tasks are skipped! This will need further work.
Diffstat (limited to 'gui/dialogs/AccountListDialog.cpp')
-rw-r--r--gui/dialogs/AccountListDialog.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/gui/dialogs/AccountListDialog.cpp b/gui/dialogs/AccountListDialog.cpp
index e1f65c16..8dae5f07 100644
--- a/gui/dialogs/AccountListDialog.cpp
+++ b/gui/dialogs/AccountListDialog.cpp
@@ -25,6 +25,7 @@
#include <gui/dialogs/EditAccountDialog.h>
#include <gui/dialogs/ProgressDialog.h>
#include <gui/dialogs/AccountSelectDialog.h>
+#include <logic/tasks/Task.h>
#include <MultiMC.h>
@@ -117,14 +118,14 @@ void AccountListDialog::addAccount(const QString& errMsg)
QString password(loginDialog.password());
MojangAccountPtr account = MojangAccount::createFromUsername(username);
-/*
ProgressDialog progDialog(this);
- AuthenticateTask authTask(account, password, &progDialog);
- if (progDialog.exec(&authTask))
+ auto task = account->login(password);
+ progDialog.exec(task.get());
+ if(task->successful())
{
- // Add the authenticated account to the accounts list.
- MojangAccountPtr account = authTask.getMojangAccount();
m_accounts->addAccount(account);
+ if (m_accounts->count() == 1)
+ m_accounts->setActiveAccount(account->username());
// Grab associated player skins
auto job = new NetJob("Player skins: " + account->username());
@@ -141,6 +142,5 @@ void AccountListDialog::addAccount(const QString& errMsg)
job->start();
}
- */
}
}