]> sigrok.org Git - pulseview.git/commitdiff
Settings: Fix the default item in the language combobox
authorSelf Not Found <redacted>
Wed, 14 Sep 2022 13:44:04 +0000 (21:44 +0800)
committerSoeren Apel <redacted>
Sat, 8 Oct 2022 19:31:22 +0000 (21:31 +0200)
If the language is not set, the default language will be English, but the combobox will show "German"(The first item in language combobox)
This is because the current_language will set to "" if the language is not set, and it doesn't match the default language "en"

pv/dialogs/settings.cpp

index 00c7dcfc5d29ff9aff8c731811ff58cd1a4800ab..bcf32df76ec4937a52b8b3e569b5129eb997e25a 100644 (file)
@@ -220,7 +220,7 @@ QWidget *Settings::get_general_settings_form(QWidget *parent) const
        QComboBox *language_cb = new QComboBox();
        Application* a = qobject_cast<Application*>(QApplication::instance());
 
-       QString current_language = settings.value(GlobalSettings::Key_General_Language).toString();
+       QString current_language = settings.value(GlobalSettings::Key_General_Language, "en").toString();
        for (const QString& language : a->get_languages()) {
                const QLocale locale = QLocale(language);
                const QString desc = locale.languageToString(locale.language());