aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/global/AccountListPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/pages/global/AccountListPage.cpp')
-rw-r--r--launcher/ui/pages/global/AccountListPage.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp
index b8da6c75..ad88812a 100644
--- a/launcher/ui/pages/global/AccountListPage.cpp
+++ b/launcher/ui/pages/global/AccountListPage.cpp
@@ -24,6 +24,7 @@
#include "net/NetJob.h"
#include "ui/dialogs/ProgressDialog.h"
+#include "ui/dialogs/OfflineLoginDialog.h"
#include "ui/dialogs/LoginDialog.h"
#include "ui/dialogs/MSALoginDialog.h"
#include "ui/dialogs/CustomMessageBox.h"
@@ -153,6 +154,28 @@ void AccountListPage::on_actionAddMicrosoft_triggered()
}
}
+void AccountListPage::on_actionAddOffline_triggered()
+{
+ MinecraftAccountPtr account = OfflineLoginDialog::newAccount(
+ this,
+ tr("Please enter your desired username to add your offline account. <br>"
+ "<br>"
+ "It is required by Mojang that you own Minecraft BEFORE you may use offline mode. <br>"
+ "The PolyMC developers denounce piracy and take NO LIABILITY WHATSOEVER for <br>"
+ "any illegal activity that may occur in usage of the offline mode feature. <br>"
+ "<br>"
+ "By continuing you promise that you own a Minecraft account.")
+ );
+
+ if (account)
+ {
+ m_accounts->addAccount(account);
+ if (m_accounts->count() == 1) {
+ m_accounts->setDefaultAccount(account);
+ }
+ }
+}
+
void AccountListPage::on_actionRemove_triggered()
{
QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes();