update login flow

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2024-06-12 00:34:39 +03:00
parent 6b1c4981e7
commit c4a65dd861
15 changed files with 421 additions and 166 deletions

View File

@ -134,15 +134,14 @@ void AccountListPage::on_actionAddMicrosoft_triggered()
box.setWindowTitle(tr("Add account"));
box.setText(tr("How do you want to login?"));
box.setIcon(QMessageBox::Question);
auto deviceCode = box.addButton(tr("Legacy"), QMessageBox::ButtonRole::YesRole);
auto deviceCode = box.addButton(tr("Remote"), QMessageBox::ButtonRole::YesRole);
auto authCode = box.addButton(tr("Recommended"), QMessageBox::ButtonRole::NoRole);
auto cancel = box.addButton(tr("Cancel"), QMessageBox::ButtonRole::RejectRole);
box.setDefaultButton(authCode);
box.exec();
if ((box.clickedButton() != deviceCode && box.clickedButton() != authCode) || box.clickedButton() == cancel)
return;
MinecraftAccountPtr account = MSALoginDialog::newAccount(
this, tr("Please enter your Mojang account email and password to add your account."), box.clickedButton() == deviceCode);
MinecraftAccountPtr account = MSALoginDialog::newAccount(this, box.clickedButton() == deviceCode);
if (account) {
m_accounts->addAccount(account);