aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/widgets')
-rw-r--r--launcher/ui/widgets/LanguageSelectionWidget.cpp11
-rw-r--r--launcher/ui/widgets/LanguageSelectionWidget.h2
-rw-r--r--launcher/ui/widgets/PageContainer.cpp2
3 files changed, 14 insertions, 1 deletions
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;
diff --git a/launcher/ui/widgets/PageContainer.cpp b/launcher/ui/widgets/PageContainer.cpp
index 74a6dff3..6de49467 100644
--- a/launcher/ui/widgets/PageContainer.cpp
+++ b/launcher/ui/widgets/PageContainer.cpp
@@ -207,7 +207,7 @@ void PageContainer::help()
QString pageId = m_currentPage->helpPage();
if (pageId.isEmpty())
return;
- DesktopServices::openUrl(QUrl("https://github.com/MultiMC/Launcher/wiki/" + pageId));
+ DesktopServices::openUrl(QUrl("https://github.com/PolyMC/PolyMC/wiki/" + pageId));
}
}