From 89edc3e15edde37fb9fee2c0e0b98ea13c9b9197 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Wed, 16 Apr 2014 18:03:48 +0200 Subject: [PATCH] Comments and reformating [ci skip] --- gui/dialogs/LoginDialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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("" + reason + ""); + // Re-enable user-interaction setUserInputsEnabled(true); ui->progressBar->setVisible(false); }