From d4b522b6cb5281df02da54cd9e0f6445770e7ec7 Mon Sep 17 00:00:00 2001
From: bexnoss <82064510+bexnoss@users.noreply.github.com>
Date: Wed, 12 Jan 2022 10:36:26 +0100
Subject: Add offline mode UI
---
launcher/ui/pages/global/AccountListPage.cpp | 17 +++++++++++++++++
launcher/ui/pages/global/AccountListPage.h | 1 +
launcher/ui/pages/global/AccountListPage.ui | 6 ++++++
3 files changed, 24 insertions(+)
(limited to 'launcher/ui/pages')
diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp
index b8da6c75..b9aa7628 100644
--- a/launcher/ui/pages/global/AccountListPage.cpp
+++ b/launcher/ui/pages/global/AccountListPage.cpp
@@ -24,6 +24,7 @@
#include "net/NetJob.h"
#include "ui/dialogs/ProgressDialog.h"
+#include "ui/dialogs/OfflineLoginDialog.h"
#include "ui/dialogs/LoginDialog.h"
#include "ui/dialogs/MSALoginDialog.h"
#include "ui/dialogs/CustomMessageBox.h"
@@ -153,6 +154,22 @@ void AccountListPage::on_actionAddMicrosoft_triggered()
}
}
+void AccountListPage::on_actionAddOffline_triggered()
+{
+ MinecraftAccountPtr account = OfflineLoginDialog::newAccount(
+ this,
+ tr("Please enter your desired username to add your offline account.")
+ );
+
+ if (account)
+ {
+ m_accounts->addAccount(account);
+ if (m_accounts->count() == 1) {
+ m_accounts->setDefaultAccount(account);
+ }
+ }
+}
+
void AccountListPage::on_actionRemove_triggered()
{
QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes();
diff --git a/launcher/ui/pages/global/AccountListPage.h b/launcher/ui/pages/global/AccountListPage.h
index 1c65e708..841c3fd2 100644
--- a/launcher/ui/pages/global/AccountListPage.h
+++ b/launcher/ui/pages/global/AccountListPage.h
@@ -62,6 +62,7 @@ public:
public slots:
void on_actionAddMojang_triggered();
void on_actionAddMicrosoft_triggered();
+ void on_actionAddOffline_triggered();
void on_actionRemove_triggered();
void on_actionRefresh_triggered();
void on_actionSetDefault_triggered();
diff --git a/launcher/ui/pages/global/AccountListPage.ui b/launcher/ui/pages/global/AccountListPage.ui
index 29738c02..d21a92e2 100644
--- a/launcher/ui/pages/global/AccountListPage.ui
+++ b/launcher/ui/pages/global/AccountListPage.ui
@@ -54,6 +54,7 @@
+
@@ -103,6 +104,11 @@
Add Microsoft
+
+
+ Add Offline
+
+
Refresh
--
cgit
From 395e2655648dbb80d089077e6a6b2530f4876c63 Mon Sep 17 00:00:00 2001
From: bexnoss <82064510+bexnoss@users.noreply.github.com>
Date: Fri, 14 Jan 2022 00:01:05 +0100
Subject: Add offline mode disclaimer
---
launcher/ui/pages/global/AccountListPage.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
(limited to 'launcher/ui/pages')
diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp
index b9aa7628..1c27d5b7 100644
--- a/launcher/ui/pages/global/AccountListPage.cpp
+++ b/launcher/ui/pages/global/AccountListPage.cpp
@@ -158,7 +158,13 @@ void AccountListPage::on_actionAddOffline_triggered()
{
MinecraftAccountPtr account = OfflineLoginDialog::newAccount(
this,
- tr("Please enter your desired username to add your offline account.")
+ tr("Please enter your desired username to add your offline account.
"
+ "
"
+ "It is required by Mojang that you own Minecraft BEFORE you may use offline mode.
"
+ "The PolyMC organization denounces piracy and takes NO LIABILITY WHATSOEVER
"
+ "for any illegal activity that may occur in usage of the offline mode feature.
"
+ "
"
+ "By continuing you promise that you own a Minecraft account.")
);
if (account)
--
cgit
From cdaa397dcffb92ae6a9c659047a87d49286dee4f Mon Sep 17 00:00:00 2001
From: bexnoss <82064510+bexnoss@users.noreply.github.com>
Date: Fri, 14 Jan 2022 14:19:31 +0100
Subject: Reword offline mode disclaimer
---
launcher/ui/pages/global/AccountListPage.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'launcher/ui/pages')
diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp
index 1c27d5b7..ad88812a 100644
--- a/launcher/ui/pages/global/AccountListPage.cpp
+++ b/launcher/ui/pages/global/AccountListPage.cpp
@@ -161,8 +161,8 @@ void AccountListPage::on_actionAddOffline_triggered()
tr("Please enter your desired username to add your offline account.
"
"
"
"It is required by Mojang that you own Minecraft BEFORE you may use offline mode.
"
- "The PolyMC organization denounces piracy and takes NO LIABILITY WHATSOEVER
"
- "for any illegal activity that may occur in usage of the offline mode feature.
"
+ "The PolyMC developers denounce piracy and take NO LIABILITY WHATSOEVER for
"
+ "any illegal activity that may occur in usage of the offline mode feature.
"
"
"
"By continuing you promise that you own a Minecraft account.")
);
--
cgit
From a62155c1c9e561327cc589fe3da7b6d5a107d58d Mon Sep 17 00:00:00 2001
From: swirl
Date: Fri, 14 Jan 2022 18:20:06 -0500
Subject: preliminary stuff for paste.ee removal
---
launcher/ui/pages/global/PasteEEPage.cpp | 81 -------------------
launcher/ui/pages/global/PasteEEPage.h | 62 ---------------
launcher/ui/pages/global/PasteEEPage.ui | 128 -------------------------------
launcher/ui/pages/global/PastePage.cpp | 81 +++++++++++++++++++
launcher/ui/pages/global/PastePage.h | 63 +++++++++++++++
launcher/ui/pages/global/PastePage.ui | 109 ++++++++++++++++++++++++++
6 files changed, 253 insertions(+), 271 deletions(-)
delete mode 100644 launcher/ui/pages/global/PasteEEPage.cpp
delete mode 100644 launcher/ui/pages/global/PasteEEPage.h
delete mode 100644 launcher/ui/pages/global/PasteEEPage.ui
create mode 100644 launcher/ui/pages/global/PastePage.cpp
create mode 100644 launcher/ui/pages/global/PastePage.h
create mode 100644 launcher/ui/pages/global/PastePage.ui
(limited to 'launcher/ui/pages')
diff --git a/launcher/ui/pages/global/PasteEEPage.cpp b/launcher/ui/pages/global/PasteEEPage.cpp
deleted file mode 100644
index 4b375d9a..00000000
--- a/launcher/ui/pages/global/PasteEEPage.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Copyright 2013-2021 MultiMC Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "PasteEEPage.h"
-#include "ui_PasteEEPage.h"
-
-#include
-#include
-#include
-#include
-
-#include "settings/SettingsObject.h"
-#include "tools/BaseProfiler.h"
-#include "Application.h"
-
-PasteEEPage::PasteEEPage(QWidget *parent) :
- QWidget(parent),
- ui(new Ui::PasteEEPage)
-{
- ui->setupUi(this);
- ui->tabWidget->tabBar()->hide();\
- connect(ui->customAPIkeyEdit, &QLineEdit::textEdited, this, &PasteEEPage::textEdited);
- loadSettings();
-}
-
-PasteEEPage::~PasteEEPage()
-{
- delete ui;
-}
-
-void PasteEEPage::loadSettings()
-{
- auto s = APPLICATION->settings();
- QString keyToUse = s->get("PasteEEAPIKey").toString();
- if(keyToUse == "multimc")
- {
- ui->multimcButton->setChecked(true);
- }
- else
- {
- ui->customButton->setChecked(true);
- ui->customAPIkeyEdit->setText(keyToUse);
- }
-}
-
-void PasteEEPage::applySettings()
-{
- auto s = APPLICATION->settings();
-
- QString pasteKeyToUse;
- if (ui->customButton->isChecked())
- pasteKeyToUse = ui->customAPIkeyEdit->text();
- else
- {
- pasteKeyToUse = "multimc";
- }
- s->set("PasteEEAPIKey", pasteKeyToUse);
-}
-
-bool PasteEEPage::apply()
-{
- applySettings();
- return true;
-}
-
-void PasteEEPage::textEdited(const QString& text)
-{
- ui->customButton->setChecked(true);
-}
diff --git a/launcher/ui/pages/global/PasteEEPage.h b/launcher/ui/pages/global/PasteEEPage.h
deleted file mode 100644
index a1c7d434..00000000
--- a/launcher/ui/pages/global/PasteEEPage.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Copyright 2013-2021 MultiMC Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include
-
-#include "ui/pages/BasePage.h"
-#include
-
-namespace Ui {
-class PasteEEPage;
-}
-
-class PasteEEPage : public QWidget, public BasePage
-{
- Q_OBJECT
-
-public:
- explicit PasteEEPage(QWidget *parent = 0);
- ~PasteEEPage();
-
- QString displayName() const override
- {
- return tr("Log Upload");
- }
- QIcon icon() const override
- {
- return APPLICATION->getThemedIcon("log");
- }
- QString id() const override
- {
- return "log-upload";
- }
- QString helpPage() const override
- {
- return "Log-Upload";
- }
- virtual bool apply() override;
-
-private:
- void loadSettings();
- void applySettings();
-
-private slots:
- void textEdited(const QString &text);
-
-private:
- Ui::PasteEEPage *ui;
-};
diff --git a/launcher/ui/pages/global/PasteEEPage.ui b/launcher/ui/pages/global/PasteEEPage.ui
deleted file mode 100644
index 10883781..00000000
--- a/launcher/ui/pages/global/PasteEEPage.ui
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
- PasteEEPage
-
-
-
- 0
- 0
- 491
- 474
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
- 0
-
-
-
- Tab 1
-
-
-
-
-
-
- paste.ee API key
-
-
-
-
-
-
- MultiMC key - 12MB &upload limit
-
-
- pasteButtonGroup
-
-
-
- -
-
-
- &Your own key - 12MB upload limit:
-
-
- pasteButtonGroup
-
-
-
- -
-
-
- QLineEdit::Password
-
-
- Paste your API key here!
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- <html><head/><body><p><a href="https://paste.ee">paste.ee</a> is used by MultiMC for log uploads. If you have a <a href="https://paste.ee">paste.ee</a> account, you can add your API key here and have your uploaded logs paired with your account.</p></body></html>
-
-
- Qt::RichText
-
-
- true
-
-
- true
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 216
-
-
-
-
-
-
-
-
-
-
-
- tabWidget
- multimcButton
- customButton
- customAPIkeyEdit
-
-
-
-
-
-
-
diff --git a/launcher/ui/pages/global/PastePage.cpp b/launcher/ui/pages/global/PastePage.cpp
new file mode 100644
index 00000000..3378a6ef
--- /dev/null
+++ b/launcher/ui/pages/global/PastePage.cpp
@@ -0,0 +1,81 @@
+/* Copyright 2013-2021 MultiMC & PolyMC Contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "PastePage.h"
+#include "ui_PastePage.h"
+
+#include
+#include
+#include
+#include
+
+#include "settings/SettingsObject.h"
+#include "tools/BaseProfiler.h"
+#include "Application.h"
+
+PastePage::PastePage(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::PastePage)
+{
+ ui->setupUi(this);
+ ui->tabWidget->tabBar()->hide();\
+ connect(ui->customAPIkeyEdit, &QLineEdit::textEdited, this, &PastePage::textEdited);
+ loadSettings();
+}
+
+PastePage::~PastePage()
+{
+ delete ui;
+}
+
+void PastePage::loadSettings()
+{
+ auto s = APPLICATION->settings();
+ QString keyToUse = s->get("PasteEEAPIKey").toString();
+ if(keyToUse == "multimc")
+ {
+ ui->multimcButton->setChecked(true);
+ }
+ else
+ {
+ ui->customButton->setChecked(true);
+ ui->customAPIkeyEdit->setText(keyToUse);
+ }
+}
+
+void PastePage::applySettings()
+{
+ auto s = APPLICATION->settings();
+
+ QString pasteKeyToUse;
+ if (ui->customButton->isChecked())
+ pasteKeyToUse = ui->customAPIkeyEdit->text();
+ else
+ {
+ pasteKeyToUse = "multimc";
+ }
+ s->set("PasteEEAPIKey", pasteKeyToUse);
+}
+
+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
new file mode 100644
index 00000000..3930d4ec
--- /dev/null
+++ b/launcher/ui/pages/global/PastePage.h
@@ -0,0 +1,63 @@
+/* Copyright 2013-2021 MultiMC Contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include
+
+#include "ui/pages/BasePage.h"
+#include
+
+namespace Ui {
+class PastePage;
+}
+
+class PastePage : public QWidget, public BasePage
+{
+ Q_OBJECT
+
+public:
+ explicit PastePage(QWidget *parent = 0);
+ ~PastePage();
+
+ QString displayName() const override
+ {
+ return tr("Log Upload");
+ }
+ QIcon icon() const override
+ {
+ return APPLICATION->getThemedIcon("log");
+ }
+ QString id() const override
+ {
+ return "log-upload";
+ }
+ QString helpPage() const override
+ {
+ return "Log-Upload";
+ }
+ virtual bool apply() override;
+
+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
new file mode 100644
index 00000000..0bef5a22
--- /dev/null
+++ b/launcher/ui/pages/global/PastePage.ui
@@ -0,0 +1,109 @@
+
+
+ PastePage
+
+
+
+ 0
+ 0
+ 491
+ 474
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+ 0
+
+
+
+ Tab 1
+
+
+
-
+
+
+ Pastebin Site
+
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
-
+
+ 0x0.st
+
+
+ -
+
+ paste.polymc.org
+
+
+
+
+ -
+
+
+ <html><head/><body><p>paste.polymc.org is a pastebin managed by PolyMC's lead maintainer. Something something trust</p></body></html>
+
+
+ Qt::RichText
+
+
+ true
+
+
+ true
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 216
+
+
+
+
+
+
+
+
+
+
+
+ tabWidget
+
+
+
+
+
+
+
--
cgit
From a606b47a22443cefc52d865df24c45ff50908f6f Mon Sep 17 00:00:00 2001
From: swirl
Date: Fri, 14 Jan 2022 18:30:02 -0500
Subject: pastebin URL app setting
---
launcher/ui/pages/global/PastePage.cpp | 13 +++----------
launcher/ui/pages/global/PastePage.ui | 2 +-
2 files changed, 4 insertions(+), 11 deletions(-)
(limited to 'launcher/ui/pages')
diff --git a/launcher/ui/pages/global/PastePage.cpp b/launcher/ui/pages/global/PastePage.cpp
index 3378a6ef..495e9937 100644
--- a/launcher/ui/pages/global/PastePage.cpp
+++ b/launcher/ui/pages/global/PastePage.cpp
@@ -43,16 +43,9 @@ PastePage::~PastePage()
void PastePage::loadSettings()
{
auto s = APPLICATION->settings();
- QString keyToUse = s->get("PasteEEAPIKey").toString();
- if(keyToUse == "multimc")
- {
- ui->multimcButton->setChecked(true);
- }
- else
- {
- ui->customButton->setChecked(true);
- ui->customAPIkeyEdit->setText(keyToUse);
- }
+ QString pastebin = s->get("PastebinURL");
+ int index = ui->urlChoices->findText(pastebin);
+ ui->urlChoices->setCurrentIndex(index);
}
void PastePage::applySettings()
diff --git a/launcher/ui/pages/global/PastePage.ui b/launcher/ui/pages/global/PastePage.ui
index 0bef5a22..784ea3f4 100644
--- a/launcher/ui/pages/global/PastePage.ui
+++ b/launcher/ui/pages/global/PastePage.ui
@@ -47,7 +47,7 @@
-
-
+
-
0x0.st
--
cgit
From 81fe41a038ee12ff2ee0200525b39e4ad650bec2 Mon Sep 17 00:00:00 2001
From: swirl
Date: Sun, 16 Jan 2022 12:02:53 -0500
Subject: Default to colored icons, update copyright
Closes: #74
---
launcher/ui/pages/global/LauncherPage.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'launcher/ui/pages')
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp
index 4d4d4e89..81ecd58f 100644
--- a/launcher/ui/pages/global/LauncherPage.cpp
+++ b/launcher/ui/pages/global/LauncherPage.cpp
@@ -256,7 +256,7 @@ void LauncherPage::applySettings()
s->set("IconTheme", "pe_blue");
break;
case 4:
- s->set("IconTheme", "pe_colored");
+ s->set("IconTheme", "multimc");
break;
case 5:
s->set("IconTheme", "OSX");
@@ -272,7 +272,7 @@ void LauncherPage::applySettings()
break;
case 0:
default:
- s->set("IconTheme", "multimc");
+ s->set("IconTheme", "pe_colored");
break;
}
--
cgit
From 55597b458ced4d7ad8082ab226617ba48e177ee6 Mon Sep 17 00:00:00 2001
From: Lenny McLennington
Date: Mon, 17 Jan 2022 03:45:47 +0000
Subject: Revert "Merge pull request #50 from bexnoss/offline-mode"
This reverts commit b4f750e7db40352111417ea89a9f375ae8c746ab, reversing
changes made to b19e3156154ba0dd232a3d165b1759c57e2858f2.
---
launcher/ui/pages/global/AccountListPage.cpp | 23 -----------------------
launcher/ui/pages/global/AccountListPage.h | 1 -
launcher/ui/pages/global/AccountListPage.ui | 6 ------
3 files changed, 30 deletions(-)
(limited to 'launcher/ui/pages')
diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp
index ad88812a..b8da6c75 100644
--- a/launcher/ui/pages/global/AccountListPage.cpp
+++ b/launcher/ui/pages/global/AccountListPage.cpp
@@ -24,7 +24,6 @@
#include "net/NetJob.h"
#include "ui/dialogs/ProgressDialog.h"
-#include "ui/dialogs/OfflineLoginDialog.h"
#include "ui/dialogs/LoginDialog.h"
#include "ui/dialogs/MSALoginDialog.h"
#include "ui/dialogs/CustomMessageBox.h"
@@ -154,28 +153,6 @@ void AccountListPage::on_actionAddMicrosoft_triggered()
}
}
-void AccountListPage::on_actionAddOffline_triggered()
-{
- MinecraftAccountPtr account = OfflineLoginDialog::newAccount(
- this,
- tr("Please enter your desired username to add your offline account.
"
- "
"
- "It is required by Mojang that you own Minecraft BEFORE you may use offline mode.
"
- "The PolyMC developers denounce piracy and take NO LIABILITY WHATSOEVER for
"
- "any illegal activity that may occur in usage of the offline mode feature.
"
- "
"
- "By continuing you promise that you own a Minecraft account.")
- );
-
- if (account)
- {
- m_accounts->addAccount(account);
- if (m_accounts->count() == 1) {
- m_accounts->setDefaultAccount(account);
- }
- }
-}
-
void AccountListPage::on_actionRemove_triggered()
{
QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes();
diff --git a/launcher/ui/pages/global/AccountListPage.h b/launcher/ui/pages/global/AccountListPage.h
index 841c3fd2..1c65e708 100644
--- a/launcher/ui/pages/global/AccountListPage.h
+++ b/launcher/ui/pages/global/AccountListPage.h
@@ -62,7 +62,6 @@ public:
public slots:
void on_actionAddMojang_triggered();
void on_actionAddMicrosoft_triggered();
- void on_actionAddOffline_triggered();
void on_actionRemove_triggered();
void on_actionRefresh_triggered();
void on_actionSetDefault_triggered();
diff --git a/launcher/ui/pages/global/AccountListPage.ui b/launcher/ui/pages/global/AccountListPage.ui
index d21a92e2..29738c02 100644
--- a/launcher/ui/pages/global/AccountListPage.ui
+++ b/launcher/ui/pages/global/AccountListPage.ui
@@ -54,7 +54,6 @@
-
@@ -104,11 +103,6 @@
Add Microsoft
-
-
- Add Offline
-
-
Refresh
--
cgit
From b50e58436975761fcb7b8886eb137330e5b6e29a Mon Sep 17 00:00:00 2001
From: Lenny McLennington
Date: Wed, 19 Jan 2022 07:44:29 +0000
Subject: 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.
---
launcher/ui/pages/global/PastePage.cpp | 23 +++++------------------
launcher/ui/pages/global/PastePage.h | 3 ---
launcher/ui/pages/global/PastePage.ui | 17 ++++++++++-------
launcher/ui/pages/instance/LogPage.ui | 2 +-
launcher/ui/pages/instance/OtherLogsPage.ui | 2 +-
5 files changed, 17 insertions(+), 30 deletions(-)
(limited to 'launcher/ui/pages')
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
#include
#include
+#include
#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 @@
-
- Pastebin Site
+ Pastebin URL
-
@@ -48,14 +48,20 @@
-
+
+ true
+
+
+ QComboBox::NoInsert
+
-
- 0x0.st
+ https://0x0.st
-
- paste.polymc.org
+ https://paste.polymc.org
@@ -63,7 +69,7 @@
-
- <html><head/><body><p>paste.polymc.org is a pastebin managed by PolyMC's lead maintainer. Something something trust</p></body></html>
+ <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>
Qt::RichText
@@ -103,7 +109,4 @@
-
-
-
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 @@
-
- Upload the log to paste.ee - it will stay online for a month
+ Upload the log to the paste service configured in preferences
Upload
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 @@
-
- Upload the log to paste.ee - it will stay online for a month
+ Upload the log to the paste service configured in preferences.
Upload
--
cgit
From 0eff21a4f1ee97e4b0a484c608eac9617897446d Mon Sep 17 00:00:00 2001
From: Lenny McLennington
Date: Wed, 26 Jan 2022 00:31:08 +0000
Subject: Validate Pastebin URL with regex
---
launcher/ui/pages/global/PastePage.cpp | 2 ++
launcher/ui/pages/global/PastePage.ui | 19 +++++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
(limited to 'launcher/ui/pages')
diff --git a/launcher/ui/pages/global/PastePage.cpp b/launcher/ui/pages/global/PastePage.cpp
index 0965da77..7c69e1a4 100644
--- a/launcher/ui/pages/global/PastePage.cpp
+++ b/launcher/ui/pages/global/PastePage.cpp
@@ -30,7 +30,9 @@ PastePage::PastePage(QWidget *parent) :
QWidget(parent),
ui(new Ui::PastePage)
{
+ static QRegularExpression validUrlRegExp("https?://.+");
ui->setupUi(this);
+ ui->urlChoices->setValidator(new QRegularExpressionValidator(validUrlRegExp, ui->urlChoices));
ui->tabWidget->tabBar()->hide();\
loadSettings();
}
diff --git a/launcher/ui/pages/global/PastePage.ui b/launcher/ui/pages/global/PastePage.ui
index fe372540..2d13a765 100644
--- a/launcher/ui/pages/global/PastePage.ui
+++ b/launcher/ui/pages/global/PastePage.ui
@@ -38,7 +38,7 @@
Pastebin URL
-
+
-
@@ -46,6 +46,21 @@
+ -
+
+
+
+ 10
+
+
+
+ <html><head/><body><p>Note: only input that starts with <span style=" font-weight:600;">http://</span> or <span style=" font-weight:600;">https://</span> will be accepted.</p></body></html>
+
+
+ false
+
+
+
-
@@ -69,7 +84,7 @@
-
- <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>
+ <html><head/><body><p>Here you can choose from a predefined list of paste services, or input the URL of a different paste service of your choice, provided it supports the same protocol as 0x0.st, that is POST a file parameter to the URL and return a link in the response body.</p></body></html>
Qt::RichText
--
cgit
From 5ac528f141f2c55fb09c6d59c5fd71d5f83c46ce Mon Sep 17 00:00:00 2001
From: Joshua Goins
Date: Thu, 27 Jan 2022 18:37:57 -0500
Subject: Fix icons changing when exiting the settings window
---
launcher/ui/pages/global/LauncherPage.cpp | 43 +++++++++++++++----------------
launcher/ui/pages/global/LauncherPage.ui | 10 +++----
2 files changed, 26 insertions(+), 27 deletions(-)
(limited to 'launcher/ui/pages')
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp
index 81ecd58f..0ffe8050 100644
--- a/launcher/ui/pages/global/LauncherPage.cpp
+++ b/launcher/ui/pages/global/LauncherPage.cpp
@@ -246,33 +246,32 @@ void LauncherPage::applySettings()
//FIXME: make generic
switch (ui->themeComboBox->currentIndex())
{
- case 1:
+ case 0:
s->set("IconTheme", "pe_dark");
break;
- case 2:
+ case 1:
s->set("IconTheme", "pe_light");
break;
- case 3:
+ case 2:
s->set("IconTheme", "pe_blue");
break;
- case 4:
- s->set("IconTheme", "multimc");
+ case 3:
+ s->set("IconTheme", "pe_colored");
break;
- case 5:
+ case 4:
s->set("IconTheme", "OSX");
break;
- case 6:
+ case 5:
s->set("IconTheme", "iOS");
break;
- case 7:
+ case 6:
s->set("IconTheme", "flat");
break;
- case 8:
+ case 7:
s->set("IconTheme", "custom");
break;
- case 0:
- default:
- s->set("IconTheme", "pe_colored");
+ case 8:
+ s->set("IconTheme", "multimc");
break;
}
@@ -327,29 +326,33 @@ void LauncherPage::loadSettings()
auto theme = s->get("IconTheme").toString();
if (theme == "pe_dark")
{
- ui->themeComboBox->setCurrentIndex(1);
+ ui->themeComboBox->setCurrentIndex(0);
}
else if (theme == "pe_light")
{
- ui->themeComboBox->setCurrentIndex(2);
+ ui->themeComboBox->setCurrentIndex(1);
}
else if (theme == "pe_blue")
{
- ui->themeComboBox->setCurrentIndex(3);
+ ui->themeComboBox->setCurrentIndex(2);
}
else if (theme == "pe_colored")
{
- ui->themeComboBox->setCurrentIndex(4);
+ ui->themeComboBox->setCurrentIndex(3);
}
else if (theme == "OSX")
{
- ui->themeComboBox->setCurrentIndex(5);
+ ui->themeComboBox->setCurrentIndex(4);
}
else if (theme == "iOS")
{
- ui->themeComboBox->setCurrentIndex(6);
+ ui->themeComboBox->setCurrentIndex(5);
}
else if (theme == "flat")
+ {
+ ui->themeComboBox->setCurrentIndex(6);
+ }
+ else if (theme == "multimc")
{
ui->themeComboBox->setCurrentIndex(7);
}
@@ -357,10 +360,6 @@ void LauncherPage::loadSettings()
{
ui->themeComboBox->setCurrentIndex(8);
}
- else
- {
- ui->themeComboBox->setCurrentIndex(0);
- }
{
auto currentTheme = s->get("ApplicationTheme").toString();
diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui
index 2b3729bc..47fed873 100644
--- a/launcher/ui/pages/global/LauncherPage.ui
+++ b/launcher/ui/pages/global/LauncherPage.ui
@@ -262,11 +262,6 @@
Qt::StrongFocus
-
-
-
- Default
-
-
-
Simple (Dark Icons)
@@ -307,6 +302,11 @@
Custom
+ -
+
+ MultiMC
+
+
-
--
cgit