diff options
Diffstat (limited to 'application/pages/global/LanguagePage.cpp')
-rw-r--r-- | application/pages/global/LanguagePage.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/application/pages/global/LanguagePage.cpp b/application/pages/global/LanguagePage.cpp new file mode 100644 index 00000000..ae3168cc --- /dev/null +++ b/application/pages/global/LanguagePage.cpp @@ -0,0 +1,51 @@ +#include "LanguagePage.h" + +#include "widgets/LanguageSelectionWidget.h" +#include <QVBoxLayout> + +LanguagePage::LanguagePage(QWidget* parent) : + QWidget(parent) +{ + setObjectName(QStringLiteral("languagePage")); + auto layout = new QVBoxLayout(this); + mainWidget = new LanguageSelectionWidget(this); + layout->setContentsMargins(0,0,0,0); + layout->addWidget(mainWidget); + retranslate(); +} + +LanguagePage::~LanguagePage() +{ +} + +bool LanguagePage::apply() +{ + applySettings(); + return true; +} + +void LanguagePage::applySettings() +{ + auto settings = MMC->settings(); + QString key = mainWidget->getSelectedLanguageKey(); + settings->set("Language", key); +} + +void LanguagePage::loadSettings() +{ + // NIL +} + +void LanguagePage::retranslate() +{ + mainWidget->retranslate(); +} + +void LanguagePage::changeEvent(QEvent* event) +{ + if (event->type() == QEvent::LanguageChange) + { + retranslate(); + } + QWidget::changeEvent(event); +} |