From cbc9208e544296c0656159182d1dd0fe408dc1c0 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Thu, 14 Aug 2008 21:32:32 +0000 Subject: [PATCH] Don't reset the language setting if it wasn't changed but the configuration saved. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18279 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/configure.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp index 4406e4aba2..1589477cd7 100644 --- a/rbutil/rbutilqt/configure.cpp +++ b/rbutil/rbutilqt/configure.cpp @@ -38,6 +38,7 @@ #endif #define DEFAULT_LANG "English (en)" +#define DEFAULT_LANG_CODE "en" Config::Config(QWidget *parent,int index) : QDialog(parent) { @@ -55,8 +56,9 @@ Config::Config(QWidget *parent,int index) : QDialog(parent) // build language list and sort alphabetically QStringList langs = findLanguageFiles(); for(int i = 0; i < langs.size(); ++i) - lang.insert(languageName(langs.at(i)) + tr(" (%1)").arg(langs.at(i)), langs.at(i)); - lang.insert(DEFAULT_LANG, "en"); + lang.insert(languageName(langs.at(i)) + + QString(" (%1)").arg(langs.at(i)), langs.at(i)); + lang.insert(DEFAULT_LANG, DEFAULT_LANG_CODE); QMap::const_iterator i = lang.constBegin(); while (i != lang.constEnd()) { ui.listLanguages->addItem(i.key()); @@ -108,10 +110,11 @@ void Config::accept() settings->setProxyType(proxyType); // language - if(settings->curLang() != language && !language.isEmpty()) + if(settings->curLang() != language && !language.isEmpty()) { QMessageBox::information(this, tr("Language changed"), tr("You need to restart the application for the changed language to take effect.")); - settings->setLang(language); + settings->setLang(language); + } // mountpoint QString mp = ui.mountPoint->text();