mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
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
This commit is contained in:
parent
8812879aac
commit
e400010eda
1 changed files with 15 additions and 2 deletions
|
|
@ -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());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue