From f27a6c39ea796f946893ced1d9f80441ad9aa18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 1 Dec 2013 02:00:42 +0100 Subject: Fix login and startup logging issues Auth uses the refresh endpoint instead of validate. This means less password entering. Console will now only autoscroll when already scrolled all the way down. Better conformance with the Yggdrasil auth protocol (not complete yet, but Mojang launcher isn't complete either). Fix bug that prevented saving the account data (uninitialized variable). Accounts can now trigger account list saving, this is used for the refresh endpoint. --- gui/dialogs/AccountListDialog.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'gui/dialogs/AccountListDialog.cpp') diff --git a/gui/dialogs/AccountListDialog.cpp b/gui/dialogs/AccountListDialog.cpp index dfac4989..f5268b61 100644 --- a/gui/dialogs/AccountListDialog.cpp +++ b/gui/dialogs/AccountListDialog.cpp @@ -20,7 +20,7 @@ #include -#include +#include #include #include @@ -29,9 +29,8 @@ #include -AccountListDialog::AccountListDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::AccountListDialog) +AccountListDialog::AccountListDialog(QWidget *parent) + : QDialog(parent), ui(new Ui::AccountListDialog) { ui->setupUi(this); @@ -44,8 +43,8 @@ AccountListDialog::AccountListDialog(QWidget *parent) : connect(selectionModel, &QItemSelectionModel::selectionChanged, [this] (const QItemSelection& sel, const QItemSelection& dsel) { updateButtonStates(); }); - connect(m_accounts.get(), SIGNAL(listChanged), SLOT(listChanged)); - connect(m_accounts.get(), SIGNAL(activeAccountChanged), SLOT(listChanged)); + connect(m_accounts.get(), SIGNAL(listChanged()), SLOT(listChanged())); + connect(m_accounts.get(), SIGNAL(activeAccountChanged()), SLOT(listChanged())); updateButtonStates(); } @@ -60,7 +59,6 @@ void AccountListDialog::listChanged() updateButtonStates(); } - void AccountListDialog::on_addAccountBtn_clicked() { addAccount(tr("Please enter your Mojang or Minecraft account username and password to add your account.")); @@ -84,7 +82,7 @@ void AccountListDialog::on_setDefaultBtn_clicked() QModelIndex selected = selection.first(); MojangAccountPtr account = selected.data(MojangAccountList::PointerRole).value(); m_accounts->setActiveAccount(account->username()); - } + } } void AccountListDialog::on_noDefaultBtn_clicked() @@ -104,7 +102,7 @@ void AccountListDialog::updateButtonStates() ui->rmAccountBtn->setEnabled(selection.size() > 0); ui->setDefaultBtn->setEnabled(selection.size() > 0); - + ui->noDefaultBtn->setDown(m_accounts->activeAccount().get() == nullptr); } @@ -146,4 +144,3 @@ void AccountListDialog::addAccount(const QString& errMsg) } } } - -- cgit v1.2.3