renamed setting

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-07-12 21:05:13 +03:00
parent 634612ae81
commit 76cc8ce043
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318
3 changed files with 4 additions and 4 deletions

View File

@ -568,7 +568,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
// Language // Language
m_settings->registerSetting("Language", QString()); m_settings->registerSetting("Language", QString());
m_settings->registerSetting("UseSystemLocales", false); m_settings->registerSetting("UseSystemLocale", false);
// Console // Console
m_settings->registerSetting("ShowConsole", false); m_settings->registerSetting("ShowConsole", false);

View File

@ -530,7 +530,7 @@ Language * TranslationsModel::findLanguage(const QString& key)
void TranslationsModel::setUseSystemLocale(bool useSystemLocale) void TranslationsModel::setUseSystemLocale(bool useSystemLocale)
{ {
APPLICATION->settings()->set("UseSystemLocales", useSystemLocale); APPLICATION->settings()->set("UseSystemLocale", useSystemLocale);
QLocale::setDefault(QLocale(useSystemLocale ? QString::fromStdString(std::locale().name()) : defaultLangCode)); QLocale::setDefault(QLocale(useSystemLocale ? QString::fromStdString(std::locale().name()) : defaultLangCode));
} }
@ -566,7 +566,7 @@ bool TranslationsModel::selectLanguage(QString key)
* This function is not reentrant. * This function is not reentrant.
*/ */
QLocale::setDefault( QLocale::setDefault(
QLocale(APPLICATION->settings()->get("UseSystemLocales").toBool() ? QString::fromStdString(std::locale().name()) : langCode)); QLocale(APPLICATION->settings()->get("UseSystemLocale").toBool() ? QString::fromStdString(std::locale().name()) : langCode));
// if it's the default UI language, finish // if it's the default UI language, finish

View File

@ -33,7 +33,7 @@ LanguageSelectionWidget::LanguageSelectionWidget(QWidget* parent) : QWidget(pare
formatCheckbox = new QCheckBox(this); formatCheckbox = new QCheckBox(this);
formatCheckbox->setObjectName(QStringLiteral("formatCheckbox")); formatCheckbox->setObjectName(QStringLiteral("formatCheckbox"));
formatCheckbox->setCheckState(APPLICATION->settings()->get("UseSystemLocales").toBool() ? Qt::Checked : Qt::Unchecked); formatCheckbox->setCheckState(APPLICATION->settings()->get("UseSystemLocale").toBool() ? Qt::Checked : Qt::Unchecked);
connect(formatCheckbox, &QCheckBox::stateChanged, connect(formatCheckbox, &QCheckBox::stateChanged,
[this]() { APPLICATION->translations()->setUseSystemLocale(formatCheckbox->isChecked()); }); [this]() { APPLICATION->translations()->setUseSystemLocale(formatCheckbox->isChecked()); });
verticalLayout->addWidget(formatCheckbox); verticalLayout->addWidget(formatCheckbox);