Some checks failed
CodeQL Code Scanning / CodeQL (push) Has been cancelled
Build Application / Build Debug (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (macos-13, x86_64-darwin) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (macos-14, aarch64-darwin) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (ubuntu-22.04, x86_64-linux) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (ubuntu-22.04-arm, aarch64-linux) (push) Has been cancelled
Update Flake Lockfile / update-flake (push) Has been cancelled
47 lines
1.1 KiB
C++
Executable File
47 lines
1.1 KiB
C++
Executable File
#include "LanguageWizardPage.h"
|
|
#include <Application.h>
|
|
#include <translations/TranslationsModel.h>
|
|
|
|
#include <BuildConfig.h>
|
|
#include <QVBoxLayout>
|
|
#include "ui/widgets/LanguageSelectionWidget.h"
|
|
|
|
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 = APPLICATION->translations();
|
|
translations->downloadIndex();
|
|
}
|
|
|
|
bool LanguageWizardPage::validatePage()
|
|
{
|
|
auto settings = APPLICATION->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 %1").arg(BuildConfig.LAUNCHER_DISPLAYNAME));
|
|
mainWidget->retranslate();
|
|
}
|