forked from len0rd/rockbox
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:
parent
4bd6c7df61
commit
cbc9208e54
1 changed files with 7 additions and 4 deletions
|
|
@ -38,6 +38,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEFAULT_LANG "English (en)"
|
#define DEFAULT_LANG "English (en)"
|
||||||
|
#define DEFAULT_LANG_CODE "en"
|
||||||
|
|
||||||
Config::Config(QWidget *parent,int index) : QDialog(parent)
|
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
|
// build language list and sort alphabetically
|
||||||
QStringList langs = findLanguageFiles();
|
QStringList langs = findLanguageFiles();
|
||||||
for(int i = 0; i < langs.size(); ++i)
|
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(languageName(langs.at(i))
|
||||||
lang.insert(DEFAULT_LANG, "en");
|
+ QString(" (%1)").arg(langs.at(i)), langs.at(i));
|
||||||
|
lang.insert(DEFAULT_LANG, DEFAULT_LANG_CODE);
|
||||||
QMap<QString, QString>::const_iterator i = lang.constBegin();
|
QMap<QString, QString>::const_iterator i = lang.constBegin();
|
||||||
while (i != lang.constEnd()) {
|
while (i != lang.constEnd()) {
|
||||||
ui.listLanguages->addItem(i.key());
|
ui.listLanguages->addItem(i.key());
|
||||||
|
|
@ -108,10 +110,11 @@ void Config::accept()
|
||||||
settings->setProxyType(proxyType);
|
settings->setProxyType(proxyType);
|
||||||
|
|
||||||
// language
|
// language
|
||||||
if(settings->curLang() != language && !language.isEmpty())
|
if(settings->curLang() != language && !language.isEmpty()) {
|
||||||
QMessageBox::information(this, tr("Language changed"),
|
QMessageBox::information(this, tr("Language changed"),
|
||||||
tr("You need to restart the application for the changed language to take effect."));
|
tr("You need to restart the application for the changed language to take effect."));
|
||||||
settings->setLang(language);
|
settings->setLang(language);
|
||||||
|
}
|
||||||
|
|
||||||
// mountpoint
|
// mountpoint
|
||||||
QString mp = ui.mountPoint->text();
|
QString mp = ui.mountPoint->text();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue