aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui')
-rw-r--r--launcher/ui/GuiUtil.cpp17
-rw-r--r--launcher/ui/MainWindow.cpp89
-rw-r--r--launcher/ui/MainWindow.h9
-rw-r--r--launcher/ui/dialogs/AboutDialog.cpp2
-rw-r--r--launcher/ui/dialogs/MSALoginDialog.cpp12
-rw-r--r--launcher/ui/dialogs/MSALoginDialog.ui27
-rw-r--r--launcher/ui/pages/global/LauncherPage.cpp39
-rw-r--r--launcher/ui/pages/global/LauncherPage.ui10
-rw-r--r--launcher/ui/pages/global/PastePage.cpp (renamed from launcher/ui/pages/global/PasteEEPage.cpp)50
-rw-r--r--launcher/ui/pages/global/PastePage.h (renamed from launcher/ui/pages/global/PasteEEPage.h)14
-rw-r--r--launcher/ui/pages/global/PastePage.ui (renamed from launcher/ui/pages/global/PasteEEPage.ui)67
-rw-r--r--launcher/ui/pages/instance/LogPage.ui2
-rw-r--r--launcher/ui/pages/instance/OtherLogsPage.ui2
-rw-r--r--launcher/ui/widgets/LanguageSelectionWidget.cpp11
-rw-r--r--launcher/ui/widgets/LanguageSelectionWidget.h2
15 files changed, 128 insertions, 225 deletions
diff --git a/launcher/ui/GuiUtil.cpp b/launcher/ui/GuiUtil.cpp
index efb1a4df..9eb658e2 100644
--- a/launcher/ui/GuiUtil.cpp
+++ b/launcher/ui/GuiUtil.cpp
@@ -16,21 +16,8 @@
QString GuiUtil::uploadPaste(const QString &text, QWidget *parentWidget)
{
ProgressDialog dialog(parentWidget);
- auto APIKeySetting = APPLICATION->settings()->get("PasteEEAPIKey").toString();
- if(APIKeySetting == "multimc")
- {
- APIKeySetting = BuildConfig.PASTE_EE_KEY;
- }
- std::unique_ptr<PasteUpload> paste(new PasteUpload(parentWidget, text, APIKeySetting));
-
- if (!paste->validateText())
- {
- CustomMessageBox::selectable(
- parentWidget, QObject::tr("Upload failed"),
- QObject::tr("The log file is too big. You'll have to upload it manually."),
- QMessageBox::Warning)->exec();
- return QString();
- }
+ auto pasteUrlSetting = APPLICATION->settings()->get("PastebinURL").toString();
+ std::unique_ptr<PasteUpload> paste(new PasteUpload(parentWidget, text, pasteUrlSetting));
dialog.execWithTask(paste.get());
if (!paste->wasSuccessful())
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index 3dcc8ee9..202924ff 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -58,7 +58,6 @@
#include <BuildConfig.h>
#include <net/NetJob.h>
#include <net/Download.h>
-#include <news/NewsChecker.h>
#include <notifications/NotificationChecker.h>
#include <tools/BaseProfiler.h>
#include <updater/DownloadTask.h>
@@ -201,7 +200,6 @@ public:
//TranslatedAction actionRefresh;
TranslatedAction actionCheckUpdate;
TranslatedAction actionSettings;
- TranslatedAction actionMoreNews;
TranslatedAction actionManageAccounts;
TranslatedAction actionLaunchInstance;
TranslatedAction actionRenameInstance;
@@ -246,7 +244,6 @@ public:
TranslatedToolbar mainToolBar;
TranslatedToolbar instanceToolBar;
- TranslatedToolbar newsToolBar;
QVector<TranslatedToolbar *> all_toolbars;
bool m_kill = false;
@@ -429,29 +426,6 @@ public:
MainWindow->setStatusBar(statusBar);
}
- void createNewsToolbar(QMainWindow *MainWindow)
- {
- newsToolBar = TranslatedToolbar(MainWindow);
- newsToolBar->setObjectName(QStringLiteral("newsToolBar"));
- newsToolBar->setMovable(false);
- newsToolBar->setAllowedAreas(Qt::BottomToolBarArea);
- newsToolBar->setIconSize(QSize(16, 16));
- newsToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
- newsToolBar->setFloatable(false);
- newsToolBar->setWindowTitle(QT_TRANSLATE_NOOP("MainWindow", "News Toolbar"));
-
- actionMoreNews = TranslatedAction(MainWindow);
- actionMoreNews->setObjectName(QStringLiteral("actionMoreNews"));
- actionMoreNews->setIcon(APPLICATION->getThemedIcon("news"));
- actionMoreNews.setTextId(QT_TRANSLATE_NOOP("MainWindow", "More news..."));
- actionMoreNews.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the development blog to read more news about %1."));
- all_actions.append(&actionMoreNews);
- newsToolBar->addAction(actionMoreNews);
-
- all_toolbars.append(&newsToolBar);
- MainWindow->addToolBar(Qt::BottomToolBarArea, newsToolBar);
- }
-
void createInstanceToolbar(QMainWindow *MainWindow)
{
instanceToolBar = TranslatedToolbar(MainWindow);
@@ -636,7 +610,6 @@ public:
MainWindow->setCentralWidget(centralWidget);
createStatusBar(MainWindow);
- createNewsToolbar(MainWindow);
createInstanceToolbar(MainWindow);
retranslateUi(MainWindow);
@@ -691,20 +664,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
connect(secretEventFilter, &KonamiCode::triggered, this, &MainWindow::konamiTriggered);
}
- // Add the news label to the news toolbar.
- {
- m_newsChecker.reset(new NewsChecker(APPLICATION->network(), BuildConfig.NEWS_RSS_URL));
- newsLabel = new QToolButton();
- newsLabel->setIcon(APPLICATION->getThemedIcon("news"));
- newsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
- newsLabel->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
- newsLabel->setFocusPolicy(Qt::NoFocus);
- ui->newsToolBar->insertWidget(ui->actionMoreNews, newsLabel);
- QObject::connect(newsLabel, &QAbstractButton::clicked, this, &MainWindow::newsButtonClicked);
- QObject::connect(m_newsChecker.get(), &NewsChecker::newsLoaded, this, &MainWindow::updateNewsLabel);
- updateNewsLabel();
- }
-
// Create the instance list widget
{
view = new InstanceView(ui->centralWidget);
@@ -809,13 +768,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
// TODO: refresh accounts here?
// auto accounts = APPLICATION->accounts();
- // load the news
- {
- m_newsChecker->reloadNews();
- updateNewsLabel();
- }
-
-
if(BuildConfig.UPDATER_ENABLED)
{
bool updatesAllowed = APPLICATION->updatesAreAllowed();
@@ -1189,29 +1141,6 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *ev)
return QMainWindow::eventFilter(obj, ev);
}
-void MainWindow::updateNewsLabel()
-{
- if (m_newsChecker->isLoadingNews())
- {
- newsLabel->setText(tr("Loading news..."));
- newsLabel->setEnabled(false);
- }
- else
- {
- QList<NewsEntryPtr> entries = m_newsChecker->getNewsEntries();
- if (entries.length() > 0)
- {
- newsLabel->setText(entries[0]->title);
- newsLabel->setEnabled(true);
- }
- else
- {
- newsLabel->setText(tr("No news available."));
- newsLabel->setEnabled(false);
- }
- }
-}
-
void MainWindow::updateAvailable(GoUpdate::Status status)
{
if(!APPLICATION->updatesAreAllowed())
@@ -1685,24 +1614,6 @@ void MainWindow::on_actionReportBug_triggered()
DesktopServices::openUrl(QUrl(BuildConfig.BUG_TRACKER_URL));
}
-void MainWindow::on_actionMoreNews_triggered()
-{
- DesktopServices::openUrl(QUrl("https://multimc.org/posts.html"));
-}
-
-void MainWindow::newsButtonClicked()
-{
- QList<NewsEntryPtr> entries = m_newsChecker->getNewsEntries();
- if (entries.count() > 0)
- {
- DesktopServices::openUrl(QUrl(entries[0]->link));
- }
- else
- {
- DesktopServices::openUrl(QUrl("https://multimc.org/posts.html"));
- }
-}
-
void MainWindow::on_actionAbout_triggered()
{
AboutDialog dialog(this);
diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h
index f6940ab0..38d925a9 100644
--- a/launcher/ui/MainWindow.h
+++ b/launcher/ui/MainWindow.h
@@ -27,7 +27,6 @@
#include "updater/GoUpdate.h"
class LaunchController;
-class NewsChecker;
class NotificationChecker;
class QToolButton;
class InstanceProxyModel;
@@ -109,10 +108,6 @@ private slots:
void on_actionReportBug_triggered();
- void on_actionMoreNews_triggered();
-
- void newsButtonClicked();
-
void on_actionLaunchInstance_triggered();
void on_actionLaunchInstanceOffline_triggered();
@@ -174,8 +169,6 @@ private slots:
void repopulateAccountsMenu();
- void updateNewsLabel();
-
/*!
* Runs the DownloadTask and installs updates.
*/
@@ -205,14 +198,12 @@ private:
// these are managed by Qt's memory management model!
InstanceView *view = nullptr;
InstanceProxyModel *proxymodel = nullptr;
- QToolButton *newsLabel = nullptr;
QLabel *m_statusLeft = nullptr;
QLabel *m_statusCenter = nullptr;
QMenu *accountMenu = nullptr;
QToolButton *accountMenuButton = nullptr;
KonamiCode * secretEventFilter = nullptr;
- unique_qobject_ptr<NewsChecker> m_newsChecker;
unique_qobject_ptr<NotificationChecker> m_notificationChecker;
InstancePtr m_selectedInstance;
diff --git a/launcher/ui/dialogs/AboutDialog.cpp b/launcher/ui/dialogs/AboutDialog.cpp
index 2ba34f1a..46d2f429 100644
--- a/launcher/ui/dialogs/AboutDialog.cpp
+++ b/launcher/ui/dialogs/AboutDialog.cpp
@@ -99,7 +99,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia
QString urlText("<html><head/><body><p><a href=\"%1\">%1</a></p></body></html>");
ui->urlLabel->setText(urlText.arg(BuildConfig.LAUNCHER_GIT));
- QString copyText("© 2012-2021 %1");
+ QString copyText("© 2021-2022 %1");
ui->copyLabel->setText(copyText.arg(BuildConfig.LAUNCHER_COPYRIGHT));
connect(ui->closeButton, SIGNAL(clicked()), SLOT(close()));
diff --git a/launcher/ui/dialogs/MSALoginDialog.cpp b/launcher/ui/dialogs/MSALoginDialog.cpp
index f46aa3b9..174ad46c 100644
--- a/launcher/ui/dialogs/MSALoginDialog.cpp
+++ b/launcher/ui/dialogs/MSALoginDialog.cpp
@@ -16,15 +16,19 @@
#include "MSALoginDialog.h"
#include "ui_MSALoginDialog.h"
+#include "DesktopServices.h"
#include "minecraft/auth/AccountTask.h"
#include <QtWidgets/QPushButton>
#include <QUrl>
+#include <QApplication>
+#include <QClipboard>
MSALoginDialog::MSALoginDialog(QWidget *parent) : QDialog(parent), ui(new Ui::MSALoginDialog)
{
ui->setupUi(this);
ui->progressBar->setVisible(false);
+ ui->actionButton->setVisible(false);
// ui->buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false);
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
@@ -81,10 +85,17 @@ void MSALoginDialog::showVerificationUriAndCode(const QUrl& uri, const QString&
QString urlString = uri.toString();
QString linkString = QString("<a href=\"%1\">%2</a>").arg(urlString, urlString);
ui->label->setText(tr("<p>Please open up %1 in a browser and put in the code <b>%2</b> to proceed with login.</p>").arg(linkString, code));
+ ui->actionButton->setVisible(true);
+ connect(ui->actionButton, &QPushButton::clicked, [=]() {
+ DesktopServices::openUrl(uri);
+ QClipboard* cb = QApplication::clipboard();
+ cb->setText(code);
+ });
}
void MSALoginDialog::hideVerificationUriAndCode() {
m_externalLoginTimer.stop();
+ ui->actionButton->setVisible(false);
}
void MSALoginDialog::setUserInputsEnabled(bool enable)
@@ -110,6 +121,7 @@ void MSALoginDialog::onTaskFailed(const QString &reason)
// Re-enable user-interaction
setUserInputsEnabled(true);
ui->progressBar->setVisible(false);
+ ui->actionButton->setVisible(false);
}
void MSALoginDialog::onTaskSucceeded()
diff --git a/launcher/ui/dialogs/MSALoginDialog.ui b/launcher/ui/dialogs/MSALoginDialog.ui
index 78cbfb26..c18d01a1 100644
--- a/launcher/ui/dialogs/MSALoginDialog.ui
+++ b/launcher/ui/dialogs/MSALoginDialog.ui
@@ -49,14 +49,25 @@ aaaaa</string>
</widget>
</item>
<item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel</set>
- </property>
- </widget>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="actionButton">
+ <property name="text">
+ <string>Open page and copy code</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</widget>
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp
index 4d4d4e89..0ffe8050 100644
--- a/launcher/ui/pages/global/LauncherPage.cpp
+++ b/launcher/ui/pages/global/LauncherPage.cpp
@@ -246,32 +246,31 @@ 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:
+ 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:
+ case 8:
s->set("IconTheme", "multimc");
break;
}
@@ -327,40 +326,40 @@ 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);
}
else if (theme == "custom")
{
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
@@ -264,11 +264,6 @@
</property>
<item>
<property name="text">
- <string>Default</string>
- </property>
- </item>
- <item>
- <property name="text">
<string>Simple (Dark Icons)</string>
</property>
</item>
@@ -307,6 +302,11 @@
<string>Custom</string>
</property>
</item>
+ <item>
+ <property name="text">
+ <string>MultiMC</string>
+ </property>
+ </item>
</widget>
</item>
<item row="1" column="1">
diff --git a/launcher/ui/pages/global/PasteEEPage.cpp b/launcher/ui/pages/global/PastePage.cpp
index 4b375d9a..7c69e1a4 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,69 +13,51 @@
* limitations under the License.
*/
-#include "PasteEEPage.h"
-#include "ui_PasteEEPage.h"
+#include "PastePage.h"
+#include "ui_PastePage.h"
#include <QMessageBox>
#include <QFileDialog>
#include <QStandardPaths>
#include <QTabBar>
+#include <QVariant>
#include "settings/SettingsObject.h"
#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)
{
+ static QRegularExpression validUrlRegExp("https?://.+");
ui->setupUi(this);
+ ui->urlChoices->setValidator(new QRegularExpressionValidator(validUrlRegExp, ui->urlChoices));
ui->tabWidget->tabBar()->hide();\
- connect(ui->customAPIkeyEdit, &QLineEdit::textEdited, this, &PasteEEPage::textEdited);
loadSettings();
}
-PasteEEPage::~PasteEEPage()
+PastePage::~PastePage()
{
delete ui;
}
-void PasteEEPage::loadSettings()
+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 pastebinURL = s->get("PastebinURL").toString();
+ ui->urlChoices->setCurrentText(pastebinURL);
}
-void PasteEEPage::applySettings()
+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 PasteEEPage::apply()
+bool PastePage::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/PastePage.h
index a1c7d434..d475dfd9 100644
--- a/launcher/ui/pages/global/PasteEEPage.h
+++ b/launcher/ui/pages/global/PastePage.h
@@ -21,16 +21,16 @@
#include <Application.h>
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
{
@@ -54,9 +54,7 @@ private:
void loadSettings();
void applySettings();
-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
index 10883781..2d13a765 100644
--- a/launcher/ui/pages/global/PasteEEPage.ui
+++ b/launcher/ui/pages/global/PastePage.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>PasteEEPage</class>
- <widget class="QWidget" name="PasteEEPage">
+ <class>PastePage</class>
+ <widget class="QWidget" name="PastePage">
<property name="geometry">
<rect>
<x>0</x>
@@ -36,50 +36,55 @@
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
- <string>paste.ee API key</string>
+ <string>Pastebin URL</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_10">
+ <layout class="QVBoxLayout" name="verticalLayout_3">
<item>
- <widget class="QRadioButton" name="multimcButton">
- <property name="text">
- <string>MultiMC key - 12MB &amp;upload limit</string>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- <attribute name="buttonGroup">
- <string notr="true">pasteButtonGroup</string>
- </attribute>
</widget>
</item>
<item>
- <widget class="QRadioButton" name="customButton">
- <property name="text">
- <string>&amp;Your own key - 12MB upload limit:</string>
+ <widget class="QLabel" name="label_2">
+ <property name="font">
+ <font>
+ <pointsize>10</pointsize>
+ </font>
</property>
- <attribute name="buttonGroup">
- <string notr="true">pasteButtonGroup</string>
- </attribute>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="customAPIkeyEdit">
- <property name="echoMode">
- <enum>QLineEdit::Password</enum>
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Note: only input that starts with &lt;span style=&quot; font-weight:600;&quot;&gt;http://&lt;/span&gt; or &lt;span style=&quot; font-weight:600;&quot;&gt;https://&lt;/span&gt; will be accepted.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
- <property name="placeholderText">
- <string>Paste your API key here!</string>
+ <property name="scaledContents">
+ <bool>false</bool>
</property>
</widget>
</item>
<item>
- <widget class="Line" name="line">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <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>https://0x0.st</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>https://paste.polymc.org</string>
+ </property>
+ </item>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://paste.ee&quot;&gt;paste.ee&lt;/a&gt; is used by MultiMC for log uploads. If you have a &lt;a href=&quot;https://paste.ee&quot;&gt;paste.ee&lt;/a&gt; account, you can add your API key here and have your uploaded logs paired with your account.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
@@ -116,13 +121,7 @@
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
- <tabstop>multimcButton</tabstop>
- <tabstop>customButton</tabstop>
- <tabstop>customAPIkeyEdit</tabstop>
</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>
diff --git a/launcher/ui/widgets/LanguageSelectionWidget.cpp b/launcher/ui/widgets/LanguageSelectionWidget.cpp
index cf70c7b4..964d2b7c 100644
--- a/launcher/ui/widgets/LanguageSelectionWidget.cpp
+++ b/launcher/ui/widgets/LanguageSelectionWidget.cpp
@@ -6,6 +6,7 @@
#include <QLabel>
#include "Application.h"
#include "translations/TranslationsModel.h"
+#include "settings/Setting.h"
LanguageSelectionWidget::LanguageSelectionWidget(QWidget *parent) :
QWidget(parent)
@@ -37,6 +38,9 @@ LanguageSelectionWidget::LanguageSelectionWidget(QWidget *parent) :
languageView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
connect(languageView->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &LanguageSelectionWidget::languageRowChanged);
verticalLayout->setContentsMargins(0,0,0,0);
+
+ auto language_setting = APPLICATION->settings()->getSetting("Language");
+ connect(language_setting.get(), &Setting::SettingChanged, this, &LanguageSelectionWidget::languageSettingChanged);
}
QString LanguageSelectionWidget::getSelectedLanguageKey() const
@@ -64,3 +68,10 @@ void LanguageSelectionWidget::languageRowChanged(const QModelIndex& current, con
translations->selectLanguage(key);
translations->updateLanguage(key);
}
+
+void LanguageSelectionWidget::languageSettingChanged(const Setting &, const QVariant)
+{
+ auto translations = APPLICATION->translations();
+ auto index = translations->selectedIndex();
+ languageView->setCurrentIndex(index);
+}
diff --git a/launcher/ui/widgets/LanguageSelectionWidget.h b/launcher/ui/widgets/LanguageSelectionWidget.h
index e65936db..4a88924c 100644
--- a/launcher/ui/widgets/LanguageSelectionWidget.h
+++ b/launcher/ui/widgets/LanguageSelectionWidget.h
@@ -20,6 +20,7 @@
class QVBoxLayout;
class QTreeView;
class QLabel;
+class Setting;
class LanguageSelectionWidget: public QWidget
{
@@ -33,6 +34,7 @@ public:
protected slots:
void languageRowChanged(const QModelIndex &current, const QModelIndex &previous);
+ void languageSettingChanged(const Setting &, const QVariant);
private:
QVBoxLayout *verticalLayout = nullptr;