summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-02-03 20:04:34 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-02-03 20:04:34 +0000
commite400010eda4251b54b9d0923716f844589b3eba9 (patch)
treeebc20610960b64756ca01548e2be58fbe3349c47
parent8812879aac0c49dba40e0a9093b7941991ec2b28 (diff)
downloadrockbox-e400010eda4251b54b9d0923716f844589b3eba9.tar.gz
rockbox-e400010eda4251b54b9d0923716f844589b3eba9.tar.bz2
rockbox-e400010eda4251b54b9d0923716f844589b3eba9.zip
Add a simple (and dumb) way to determine the language for voice file creation if it hasn't been used before. Try to use the application language setting (doesn't work for all provided languages) and default to english.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16210 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/createvoicewindow.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/createvoicewindow.cpp b/rbutil/rbutilqt/createvoicewindow.cpp
index cdf2c41822..6d760f14fe 100644
--- a/rbutil/rbutilqt/createvoicewindow.cpp
+++ b/rbutil/rbutilqt/createvoicewindow.cpp
@@ -72,11 +72,23 @@ void CreateVoiceWindow::setSettings(RbSettings* sett)
settings = sett;
// fill in language combobox
- QStringList languages = settings->allLanguages();
+ QStringList languages = settings->allLanguages();
languages.sort();
ui.comboLanguage->addItems(languages);
// set saved lang
- ui.comboLanguage->setCurrentIndex(ui.comboLanguage->findText(settings->voiceLanguage()));
+ int sel = ui.comboLanguage->findText(settings->voiceLanguage());
+ // if no saved language is found try to figure the language from the UI lang
+ if(sel == -1) {
+ QString f = settings->curLang();
+ // if no language is set default to english. Make sure not to check an empty string.
+ if(f.isEmpty()) f = "english";
+ sel = ui.comboLanguage->findText(f, Qt::MatchStartsWith);
+ qDebug() << "sel =" << sel;
+ // still nothing found?
+ if(sel == -1)
+ sel = ui.comboLanguage->findText("english", Qt::MatchStartsWith);
+ }
+ ui.comboLanguage->setCurrentIndex(sel);
QString ttsName = settings->curTTS();
TTSBase* tts = getTTS(ttsName);
@@ -99,6 +111,7 @@ void CreateVoiceWindow::setSettings(RbSettings* sett)
else
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg("Invalid encoder configuration!"));
ui.wavtrimthreshold->setValue(settings->wavtrimTh());
+
}