summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/AccountListDialog.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-01 02:00:42 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-01 02:00:42 +0100
commitf27a6c39ea796f946893ced1d9f80441ad9aa18c (patch)
treefed31b28bc7752f4fea85aefddfeff62701e13b7 /gui/dialogs/AccountListDialog.cpp
parent2eaf33816b0c4f6fd61ea2b086fa1c4f9fcba4c5 (diff)
downloadMultiMC-f27a6c39ea796f946893ced1d9f80441ad9aa18c.tar
MultiMC-f27a6c39ea796f946893ced1d9f80441ad9aa18c.tar.gz
MultiMC-f27a6c39ea796f946893ced1d9f80441ad9aa18c.tar.lz
MultiMC-f27a6c39ea796f946893ced1d9f80441ad9aa18c.tar.xz
MultiMC-f27a6c39ea796f946893ced1d9f80441ad9aa18c.zip
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.
Diffstat (limited to 'gui/dialogs/AccountListDialog.cpp')
-rw-r--r--gui/dialogs/AccountListDialog.cpp17
1 files changed, 7 insertions, 10 deletions
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 <logger/QsLog.h>
-#include <logic/auth/AuthenticateTask.h>
+#include <logic/auth/flows/AuthenticateTask.h>
#include <logic/net/NetJob.h>
#include <gui/dialogs/EditAccountDialog.h>
@@ -29,9 +29,8 @@
#include <MultiMC.h>
-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<MojangAccountPtr>();
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)
}
}
}
-