diff options
author | Bastien Bouclet | 2019-11-13 21:09:21 +0100 |
---|---|---|
committer | Bastien Bouclet | 2019-11-24 14:06:25 +0100 |
commit | 2c812a6b7a0b24b9012379118867fb4f64f32c14 (patch) | |
tree | 6f4225127305dbdae8f3a0dc7dfe61e51af51b1a /gui/options.cpp | |
parent | 3db6aed4e474d5b16639ee4958d1cd13504d12fb (diff) | |
download | scummvm-rg350-2c812a6b7a0b24b9012379118867fb4f64f32c14.tar.gz scummvm-rg350-2c812a6b7a0b24b9012379118867fb4f64f32c14.tar.bz2 scummvm-rg350-2c812a6b7a0b24b9012379118867fb4f64f32c14.zip |
GUI: Add DropdownButtonWidget and use it in the launcher for mass add
DropdownButtonWidget is a button split in two parts vertically. Clicking
the left part triggers a default action. Clicking the right part shows a
list of other actions the user can choose from.
Using this widget on the launcher lets 'Mass add' be a secondary action
of the 'Add' button, removing the necessity of pressing the shift key to
access the feature.
Diffstat (limited to 'gui/options.cpp')
-rw-r--r-- | gui/options.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/gui/options.cpp b/gui/options.cpp index a324ef6338..161742d9bc 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -2154,22 +2154,24 @@ void GlobalOptionsDialog::apply() { } #ifdef USE_TTS Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); - if (newLang != oldLang) { - if (newLang == "C") - ttsMan->setLanguage("en"); - else { - ttsMan->setLanguage(newLang); + if (ttsMan) { + if (newLang != oldLang) { + if (newLang == "C") + ttsMan->setLanguage("en"); + else { + ttsMan->setLanguage(newLang); + } + _ttsVoiceSelectionPopUp->setSelectedTag(0); } - _ttsVoiceSelectionPopUp->setSelectedTag(0); + int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256; + if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm")) + volume = 0; + ttsMan->setVolume(volume); + ConfMan.setBool("tts_enabled", _ttsCheckbox->getState(), _domain); + int selectedVoice = _ttsVoiceSelectionPopUp->getSelectedTag(); + ConfMan.setInt("tts_voice", selectedVoice, _domain); + ttsMan->setVoice(selectedVoice); } - int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256; - if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm")) - volume = 0; - ttsMan->setVolume(volume); - ConfMan.setBool("tts_enabled", _ttsCheckbox->getState(), _domain); - int selectedVoice = _ttsVoiceSelectionPopUp->getSelectedTag(); - ConfMan.setInt("tts_voice", selectedVoice, _domain); - ttsMan->setVoice(selectedVoice); #endif if (isRebuildNeeded) { |