From c4a65dd861f0704f09f258c5cc9c5530e5db981a Mon Sep 17 00:00:00 2001
From: Trial97
Date: Wed, 12 Jun 2024 00:34:39 +0300
Subject: [PATCH] update login flow
Signed-off-by: Trial97
---
launcher/Application.h | 3 +-
launcher/minecraft/auth/AuthFlow.cpp | 10 +
launcher/minecraft/auth/AuthFlow.h | 3 +
launcher/minecraft/auth/AuthStep.h | 1 +
.../minecraft/auth/steps/MSADeviceCodeStep.h | 2 +-
launcher/minecraft/auth/steps/MSAStep.cpp | 29 +-
launcher/resources/documents/documents.qrc | 1 +
launcher/resources/documents/login-qr.png | Bin 0 -> 7616 bytes
launcher/ui/MainWindow.cpp | 8 +
launcher/ui/dialogs/MSALoginDialog.cpp | 123 +++---
launcher/ui/dialogs/MSALoginDialog.h | 13 +-
launcher/ui/dialogs/MSALoginDialog.ui | 383 ++++++++++++++----
launcher/ui/pages/global/AccountListPage.cpp | 5 +-
...org.prismlauncher.PrismLauncher.desktop.in | 2 +-
program_info/win_install.nsi.in | 4 +
15 files changed, 421 insertions(+), 166 deletions(-)
create mode 100644 launcher/resources/documents/login-qr.png
diff --git a/launcher/Application.h b/launcher/Application.h
index 7669e08ec..8303c7475 100644
--- a/launcher/Application.h
+++ b/launcher/Application.h
@@ -48,7 +48,6 @@
#include
#include "minecraft/launch/MinecraftServerTarget.h"
-#include "ui/themes/CatPack.h"
class LaunchController;
class LocalPeer;
@@ -193,6 +192,8 @@ class Application : public QApplication {
void globalSettingsClosed();
int currentCatChanged(int index);
+ void oauthReplyRecieved(QVariantMap);
+
#ifdef Q_OS_MACOS
void clickedOnDock();
#endif
diff --git a/launcher/minecraft/auth/AuthFlow.cpp b/launcher/minecraft/auth/AuthFlow.cpp
index 5648fe9f6..45926206c 100644
--- a/launcher/minecraft/auth/AuthFlow.cpp
+++ b/launcher/minecraft/auth/AuthFlow.cpp
@@ -59,6 +59,9 @@ void AuthFlow::executeTask()
void AuthFlow::nextStep()
{
+ if (!Task::isRunning()) {
+ return;
+ }
if (m_steps.size() == 0) {
// we got to the end without an incident... assume this is all.
m_currentStep.reset();
@@ -143,4 +146,11 @@ bool AuthFlow::changeState(AccountTaskState newState, QString reason)
return false;
}
}
+}
+bool AuthFlow::abort()
+{
+ emitAborted();
+ if (m_currentStep)
+ m_currentStep->abort();
+ return true;
}
\ No newline at end of file
diff --git a/launcher/minecraft/auth/AuthFlow.h b/launcher/minecraft/auth/AuthFlow.h
index d99deec3c..4d18ac845 100644
--- a/launcher/minecraft/auth/AuthFlow.h
+++ b/launcher/minecraft/auth/AuthFlow.h
@@ -24,6 +24,9 @@ class AuthFlow : public Task {
AccountTaskState taskState() { return m_taskState; }
+ public slots:
+ bool abort() override;
+
signals:
void authorizeWithBrowser(const QUrl& url);
void authorizeWithBrowserWithExtra(QString url, QString code, int expiresIn);
diff --git a/launcher/minecraft/auth/AuthStep.h b/launcher/minecraft/auth/AuthStep.h
index 4d2cf69c1..a2b2cf9e5 100644
--- a/launcher/minecraft/auth/AuthStep.h
+++ b/launcher/minecraft/auth/AuthStep.h
@@ -34,6 +34,7 @@ class AuthStep : public QObject {
public slots:
virtual void perform() = 0;
+ virtual void abort() {}
signals:
void finished(AccountTaskState resultingState, QString message);
diff --git a/launcher/minecraft/auth/steps/MSADeviceCodeStep.h b/launcher/minecraft/auth/steps/MSADeviceCodeStep.h
index e53eebc62..024927b31 100644
--- a/launcher/minecraft/auth/steps/MSADeviceCodeStep.h
+++ b/launcher/minecraft/auth/steps/MSADeviceCodeStep.h
@@ -51,7 +51,7 @@ class MSADeviceCodeStep : public AuthStep {
QString describe() override;
public slots:
- void abort();
+ void abort() override;
signals:
void authorizeWithBrowser(QString url, QString code, int expiresIn);
diff --git a/launcher/minecraft/auth/steps/MSAStep.cpp b/launcher/minecraft/auth/steps/MSAStep.cpp
index 3f31cdc16..c1eb3a33c 100644
--- a/launcher/minecraft/auth/steps/MSAStep.cpp
+++ b/launcher/minecraft/auth/steps/MSAStep.cpp
@@ -35,22 +35,35 @@
#include "MSAStep.h"
-#include
#include
#include
+#include
#include "Application.h"
+#include "BuildConfig.h"
+
+class CustomOAuthOobReplyHandler : public QOAuthOobReplyHandler {
+ Q_OBJECT
+
+ public:
+ explicit CustomOAuthOobReplyHandler(QObject* parent = nullptr) : QOAuthOobReplyHandler(parent)
+ {
+ connect(APPLICATION, &Application::oauthReplyRecieved, this, &QOAuthOobReplyHandler::callbackReceived);
+ }
+ ~CustomOAuthOobReplyHandler() override
+ {
+ disconnect(APPLICATION, &Application::oauthReplyRecieved, this, &QOAuthOobReplyHandler::callbackReceived);
+ }
+ QString callback() const override { return BuildConfig.LAUNCHER_APP_BINARY_NAME + "://oauth"; }
+};
MSAStep::MSAStep(AccountData* data, bool silent) : AuthStep(data), m_silent(silent)
{
m_clientId = APPLICATION->getMSAClientID();
- auto replyHandler = new QOAuthHttpServerReplyHandler(1337, this);
- replyHandler->setCallbackText(
- " ");
- oauth2.setReplyHandler(replyHandler);
+ auto bv = new CustomOAuthOobReplyHandler();
+
+ oauth2.setReplyHandler(bv);
oauth2.setAuthorizationUrl(QUrl("https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize"));
oauth2.setAccessTokenUrl(QUrl("https://login.microsoftonline.com/consumers/oauth2/v2.0/token"));
oauth2.setScope("XboxLive.SignIn XboxLive.offline_access");
@@ -106,3 +119,5 @@ void MSAStep::perform()
oauth2.grant();
}
}
+
+#include "MSAStep.moc"
\ No newline at end of file
diff --git a/launcher/resources/documents/documents.qrc b/launcher/resources/documents/documents.qrc
index 007efcde3..a5ff84390 100644
--- a/launcher/resources/documents/documents.qrc
+++ b/launcher/resources/documents/documents.qrc
@@ -2,6 +2,7 @@
../../../COPYING.md
+ login-qr.png
diff --git a/launcher/resources/documents/login-qr.png b/launcher/resources/documents/login-qr.png
new file mode 100644
index 0000000000000000000000000000000000000000..9bed0a73e2e456fd810cdc997dbf0db24dcafc1c
GIT binary patch
literal 7616
zcmeAS@N?(olHy`uVBq!ia0y~yU}*+n4kiW$hSbcA1q=)fY)RhkE)4%caKYZ?lNlIf
zOFdm2Ln`LHxqUGAj)RcH#kWWAOg+`|;KEy;DP2l0_P*T2&UodAd1#$Jqu5C$Q~8!_
z_kP}-WXAUvb
zbe+|1?|O4-r#plGk|X<`zJ2@lXU)8MO_T54zi)46=jYGJV7kBQgZ7KrQ*LaxnScKN
z{`&dznkLu%{q^F=Oh4-P4awvS&TelDs~8^ieY>~Z{Q);96@Q+l
zXs!JH#lJhs4;1bX$+!Zit#1~#4Dq+C=gTqvo3{1ZOTiybW&NAV@9tSUyWCB(KJoo|
z+a!ab=Dls-?k!KR*tj*UY|ZxV+n;})DcdJqRbT)A$Bz?y&l^)WxP^Y&U=t@sz*1^S?j7EgAc)N3Ymz`dMq`2kal~hfGm}Q65HD
zzrSqEuzmA2E89cesqc5axl~ylZuxEFE=GqV|M*6
z?$;}Rsdrj0_LxzO+54Vnx`+3$m)%?XS?2Ei{2?BLe?qd?URK@{v5n{E(#`ii)PBBK
zI#R6W_fd%wRFjLW$vS!oeb}FudQkkkItSe_weYZYLoYu&KkdOoLlbpxq|f|ztQ`pv-V0pi?teR
zg)UNi1yrY)Zvq!IXRQ~5V^L?f`)9qoHgY#kKa1VfW6nJPnXUWHs_H(yq1@QXeqUR~
z_9OaQ)Y(QG_wVNUl5;Mmo_p~xX4mOW-qQ>Ff0*P;4&}6Zt9t&tM*THgXE8^%o!(S^
zB=u(1`RatZf;IQ|?BDQtp7Qzyzh{4!`KdMp8r~SSA-K-~YL3U{uPv=&d8ZWJwzs@^
zLFMbYvAcSVcb#FbzPV@Z?CKJ`LdpIXI2JOIll6)gpfSn)U9I&*wCZ-(Nag
zU48!ct}}bSJ~PU1`#t;nfpfQa^$hj8@k1-91siwfTI@7k=d%7a=JVHl|9dw2eP#6Y
zndL8^*>0Fw`FifhAs(4+;?dcr?6b;WK07%rabD%?TuF(Xd(5+Eeos3w?cn*fr(>+_
zhJ2QMUt7iU&+_xOJV>&A7g+Z4+1$Wm%+)j3?%rQ{nxT0p`*7=bJKMwlTd!sDJ(0T`
zzl~>R&TAX@>1V;Yk?lwQ=YJp0J|4njJ=gC2{=#$M?V7EA{U3rWSKgcdb=mW?1vA;F
z`G20LJhU4%2VSq;>etUue;PD)Q_Ix!$0hYSijQNkN?2+Yf;PHf2;%z_54`5$vb`T`}4&m^*4)CB=tV8+r7WC
z{>Pk)e}{4jbo?b_gLM?R|MBhK*~U%Y)8`6;ny=4n-9Mkxm>j#S@_WWT$st_|!A6`f
zD}QL+8dj`ux*)Qw-{_{%ncXFl`E8(1NM-tzq1+Vczs&q$E2wMr<9SN-_G?*uQ$8Mu
zo2GksPxX_=*7vi&bImGu`}|{wwavGJ>&EW2TQ?=|1(!5$3hrD0mo)BW7W{Ai?sWfd
z{$4J1Q|gI#6Tj{|V-)kO=f{#G57a*%xHrGLr2g}}z_fe()~{=4rtUZ+`SB%q#P-==
ztC{KdY(Kqj@xS)l=ryl>$NwQbegNu|F)}bbxc_JfHxa<&>C~Rd`m_G8l^6p91B1kq
zeB18WR6&LVXFD4Fj5k62gv|5)2e6jsCptK=$t`
R4%0xEd%F6$taD0e0ss urls)
dlUrlDialod.execWithTask(job.get());
}
+ } else if (url.scheme() == BuildConfig.LAUNCHER_APP_BINARY_NAME) {
+ QVariantMap receivedData;
+ const QUrlQuery query(url.query());
+ const auto items = query.queryItems();
+ for (auto it = items.begin(), end = items.end(); it != end; ++it)
+ receivedData.insert(it->first, it->second);
+ emit APPLICATION->oauthReplyRecieved(receivedData);
+ continue;
} else {
dl_url = url;
}
diff --git a/launcher/ui/dialogs/MSALoginDialog.cpp b/launcher/ui/dialogs/MSALoginDialog.cpp
index a654c1d29..5f311e625 100644
--- a/launcher/ui/dialogs/MSALoginDialog.cpp
+++ b/launcher/ui/dialogs/MSALoginDialog.cpp
@@ -34,6 +34,8 @@
*/
#include "MSALoginDialog.h"
+#include "Application.h"
+
#include "ui_MSALoginDialog.h"
#include "DesktopServices.h"
@@ -41,6 +43,7 @@
#include
#include
+#include
#include
#include
@@ -48,13 +51,18 @@ MSALoginDialog::MSALoginDialog(QWidget* parent) : QDialog(parent), ui(new Ui::MS
{
ui->setupUi(this);
- ui->cancel->setEnabled(false);
- ui->link->setVisible(false);
- ui->copy->setVisible(false);
- ui->progressBar->setVisible(false);
+ // make font monospace
+ QFont font;
+ font.setPixelSize(ui->code->fontInfo().pixelSize());
+ font.setFamily(APPLICATION->settings()->get("ConsoleFont").toString());
+ font.setStyleHint(QFont::Monospace);
+ font.setFixedPitch(true);
+ ui->code->setFont(font);
- connect(ui->cancel, &QPushButton::pressed, this, &QDialog::reject);
- connect(ui->copy, &QPushButton::pressed, this, &MSALoginDialog::copyUrl);
+ ui->buttonBox->button(QDialogButtonBox::Help)->setDefault(false);
+
+ connect(ui->copyCode, &QPushButton::clicked, this, [this] { QApplication::clipboard()->setText(ui->code->text()); });
+ ui->qr->setPixmap(QPixmap(":/documents/login-qr.png"));
}
int MSALoginDialog::exec()
@@ -63,12 +71,12 @@ int MSALoginDialog::exec()
m_account = MinecraftAccount::createBlankMSA();
m_task = m_account->login(m_using_device_code);
connect(m_task.get(), &Task::failed, this, &MSALoginDialog::onTaskFailed);
- connect(m_task.get(), &Task::succeeded, this, &MSALoginDialog::onTaskSucceeded);
+ connect(m_task.get(), &Task::succeeded, this, &QDialog::accept);
+ connect(m_task.get(), &Task::aborted, this, &MSALoginDialog::reject);
connect(m_task.get(), &Task::status, this, &MSALoginDialog::onTaskStatus);
connect(m_task.get(), &AuthFlow::authorizeWithBrowser, this, &MSALoginDialog::authorizeWithBrowser);
connect(m_task.get(), &AuthFlow::authorizeWithBrowserWithExtra, this, &MSALoginDialog::authorizeWithBrowserWithExtra);
- connect(ui->cancel, &QPushButton::pressed, m_task.get(), &Task::abort);
- connect(&m_external_timer, &QTimer::timeout, this, &MSALoginDialog::externalLoginTick);
+ connect(ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, m_task.get(), &Task::abort);
m_task->start();
return QDialog::exec();
@@ -79,9 +87,10 @@ MSALoginDialog::~MSALoginDialog()
delete ui;
}
-void MSALoginDialog::onTaskFailed(const QString& reason)
+void MSALoginDialog::onTaskFailed(QString reason)
{
// Set message
+ ui->stackedWidget->setCurrentIndex(0);
auto lines = reason.split('\n');
QString processed;
for (auto line : lines) {
@@ -91,91 +100,55 @@ void MSALoginDialog::onTaskFailed(const QString& reason)
processed += "
";
}
}
- ui->message->setText(processed);
-}
-
-void MSALoginDialog::onTaskSucceeded()
-{
- QDialog::accept();
-}
-
-void MSALoginDialog::onTaskStatus(const QString& status)
-{
- ui->message->setText(status);
- ui->cancel->setEnabled(false);
- ui->link->setVisible(false);
- ui->copy->setVisible(false);
- ui->progressBar->setVisible(false);
-}
-
-// Public interface
-MinecraftAccountPtr MSALoginDialog::newAccount(QWidget* parent, QString msg, bool usingDeviceCode)
-{
- MSALoginDialog dlg(parent);
- dlg.m_using_device_code = usingDeviceCode;
- dlg.ui->message->setText(msg);
- if (dlg.exec() == QDialog::Accepted) {
- return dlg.m_account;
- }
- return nullptr;
+ ui->status->setText(processed);
+ ui->loadingLabel->setText(m_task->getStatus());
+ disconnect(ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, m_task.get(), &Task::abort);
+ connect(ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &MSALoginDialog::reject);
}
void MSALoginDialog::authorizeWithBrowser(const QUrl& url)
{
- ui->cancel->setEnabled(true);
- ui->link->setVisible(true);
- ui->copy->setVisible(true);
+ ui->stackedWidget->setCurrentIndex(2);
DesktopServices::openUrl(url);
- ui->link->setText(url.toDisplayString());
- ui->message->setText(
+ const auto uri = url.toString();
+ const auto linkString = QString("%2").arg(uri, uri);
+ ui->urlInfo->setText(
tr("Browser opened to complete the login process."
"
"
- "If your browser hasn't opened, please manually open the below link in your browser:"));
-}
-
-void MSALoginDialog::copyUrl()
-{
- QClipboard* cb = QApplication::clipboard();
- cb->setText(ui->link->text());
+ "If your browser hasn't opened, please manually open the following link and choose your account:
"));
+ ui->url->setText(linkString);
}
void MSALoginDialog::authorizeWithBrowserWithExtra(QString url, QString code, int expiresIn)
{
- m_external_elapsed = 0;
- m_external_timeout = expiresIn;
+ ui->stackedWidget->setCurrentIndex(1);
- m_external_timer.setInterval(1000);
- m_external_timer.setSingleShot(false);
- m_external_timer.start();
+ const auto linkString = QString("%2").arg(url, url);
+ ui->code->setText(code);
+ ui->codeInfo->setText(tr("Enter this code into %1 and choose your account.
").arg(linkString));
- ui->progressBar->setMaximum(expiresIn);
- ui->progressBar->setValue(m_external_elapsed);
+ const auto isDefaultUrl = url == "https://www.microsoft.com/link";
- QString linkString = QString("%2").arg(url, url);
- if (url == "https://www.microsoft.com/link" && !code.isEmpty()) {
+ ui->qr->setVisible(isDefaultUrl);
+ if (isDefaultUrl && !code.isEmpty()) {
url += QString("?otc=%1").arg(code);
- ui->message->setText(tr("Please login in the opened browser. If no browser was opened, please open up %1 in "
- "a browser and put in the code %2 to proceed with login.
")
- .arg(linkString, code));
- } else {
- ui->message->setText(
- tr("Please open up %1 in a browser and put in the code %2 to proceed with login.
").arg(linkString, code));
}
- ui->cancel->setEnabled(true);
- ui->link->setVisible(true);
- ui->copy->setVisible(true);
- ui->progressBar->setVisible(true);
DesktopServices::openUrl(url);
- ui->link->setText(code);
}
-void MSALoginDialog::externalLoginTick()
+void MSALoginDialog::onTaskStatus(QString status)
{
- m_external_elapsed++;
- ui->progressBar->setValue(m_external_elapsed);
- ui->progressBar->repaint();
+ ui->stackedWidget->setCurrentIndex(0);
+ ui->status->setText(status);
+}
- if (m_external_elapsed >= m_external_timeout) {
- m_external_timer.stop();
+// Public interface
+MinecraftAccountPtr MSALoginDialog::newAccount(QWidget* parent, bool usingDeviceCode)
+{
+ MSALoginDialog dlg(parent);
+ dlg.m_using_device_code = usingDeviceCode;
+ if (dlg.exec() == QDialog::Accepted) {
+ return dlg.m_account;
}
+ return nullptr;
}
\ No newline at end of file
diff --git a/launcher/ui/dialogs/MSALoginDialog.h b/launcher/ui/dialogs/MSALoginDialog.h
index cef647ee4..cf806d88b 100644
--- a/launcher/ui/dialogs/MSALoginDialog.h
+++ b/launcher/ui/dialogs/MSALoginDialog.h
@@ -32,29 +32,22 @@ class MSALoginDialog : public QDialog {
public:
~MSALoginDialog();
- static MinecraftAccountPtr newAccount(QWidget* parent, QString message, bool usingDeviceCode = false);
+ static MinecraftAccountPtr newAccount(QWidget* parent, bool usingDeviceCode = false);
int exec() override;
private:
explicit MSALoginDialog(QWidget* parent = 0);
protected slots:
- void onTaskFailed(const QString& reason);
- void onTaskSucceeded();
- void onTaskStatus(const QString& status);
+ void onTaskFailed(QString reason);
+ void onTaskStatus(QString status);
void authorizeWithBrowser(const QUrl& url);
void authorizeWithBrowserWithExtra(QString url, QString code, int expiresIn);
- void copyUrl();
- void externalLoginTick();
private:
Ui::MSALoginDialog* ui;
MinecraftAccountPtr m_account;
shared_qobject_ptr m_task;
- int m_external_elapsed;
- int m_external_timeout;
- QTimer m_external_timer;
-
bool m_using_device_code = false;
};
diff --git a/launcher/ui/dialogs/MSALoginDialog.ui b/launcher/ui/dialogs/MSALoginDialog.ui
index df1b32044..afd97e348 100644
--- a/launcher/ui/dialogs/MSALoginDialog.ui
+++ b/launcher/ui/dialogs/MSALoginDialog.ui
@@ -6,90 +6,337 @@
0
0
- 491
- 208
+ 500
+ 300
-
-
- 0
- 0
-
-
Add Microsoft Account
-
-
-
-
- 0
- 0
-
-
-
-
- 500
- 500
-
-
-
-
-
-
- Qt::RichText
-
-
- true
-
-
- true
-
-
- Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse
+
+
+ 2
+
+
+
-
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
+
+
+
+ 16
+ 75
+ true
+
+
+
+ Please wait...
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Status
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 40
+ 75
+ true
+
+
+
+ IBeamCursor
+
+
+ CODE
+
+
+ Qt::AlignCenter
+
+
+ Qt::TextBrowserInteraction
+
+
+
+ -
+
+
+ Copy code to clipboard
+
+
+
+
+
+
+ ..
+
+
+
+ 22
+ 22
+
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+ -
+
+
+
+ false
+
+
+
+ Information
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+ Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 100
+ 100
+
+
+
+
+
+
+ :/assets/login-qr.png
+
+
+ true
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
+
+
+
+ false
+
+
+
+ Information
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+ true
+
+
+ Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse
+
+
+
+ -
+
+
+ url
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+ Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
-
-
-
-
-
-
- false
-
-
-
- -
-
-
-
-
-
-
- ..
-
-
-
-
-
- -
-
-
- 24
+
+
+ QDialogButtonBox::Cancel|QDialogButtonBox::Help
-
+
false
- -
-
-
- Cancel
-
-
-
diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp
index 8d0b66004..3c77cb97a 100644
--- a/launcher/ui/pages/global/AccountListPage.cpp
+++ b/launcher/ui/pages/global/AccountListPage.cpp
@@ -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);
diff --git a/program_info/org.prismlauncher.PrismLauncher.desktop.in b/program_info/org.prismlauncher.PrismLauncher.desktop.in
index a2846b06e..7d186a2e7 100644
--- a/program_info/org.prismlauncher.PrismLauncher.desktop.in
+++ b/program_info/org.prismlauncher.PrismLauncher.desktop.in
@@ -10,4 +10,4 @@ Icon=org.prismlauncher.PrismLauncher
Categories=Game;ActionGame;AdventureGame;Simulation;
Keywords=game;minecraft;mc;
StartupWMClass=PrismLauncher
-MimeType=application/zip;application/x-modrinth-modpack+zip;x-scheme-handler/curseforge;
+MimeType=application/zip;application/x-modrinth-modpack+zip;x-scheme-handler/curseforge;x-scheme-handler/prismlauncher;
diff --git a/program_info/win_install.nsi.in b/program_info/win_install.nsi.in
index eda85821b..cc56b9bd5 100644
--- a/program_info/win_install.nsi.in
+++ b/program_info/win_install.nsi.in
@@ -368,6 +368,10 @@ Section "@Launcher_DisplayName@"
WriteRegStr HKCU Software\Classes\curseforge "URL Protocol" ""
WriteRegStr HKCU Software\Classes\curseforge\shell\open\command "" '"$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" "%1"'
+; Write the URL Handler into registry for prismlauncher
+ WriteRegStr HKCU Software\Classes\prismlauncher "URL Protocol" ""
+ WriteRegStr HKCU Software\Classes\prismlauncher\shell\open\command "" '"$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" "%1"'
+
; Write the uninstall keys for Windows
${GetParameters} $R0
${GetOptions} $R0 "/NoUninstaller" $R1