From a62155c1c9e561327cc589fe3da7b6d5a107d58d Mon Sep 17 00:00:00 2001 From: swirl Date: Fri, 14 Jan 2022 18:20:06 -0500 Subject: [PATCH] preliminary stuff for paste.ee removal --- CMakeLists.txt | 3 - buildconfig/BuildConfig.cpp.in | 1 - buildconfig/BuildConfig.h | 5 -- launcher/Application.cpp | 4 +- launcher/CMakeLists.txt | 6 +- .../global/{PasteEEPage.cpp => PastePage.cpp} | 22 ++++---- .../global/{PasteEEPage.h => PastePage.h} | 11 ++-- .../global/{PasteEEPage.ui => PastePage.ui} | 55 ++++++------------- 8 files changed, 40 insertions(+), 67 deletions(-) rename launcher/ui/pages/global/{PasteEEPage.cpp => PastePage.cpp} (81%) rename launcher/ui/pages/global/{PasteEEPage.h => PastePage.h} (88%) rename launcher/ui/pages/global/{PasteEEPage.ui => PastePage.ui} (61%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2af0aa71..91119b2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,9 +68,6 @@ set(Launcher_NOTIFICATION_URL "" CACHE STRING "URL for checking for notification # The metadata server set(Launcher_META_URL "https://meta.multimc.org/v1/" CACHE STRING "URL to fetch Launcher's meta files from.") -# paste.ee API key -set(Launcher_PASTE_EE_API_KEY "utLvciUouSURFzfjPxLBf5W4ISsUX4pwBDF7N1AfZ" CACHE STRING "API key you can get from paste.ee when you register an account") - # Imgur API Client ID set(Launcher_IMGUR_CLIENT_ID "5b97b0713fba4a3" CACHE STRING "Client ID you can get from Imgur when you register an application") diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index af8845dc..2595f78b 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -42,7 +42,6 @@ Config::Config() VERSION_STR = "@Launcher_VERSION_STRING@"; NEWS_RSS_URL = "@Launcher_NEWS_RSS_URL@"; - PASTE_EE_KEY = "@Launcher_PASTE_EE_API_KEY@"; IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@"; MSA_CLIENT_ID = "@Launcher_MSA_CLIENT_ID@"; META_URL = "@Launcher_META_URL@"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index 009fb2bc..d09d5288 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -67,11 +67,6 @@ public: */ QString NEWS_RSS_URL; - /** - * API key you can get from paste.ee when you register an account - */ - QString PASTE_EE_KEY; - /** * Client ID you can get from Imgur when you register an application */ diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 47c9c20e..98e3e0fc 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -14,7 +14,7 @@ #include "ui/pages/global/ProxyPage.h" #include "ui/pages/global/ExternalToolsPage.h" #include "ui/pages/global/AccountListPage.h" -#include "ui/pages/global/PasteEEPage.h" +#include "ui/pages/global/PastePage.h" #include "ui/pages/global/CustomCommandsPage.h" #include "ui/themes/ITheme.h" @@ -728,7 +728,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_globalSettingsProvider->addPage(); m_globalSettingsProvider->addPage(); m_globalSettingsProvider->addPage(); - m_globalSettingsProvider->addPage(); + m_globalSettingsProvider->addPage(); } qDebug() << "<> Settings loaded."; } diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index df361447..21859cad 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -711,8 +711,8 @@ SET(LAUNCHER_SOURCES ui/pages/global/LauncherPage.h ui/pages/global/ProxyPage.cpp ui/pages/global/ProxyPage.h - ui/pages/global/PasteEEPage.cpp - ui/pages/global/PasteEEPage.h + ui/pages/global/PastePage.cpp + ui/pages/global/PastePage.h # GUI - platform pages ui/pages/modplatform/VanillaPage.cpp @@ -848,7 +848,7 @@ qt5_wrap_ui(LAUNCHER_UI ui/pages/global/AccountListPage.ui ui/pages/global/JavaPage.ui ui/pages/global/LauncherPage.ui - ui/pages/global/PasteEEPage.ui + ui/pages/global/PastePage.ui ui/pages/global/ProxyPage.ui ui/pages/global/MinecraftPage.ui ui/pages/global/ExternalToolsPage.ui diff --git a/launcher/ui/pages/global/PasteEEPage.cpp b/launcher/ui/pages/global/PastePage.cpp similarity index 81% rename from launcher/ui/pages/global/PasteEEPage.cpp rename to launcher/ui/pages/global/PastePage.cpp index 4b375d9a..3378a6ef 100644 --- a/launcher/ui/pages/global/PasteEEPage.cpp +++ b/launcher/ui/pages/global/PastePage.cpp @@ -1,4 +1,4 @@ -/* Copyright 2013-2021 MultiMC Contributors +/* 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. @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "PasteEEPage.h" -#include "ui_PasteEEPage.h" +#include "PastePage.h" +#include "ui_PastePage.h" #include #include @@ -25,22 +25,22 @@ #include "tools/BaseProfiler.h" #include "Application.h" -PasteEEPage::PasteEEPage(QWidget *parent) : +PastePage::PastePage(QWidget *parent) : QWidget(parent), - ui(new Ui::PasteEEPage) + ui(new Ui::PastePage) { ui->setupUi(this); ui->tabWidget->tabBar()->hide();\ - connect(ui->customAPIkeyEdit, &QLineEdit::textEdited, this, &PasteEEPage::textEdited); + connect(ui->customAPIkeyEdit, &QLineEdit::textEdited, this, &PastePage::textEdited); loadSettings(); } -PasteEEPage::~PasteEEPage() +PastePage::~PastePage() { delete ui; } -void PasteEEPage::loadSettings() +void PastePage::loadSettings() { auto s = APPLICATION->settings(); QString keyToUse = s->get("PasteEEAPIKey").toString(); @@ -55,7 +55,7 @@ void PasteEEPage::loadSettings() } } -void PasteEEPage::applySettings() +void PastePage::applySettings() { auto s = APPLICATION->settings(); @@ -69,13 +69,13 @@ void PasteEEPage::applySettings() s->set("PasteEEAPIKey", pasteKeyToUse); } -bool PasteEEPage::apply() +bool PastePage::apply() { applySettings(); return true; } -void PasteEEPage::textEdited(const QString& text) +void PastePage::textEdited(const QString& text) { ui->customButton->setChecked(true); } diff --git a/launcher/ui/pages/global/PasteEEPage.h b/launcher/ui/pages/global/PastePage.h similarity index 88% rename from launcher/ui/pages/global/PasteEEPage.h rename to launcher/ui/pages/global/PastePage.h index a1c7d434..3930d4ec 100644 --- a/launcher/ui/pages/global/PasteEEPage.h +++ b/launcher/ui/pages/global/PastePage.h @@ -21,16 +21,16 @@ #include namespace Ui { -class PasteEEPage; +class PastePage; } -class PasteEEPage : public QWidget, public BasePage +class PastePage : public QWidget, public BasePage { Q_OBJECT public: - explicit PasteEEPage(QWidget *parent = 0); - ~PasteEEPage(); + explicit PastePage(QWidget *parent = 0); + ~PastePage(); QString displayName() const override { @@ -58,5 +58,6 @@ private slots: void textEdited(const QString &text); private: - Ui::PasteEEPage *ui; + Ui::PastePage *ui; }; + diff --git a/launcher/ui/pages/global/PasteEEPage.ui b/launcher/ui/pages/global/PastePage.ui similarity index 61% rename from launcher/ui/pages/global/PasteEEPage.ui rename to launcher/ui/pages/global/PastePage.ui index 10883781..0bef5a22 100644 --- a/launcher/ui/pages/global/PasteEEPage.ui +++ b/launcher/ui/pages/global/PastePage.ui @@ -1,7 +1,7 @@ - PasteEEPage - + PastePage + 0 @@ -36,39 +36,9 @@ - paste.ee API key + Pastebin Site - - - - MultiMC key - 12MB &upload limit - - - pasteButtonGroup - - - - - - - &Your own key - 12MB upload limit: - - - pasteButtonGroup - - - - - - - QLineEdit::Password - - - Paste your API key here! - - - @@ -76,10 +46,24 @@ + + + + + 0x0.st + + + + + paste.polymc.org + + + + - <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> + <html><head/><body><p>paste.polymc.org is a pastebin managed by PolyMC's lead maintainer. Something something trust</p></body></html> Qt::RichText @@ -116,9 +100,6 @@ tabWidget - multimcButton - customButton - customAPIkeyEdit