diff options
author | Lenny McLennington <lennymclennington@protonmail.com> | 2022-01-19 07:44:29 +0000 |
---|---|---|
committer | Lenny McLennington <lennymclennington@protonmail.com> | 2022-01-19 08:27:26 +0000 |
commit | b50e58436975761fcb7b8886eb137330e5b6e29a (patch) | |
tree | acc2b74a8f5105f736f57113cade50fc38ff80a5 /launcher/ui/pages | |
parent | a606b47a22443cefc52d865df24c45ff50908f6f (diff) | |
download | PrismLauncher-b50e58436975761fcb7b8886eb137330e5b6e29a.tar.gz PrismLauncher-b50e58436975761fcb7b8886eb137330e5b6e29a.tar.bz2 PrismLauncher-b50e58436975761fcb7b8886eb137330e5b6e29a.zip |
PasteUpload task changed to use 0x0.st's protocol
- Modified PasteUpload task to upload the log file to 0x0.st and other
services with the same protocol.
- Modified Paste settings UI to allow the user to select a custom paste
URL, simplified the settings page code.
Diffstat (limited to 'launcher/ui/pages')
-rw-r--r-- | launcher/ui/pages/global/PastePage.cpp | 23 | ||||
-rw-r--r-- | launcher/ui/pages/global/PastePage.h | 3 | ||||
-rw-r--r-- | launcher/ui/pages/global/PastePage.ui | 17 | ||||
-rw-r--r-- | launcher/ui/pages/instance/LogPage.ui | 2 | ||||
-rw-r--r-- | launcher/ui/pages/instance/OtherLogsPage.ui | 2 |
5 files changed, 17 insertions, 30 deletions
diff --git a/launcher/ui/pages/global/PastePage.cpp b/launcher/ui/pages/global/PastePage.cpp index 495e9937..0965da77 100644 --- a/launcher/ui/pages/global/PastePage.cpp +++ b/launcher/ui/pages/global/PastePage.cpp @@ -20,6 +20,7 @@ #include <QFileDialog> #include <QStandardPaths> #include <QTabBar> +#include <QVariant> #include "settings/SettingsObject.h" #include "tools/BaseProfiler.h" @@ -31,7 +32,6 @@ PastePage::PastePage(QWidget *parent) : { ui->setupUi(this); ui->tabWidget->tabBar()->hide();\ - connect(ui->customAPIkeyEdit, &QLineEdit::textEdited, this, &PastePage::textEdited); loadSettings(); } @@ -43,23 +43,15 @@ PastePage::~PastePage() void PastePage::loadSettings() { auto s = APPLICATION->settings(); - QString pastebin = s->get("PastebinURL"); - int index = ui->urlChoices->findText(pastebin); - ui->urlChoices->setCurrentIndex(index); + QString pastebinURL = s->get("PastebinURL").toString(); + ui->urlChoices->setCurrentText(pastebinURL); } void PastePage::applySettings() { auto s = APPLICATION->settings(); - - QString pasteKeyToUse; - if (ui->customButton->isChecked()) - pasteKeyToUse = ui->customAPIkeyEdit->text(); - else - { - pasteKeyToUse = "multimc"; - } - s->set("PasteEEAPIKey", pasteKeyToUse); + QString pastebinURL = ui->urlChoices->currentText(); + s->set("PastebinURL", pastebinURL); } bool PastePage::apply() @@ -67,8 +59,3 @@ bool PastePage::apply() applySettings(); return true; } - -void PastePage::textEdited(const QString& text) -{ - ui->customButton->setChecked(true); -} diff --git a/launcher/ui/pages/global/PastePage.h b/launcher/ui/pages/global/PastePage.h index 3930d4ec..d475dfd9 100644 --- a/launcher/ui/pages/global/PastePage.h +++ b/launcher/ui/pages/global/PastePage.h @@ -54,9 +54,6 @@ private: void loadSettings(); void applySettings(); -private slots: - void textEdited(const QString &text); - private: Ui::PastePage *ui; }; diff --git a/launcher/ui/pages/global/PastePage.ui b/launcher/ui/pages/global/PastePage.ui index 784ea3f4..fe372540 100644 --- a/launcher/ui/pages/global/PastePage.ui +++ b/launcher/ui/pages/global/PastePage.ui @@ -36,7 +36,7 @@ <item> <widget class="QGroupBox" name="groupBox_2"> <property name="title"> - <string>Pastebin Site</string> + <string>Pastebin URL</string> </property> <layout class="QVBoxLayout" name="verticalLayout_10"> <item> @@ -48,14 +48,20 @@ </item> <item> <widget class="QComboBox" name="urlChoices"> + <property name="editable"> + <bool>true</bool> + </property> + <property name="insertPolicy"> + <enum>QComboBox::NoInsert</enum> + </property> <item> <property name="text"> - <string>0x0.st</string> + <string>https://0x0.st</string> </property> </item> <item> <property name="text"> - <string>paste.polymc.org</string> + <string>https://paste.polymc.org</string> </property> </item> </widget> @@ -63,7 +69,7 @@ <item> <widget class="QLabel" name="label"> <property name="text"> - <string><html><head/><body><p>paste.polymc.org is a pastebin managed by PolyMC's lead maintainer. Something something trust</p></body></html></string> + <string><html><head/><body><p>Here you can choose from a predefined list, or input the URL of a different paste service, provided that it supports the same protocol as 0x0.st, that is POST a file to the URL and return a link in the response body.</p></body></html></string> </property> <property name="textFormat"> <enum>Qt::RichText</enum> @@ -103,7 +109,4 @@ </tabstops> <resources/> <connections/> - <buttongroups> - <buttongroup name="pasteButtonGroup"/> - </buttongroups> </ui> diff --git a/launcher/ui/pages/instance/LogPage.ui b/launcher/ui/pages/instance/LogPage.ui index ccfc1551..31bb368c 100644 --- a/launcher/ui/pages/instance/LogPage.ui +++ b/launcher/ui/pages/instance/LogPage.ui @@ -100,7 +100,7 @@ <item> <widget class="QPushButton" name="btnPaste"> <property name="toolTip"> - <string>Upload the log to paste.ee - it will stay online for a month</string> + <string>Upload the log to the paste service configured in preferences</string> </property> <property name="text"> <string>Upload</string> diff --git a/launcher/ui/pages/instance/OtherLogsPage.ui b/launcher/ui/pages/instance/OtherLogsPage.ui index 56ff3b62..77f3e647 100644 --- a/launcher/ui/pages/instance/OtherLogsPage.ui +++ b/launcher/ui/pages/instance/OtherLogsPage.ui @@ -84,7 +84,7 @@ <item row="3" column="2"> <widget class="QPushButton" name="btnPaste"> <property name="toolTip"> - <string>Upload the log to paste.ee - it will stay online for a month</string> + <string>Upload the log to the paste service configured in preferences.</string> </property> <property name="text"> <string>Upload</string> |