diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-03-01 09:54:49 +0000 |
---|---|---|
committer | TheKodeToad <TheKodeToad@proton.me> | 2023-03-01 14:24:56 +0000 |
commit | 1feb63052020db941a3c1a10d14c9a4791169c1a (patch) | |
tree | 800196711094dca2cce8d8dac9b318a06f3292cc /launcher/ui | |
parent | 0eae9355e6597a9504320d79b7a4023b87531678 (diff) | |
download | PrismLauncher-1feb63052020db941a3c1a10d14c9a4791169c1a.tar.gz PrismLauncher-1feb63052020db941a3c1a10d14c9a4791169c1a.tar.bz2 PrismLauncher-1feb63052020db941a3c1a10d14c9a4791169c1a.zip |
Allow custom Modrinth API token
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/ui')
-rw-r--r-- | launcher/ui/pages/global/APIPage.cpp | 5 | ||||
-rw-r--r-- | launcher/ui/pages/global/APIPage.ui | 45 |
2 files changed, 50 insertions, 0 deletions
diff --git a/launcher/ui/pages/global/APIPage.cpp b/launcher/ui/pages/global/APIPage.cpp index e3d30475..ac74b3a1 100644 --- a/launcher/ui/pages/global/APIPage.cpp +++ b/launcher/ui/pages/global/APIPage.cpp @@ -4,6 +4,7 @@ * Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> * Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org> * Copyright (c) 2022 Lenny McLennington <lenny@sneed.church> + * Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -147,6 +148,8 @@ void APIPage::loadSettings() ui->metaURL->setText(metaURL); QString flameKey = s->get("FlameKeyOverride").toString(); ui->flameKey->setText(flameKey); + QString modrinthToken = s->get("ModrinthToken").toString(); + ui->modrinthToken->setText(modrinthToken); QString customUserAgent = s->get("UserAgentOverride").toString(); ui->userAgentLineEdit->setText(customUserAgent); } @@ -177,6 +180,8 @@ void APIPage::applySettings() s->set("MetaURLOverride", metaURL); QString flameKey = ui->flameKey->text(); s->set("FlameKeyOverride", flameKey); + QString modrinthToken = ui->modrinthToken->text(); + s->set("ModrinthToken", modrinthToken); s->set("UserAgentOverride", ui->userAgentLineEdit->text()); } diff --git a/launcher/ui/pages/global/APIPage.ui b/launcher/ui/pages/global/APIPage.ui index d56a9ef6..b09a86ee 100644 --- a/launcher/ui/pages/global/APIPage.ui +++ b/launcher/ui/pages/global/APIPage.ui @@ -241,6 +241,51 @@ </widget> </item> <item> + <widget class="QGroupBox" name="groupBox_modrinth"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="title"> + <string>&Modrinth API</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label_8"> + <property name="text"> + <string>Note: you only need to set this to access private data.</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_7"> + <property name="text"> + <string>Enter a custom API token for Modrinth 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> + <item row="1" column="0"> + <widget class="QLineEdit" name="modrinthToken"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="placeholderText"> + <string>(None)</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> |