renamed setting
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
634612ae81
commit
76cc8ce043
@ -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);
|
||||||
|
@ -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
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user