summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-04-16 18:03:48 +0200
committerJan Dalheimer <jan@dalheimer.de>2014-04-16 18:03:48 +0200
commit89edc3e15edde37fb9fee2c0e0b98ea13c9b9197 (patch)
treec7bf7b32c6be47f1432f3f0f725a4f82ff0e37cd
parentf67ca674c4157737196d05fb5d1c80006c3cd361 (diff)
downloadMultiMC-89edc3e15edde37fb9fee2c0e0b98ea13c9b9197.tar
MultiMC-89edc3e15edde37fb9fee2c0e0b98ea13c9b9197.tar.gz
MultiMC-89edc3e15edde37fb9fee2c0e0b98ea13c9b9197.tar.lz
MultiMC-89edc3e15edde37fb9fee2c0e0b98ea13c9b9197.tar.xz
MultiMC-89edc3e15edde37fb9fee2c0e0b98ea13c9b9197.zip
Comments and reformating
[ci skip]
-rw-r--r--gui/dialogs/LoginDialog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gui/dialogs/LoginDialog.cpp b/gui/dialogs/LoginDialog.cpp
index 0e5f17b3..5ac94fac 100644
--- a/gui/dialogs/LoginDialog.cpp
+++ b/gui/dialogs/LoginDialog.cpp
@@ -41,10 +41,12 @@ void LoginDialog::accept()
setUserInputsEnabled(false);
ui->progressBar->setVisible(true);
+ // Setup the login task and start it
m_account = MojangAccount::createFromUsername(ui->userTextBox->text());
m_loginTask = m_account->login(nullptr, ui->passTextBox->text());
connect(m_loginTask.get(), &ProgressProvider::failed, this, &LoginDialog::onTaskFailed);
- connect(m_loginTask.get(), &ProgressProvider::succeeded, this, &LoginDialog::onTaskSucceeded);
+ connect(m_loginTask.get(), &ProgressProvider::succeeded, this,
+ &LoginDialog::onTaskSucceeded);
connect(m_loginTask.get(), &ProgressProvider::status, this, &LoginDialog::onTaskStatus);
connect(m_loginTask.get(), &ProgressProvider::progress, this, &LoginDialog::onTaskProgress);
m_loginTask->start();
@@ -74,6 +76,7 @@ void LoginDialog::onTaskFailed(const QString &reason)
// Set message
ui->label->setText("<span style='color:red'>" + reason + "</span>");
+ // Re-enable user-interaction
setUserInputsEnabled(true);
ui->progressBar->setVisible(false);
}