PrismLauncher/launcher/setupwizard/LanguageWizardPage.cpp
Petr Mrázek 441ab7eedc NOISSUE debranding for real, initial work
This is probably very broken on macOS and Windows and will need a lot of work to complete fully.
2021-10-21 00:47:53 +02:00

49 lines
1.1 KiB
C++

#include "LanguageWizardPage.h"
#include <Launcher.h>
#include <translations/TranslationsModel.h>
#include "widgets/LanguageSelectionWidget.h"
#include <QVBoxLayout>
LanguageWizardPage::LanguageWizardPage(QWidget *parent)
: BaseWizardPage(parent)
{
setObjectName(QStringLiteral("languagePage"));
auto layout = new QVBoxLayout(this);
mainWidget = new LanguageSelectionWidget(this);
layout->setContentsMargins(0,0,0,0);
layout->addWidget(mainWidget);
retranslate();
}
LanguageWizardPage::~LanguageWizardPage()
{
}
bool LanguageWizardPage::wantsRefreshButton()
{
return true;
}
void LanguageWizardPage::refresh()
{
auto translations = LAUNCHER->translations();
translations->downloadIndex();
}
bool LanguageWizardPage::validatePage()
{
auto settings = LAUNCHER->settings();
QString key = mainWidget->getSelectedLanguageKey();
settings->set("Language", key);
return true;
}
void LanguageWizardPage::retranslate()
{
setTitle(tr("Language"));
setSubTitle(tr("Select the language to use in MultiMC"));
mainWidget->retranslate();
}