summaryrefslogtreecommitdiffstats
path: root/gui/MainWindow.cpp
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2013-11-27 22:51:45 +0000
committerSky <git@bunnies.cc>2013-11-27 22:51:45 +0000
commitd32cb1c95d5c1a50c322085cdfe4bf3f991431e7 (patch)
tree8a31c6ed1c2da0513596d8bb82dc439101a7aec9 /gui/MainWindow.cpp
parent70973d111a35c65072b9431420d3d854bd82e8f5 (diff)
parenta4c5f0135ef8e3671f54cf56b1aa8766ee4b4a20 (diff)
downloadMultiMC-d32cb1c95d5c1a50c322085cdfe4bf3f991431e7.tar
MultiMC-d32cb1c95d5c1a50c322085cdfe4bf3f991431e7.tar.gz
MultiMC-d32cb1c95d5c1a50c322085cdfe4bf3f991431e7.tar.lz
MultiMC-d32cb1c95d5c1a50c322085cdfe4bf3f991431e7.tar.xz
MultiMC-d32cb1c95d5c1a50c322085cdfe4bf3f991431e7.zip
Merge remote-tracking branch 'upstream/feature_yggdrasil' into develop
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r--gui/MainWindow.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp
index 2917bf95..a9f29d86 100644
--- a/gui/MainWindow.cpp
+++ b/gui/MainWindow.cpp
@@ -59,6 +59,7 @@
#include "gui/dialogs/EditNotesDialog.h"
#include "gui/dialogs/CopyInstanceDialog.h"
#include "gui/dialogs/AccountListDialog.h"
+#include "gui/dialogs/AccountSelectDialog.h"
#include "gui/ConsoleWindow.h"
@@ -724,19 +725,21 @@ void MainWindow::doLogin(const QString &errorMsg)
}
else if (account.get() == nullptr)
{
- // Tell the user they need to log in at least one account in order to play.
- auto reply = CustomMessageBox::selectable(this, tr("No Account Selected"),
- tr("You don't have an account selected as an active account."
- "Would you like to open the account manager to select one now?"),
- QMessageBox::Information, QMessageBox::Yes | QMessageBox::No)->exec();
+ // If no default account is set, ask the user which one to use.
+ AccountSelectDialog selectDialog(tr("Which account would you like to use?"),
+ AccountSelectDialog::GlobalDefaultCheckbox, this);
- if (reply == QMessageBox::Yes)
- {
- // Open the account manager.
- on_actionManageAccounts_triggered();
- }
+ selectDialog.exec();
+
+ // Launch the instance with the selected account.
+ account = selectDialog.selectedAccount();
+
+ // If the user said to use the account as default, do that.
+ if (selectDialog.useAsGlobalDefault() && account.get() != nullptr)
+ accounts->setActiveAccount(account->username());
}
- else
+
+ if (account.get() != nullptr)
{
// We'll need to validate the access token to make sure the account is still logged in.
// TODO: Do that ^