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
This commit is contained in:
Dominik Riebeling 2008-08-14 21:32:32 +00:00
parent 4bd6c7df61
commit cbc9208e54

View file

@ -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<QString, QString>::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();