diff options
author | Ryan Cao <70191398+ryanccn@users.noreply.github.com> | 2022-06-04 15:33:17 +0800 |
---|---|---|
committer | Ryan Cao <70191398+ryanccn@users.noreply.github.com> | 2022-06-04 15:33:17 +0800 |
commit | 25ab121e42f624352bb4f32faa29e9e455328f09 (patch) | |
tree | dc9e1ff5a800196f4072a8fa019cf615e721b3ab /launcher/ui | |
parent | 04a3669fc470130a5d7f2dfd32f06a3f2aceb165 (diff) | |
download | PrismLauncher-25ab121e42f624352bb4f32faa29e9e455328f09.tar.gz PrismLauncher-25ab121e42f624352bb4f32faa29e9e455328f09.tar.bz2 PrismLauncher-25ab121e42f624352bb4f32faa29e9e455328f09.zip |
feat: custom user-agent
Diffstat (limited to 'launcher/ui')
-rw-r--r-- | launcher/ui/pages/global/APIPage.cpp | 4 | ||||
-rw-r--r-- | launcher/ui/pages/global/APIPage.ui | 27 |
2 files changed, 30 insertions, 1 deletions
diff --git a/launcher/ui/pages/global/APIPage.cpp b/launcher/ui/pages/global/APIPage.cpp index 5d812d07..0c1d7ca2 100644 --- a/launcher/ui/pages/global/APIPage.cpp +++ b/launcher/ui/pages/global/APIPage.cpp @@ -78,6 +78,7 @@ APIPage::APIPage(QWidget *parent) : ui->tabWidget->tabBar()->hide(); ui->metaURL->setPlaceholderText(BuildConfig.META_URL); + ui->userAgentLineEdit->setPlaceholderText(BuildConfig.USER_AGENT); loadSettings(); @@ -139,6 +140,8 @@ void APIPage::loadSettings() ui->metaURL->setText(metaURL); QString curseKey = s->get("CFKeyOverride").toString(); ui->curseKey->setText(curseKey); + QString customUserAgent = s->get("UserAgentOverride").toString(); + ui->userAgentLineEdit->setText(customUserAgent); } void APIPage::applySettings() @@ -167,6 +170,7 @@ void APIPage::applySettings() s->set("MetaURLOverride", metaURL); QString curseKey = ui->curseKey->text(); s->set("CFKeyOverride", curseKey); + s->set("UserAgentOverride", ui->userAgentLineEdit->text()); } bool APIPage::apply() diff --git a/launcher/ui/pages/global/APIPage.ui b/launcher/ui/pages/global/APIPage.ui index 5c927391..0981c700 100644 --- a/launcher/ui/pages/global/APIPage.ui +++ b/launcher/ui/pages/global/APIPage.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>800</width> - <height>600</height> + <height>702</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> @@ -221,6 +221,31 @@ </widget> </item> <item> + <widget class="QGroupBox" name="groupBox_ua"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="title"> + <string>User Agent</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <item> + <widget class="QLineEdit" name="userAgentLineEdit"/> + </item> + <item> + <widget class="QLabel" name="userAgentLabel"> + <property name="text"> + <string>Enter a custom User Agent here. The special string ${launcher_version} will be replaced with the version of the launcher.</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> |