feat(ui): add custom MSA client id setting
This commit is contained in:
parent
70a055bc27
commit
bb02226870
@ -14,7 +14,7 @@
|
|||||||
#include "ui/pages/global/ProxyPage.h"
|
#include "ui/pages/global/ProxyPage.h"
|
||||||
#include "ui/pages/global/ExternalToolsPage.h"
|
#include "ui/pages/global/ExternalToolsPage.h"
|
||||||
#include "ui/pages/global/AccountListPage.h"
|
#include "ui/pages/global/AccountListPage.h"
|
||||||
#include "ui/pages/global/PastePage.h"
|
#include "ui/pages/global/APIPage.h"
|
||||||
#include "ui/pages/global/CustomCommandsPage.h"
|
#include "ui/pages/global/CustomCommandsPage.h"
|
||||||
|
|
||||||
#include "ui/themes/ITheme.h"
|
#include "ui/themes/ITheme.h"
|
||||||
@ -719,6 +719,9 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
|
|
||||||
m_settings->registerSetting("CloseAfterLaunch", false);
|
m_settings->registerSetting("CloseAfterLaunch", false);
|
||||||
|
|
||||||
|
// Custom MSA credentials
|
||||||
|
m_settings->registerSetting("MSAClientIDOverride", "");
|
||||||
|
|
||||||
// Init page provider
|
// Init page provider
|
||||||
{
|
{
|
||||||
m_globalSettingsProvider = std::make_shared<GenericPageProvider>(tr("Settings"));
|
m_globalSettingsProvider = std::make_shared<GenericPageProvider>(tr("Settings"));
|
||||||
@ -730,7 +733,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
m_globalSettingsProvider->addPage<ProxyPage>();
|
m_globalSettingsProvider->addPage<ProxyPage>();
|
||||||
m_globalSettingsProvider->addPage<ExternalToolsPage>();
|
m_globalSettingsProvider->addPage<ExternalToolsPage>();
|
||||||
m_globalSettingsProvider->addPage<AccountListPage>();
|
m_globalSettingsProvider->addPage<AccountListPage>();
|
||||||
m_globalSettingsProvider->addPage<PastePage>();
|
m_globalSettingsProvider->addPage<APIPage>();
|
||||||
}
|
}
|
||||||
qDebug() << "<> Settings loaded.";
|
qDebug() << "<> Settings loaded.";
|
||||||
}
|
}
|
||||||
|
@ -723,8 +723,8 @@ SET(LAUNCHER_SOURCES
|
|||||||
ui/pages/global/LauncherPage.h
|
ui/pages/global/LauncherPage.h
|
||||||
ui/pages/global/ProxyPage.cpp
|
ui/pages/global/ProxyPage.cpp
|
||||||
ui/pages/global/ProxyPage.h
|
ui/pages/global/ProxyPage.h
|
||||||
ui/pages/global/PastePage.cpp
|
ui/pages/global/APIPage.cpp
|
||||||
ui/pages/global/PastePage.h
|
ui/pages/global/APIPage.h
|
||||||
|
|
||||||
# GUI - platform pages
|
# GUI - platform pages
|
||||||
ui/pages/modplatform/VanillaPage.cpp
|
ui/pages/modplatform/VanillaPage.cpp
|
||||||
@ -871,7 +871,7 @@ qt5_wrap_ui(LAUNCHER_UI
|
|||||||
ui/pages/global/AccountListPage.ui
|
ui/pages/global/AccountListPage.ui
|
||||||
ui/pages/global/JavaPage.ui
|
ui/pages/global/JavaPage.ui
|
||||||
ui/pages/global/LauncherPage.ui
|
ui/pages/global/LauncherPage.ui
|
||||||
ui/pages/global/PastePage.ui
|
ui/pages/global/APIPage.ui
|
||||||
ui/pages/global/ProxyPage.ui
|
ui/pages/global/ProxyPage.ui
|
||||||
ui/pages/global/MinecraftPage.ui
|
ui/pages/global/MinecraftPage.ui
|
||||||
ui/pages/global/ExternalToolsPage.ui
|
ui/pages/global/ExternalToolsPage.ui
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PastePage.h"
|
#include "APIPage.h"
|
||||||
#include "ui_PastePage.h"
|
#include "ui_APIPage.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
@ -26,9 +26,9 @@
|
|||||||
#include "tools/BaseProfiler.h"
|
#include "tools/BaseProfiler.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
PastePage::PastePage(QWidget *parent) :
|
APIPage::APIPage(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::PastePage)
|
ui(new Ui::APIPage)
|
||||||
{
|
{
|
||||||
static QRegularExpression validUrlRegExp("https?://.+");
|
static QRegularExpression validUrlRegExp("https?://.+");
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
@ -37,26 +37,30 @@ PastePage::PastePage(QWidget *parent) :
|
|||||||
loadSettings();
|
loadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
PastePage::~PastePage()
|
APIPage::~APIPage()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PastePage::loadSettings()
|
void APIPage::loadSettings()
|
||||||
{
|
{
|
||||||
auto s = APPLICATION->settings();
|
auto s = APPLICATION->settings();
|
||||||
QString pastebinURL = s->get("PastebinURL").toString();
|
QString pastebinURL = s->get("PastebinURL").toString();
|
||||||
ui->urlChoices->setCurrentText(pastebinURL);
|
ui->urlChoices->setCurrentText(pastebinURL);
|
||||||
|
QString msaClientID = s->get("MSAClientIDOverride").toString();
|
||||||
|
ui->msaClientID->setText(msaClientID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PastePage::applySettings()
|
void APIPage::applySettings()
|
||||||
{
|
{
|
||||||
auto s = APPLICATION->settings();
|
auto s = APPLICATION->settings();
|
||||||
QString pastebinURL = ui->urlChoices->currentText();
|
QString pastebinURL = ui->urlChoices->currentText();
|
||||||
s->set("PastebinURL", pastebinURL);
|
s->set("PastebinURL", pastebinURL);
|
||||||
|
QString msaClientID = ui->msaClientID->text();
|
||||||
|
s->set("MSAClientIDOverride", msaClientID);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PastePage::apply()
|
bool APIPage::apply()
|
||||||
{
|
{
|
||||||
applySettings();
|
applySettings();
|
||||||
return true;
|
return true;
|
@ -21,32 +21,32 @@
|
|||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class PastePage;
|
class APIPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PastePage : public QWidget, public BasePage
|
class APIPage : public QWidget, public BasePage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PastePage(QWidget *parent = 0);
|
explicit APIPage(QWidget *parent = 0);
|
||||||
~PastePage();
|
~APIPage();
|
||||||
|
|
||||||
QString displayName() const override
|
QString displayName() const override
|
||||||
{
|
{
|
||||||
return tr("Log Upload");
|
return tr("APIs");
|
||||||
}
|
}
|
||||||
QIcon icon() const override
|
QIcon icon() const override
|
||||||
{
|
{
|
||||||
return APPLICATION->getThemedIcon("log");
|
return APPLICATION->getThemedIcon("worlds");
|
||||||
}
|
}
|
||||||
QString id() const override
|
QString id() const override
|
||||||
{
|
{
|
||||||
return "log-upload";
|
return "apis";
|
||||||
}
|
}
|
||||||
QString helpPage() const override
|
QString helpPage() const override
|
||||||
{
|
{
|
||||||
return "Log-Upload";
|
return "APIs";
|
||||||
}
|
}
|
||||||
virtual bool apply() override;
|
virtual bool apply() override;
|
||||||
|
|
||||||
@ -55,6 +55,6 @@ private:
|
|||||||
void applySettings();
|
void applySettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::PastePage *ui;
|
Ui::APIPage *ui;
|
||||||
};
|
};
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>PastePage</class>
|
<class>APIPage</class>
|
||||||
<widget class="QWidget" name="PastePage">
|
<widget class="QWidget" name="APIPage">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_paste">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Pastebin URL</string>
|
<string>Pastebin URL</string>
|
||||||
</property>
|
</property>
|
||||||
@ -100,6 +100,58 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_msa">
|
||||||
|
<property name="title">
|
||||||
|
<string>Microsoft Secured Account</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Note: you probably don't need to set this if logging in via Microsoft Secured Account already works.</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="msaClientID">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>(Default)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enter a custom client ID for Microsoft Secured Account here. </string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -108,7 +160,7 @@
|
|||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>216</height>
|
<height>40</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
Loading…
Reference in New Issue
Block a user