diff options
author | Andre Heider | 2010-09-05 15:26:00 +0000 |
---|---|---|
committer | Andre Heider | 2010-09-05 15:26:00 +0000 |
commit | 09834b8bec5fdaf24719988376debf8671518846 (patch) | |
tree | fd25fc6b22f8935d4ccd30c122c972106b6ca52a /gui/options.cpp | |
parent | 402c71860f0a6f254604b1fbd1a763d470c859c0 (diff) | |
parent | 13e24af0cace8599d31c8bb7381fa9fce49a8e6e (diff) | |
download | scummvm-rg350-09834b8bec5fdaf24719988376debf8671518846.tar.gz scummvm-rg350-09834b8bec5fdaf24719988376debf8671518846.tar.bz2 scummvm-rg350-09834b8bec5fdaf24719988376debf8671518846.zip |
MERGE: Merge trunk to branch.
svn-id: r52564
Diffstat (limited to 'gui/options.cpp')
-rw-r--r-- | gui/options.cpp | 127 |
1 files changed, 82 insertions, 45 deletions
diff --git a/gui/options.cpp b/gui/options.cpp index d1901e9219..7c7093fa95 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -227,7 +227,7 @@ void OptionsDialog::open() { Common::String soundFont(ConfMan.get("soundfont", _domain)); if (soundFont.empty() || !ConfMan.hasKey("soundfont", _domain)) { - _soundFont->setLabel(_("None")); + _soundFont->setLabel(_c("None", "soundfont")); _soundFontClearButton->setEnabled(false); } else { _soundFont->setLabel(soundFont); @@ -396,7 +396,7 @@ void OptionsDialog::close() { ConfMan.setInt("midi_gain", _midiGainSlider->getValue(), _domain); Common::String soundFont(_soundFont->getLabel()); - if (!soundFont.empty() && (soundFont != _("None"))) + if (!soundFont.empty() && (soundFont != _c("None", "soundfont"))) ConfMan.set("soundfont", soundFont, _domain); else ConfMan.removeKey("soundfont", _domain); @@ -494,7 +494,7 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data _subSpeedLabel->draw(); break; case kClearSoundFontCmd: - _soundFont->setLabel(_("None")); + _soundFont->setLabel(_c("None", "soundfont")); _soundFontClearButton->setEnabled(false); draw(); break; @@ -552,7 +552,7 @@ void OptionsDialog::setMIDISettingsState(bool enabled) { _soundFontButton->setEnabled(enabled); _soundFont->setEnabled(enabled); - if (enabled && !_soundFont->getLabel().empty() && (_soundFont->getLabel() != _("None"))) + if (enabled && !_soundFont->getLabel().empty() && (_soundFont->getLabel() != _c("None", "soundfont"))) _soundFontClearButton->setEnabled(enabled); else _soundFontClearButton->setEnabled(false); @@ -627,7 +627,10 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) { void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &prefix) { const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes(); - + Common::String context; + if (g_system->getOverlayWidth() <= 320) + context = "lowres"; + // The GFX mode popup _gfxPopUpDesc = new StaticTextWidget(boss, prefix + "grModePopupDesc", _("Graphics mode:")); _gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup"); @@ -635,7 +638,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr _gfxPopUp->appendEntry(_("<default>")); _gfxPopUp->appendEntry(""); while (gm->name) { - _gfxPopUp->appendEntry(_(gm->description), gm->id); + _gfxPopUp->appendEntry(_c(gm->description, context), gm->id); gm++; } @@ -646,7 +649,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr _renderModePopUp->appendEntry(""); const Common::RenderModeDescription *rm = Common::g_renderModes; for (; rm->code; ++rm) { - _renderModePopUp->appendEntry(_(rm->description), rm->id); + _renderModePopUp->appendEntry(_c(rm->description, context), rm->id); } // Fullscreen checkbox @@ -672,15 +675,16 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const Common::String &pref for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) { const uint32 deviceGuiOption = MidiDriver::musicType2GUIO(d->getMusicType()); - if ((_domain == Common::ConfigManager::kApplicationDomain && d->getMusicType() != MT_TOWNS) // global dialog - skip useless FM-Towns option there - || (_domain != Common::ConfigManager::kApplicationDomain && !(_guioptions & allFlags)) // No flags are specified - || (_guioptions & deviceGuiOption) // flag is present - // HACK/FIXME: For now we have to show GM devices, even when the game only has GUIO_MIDIMT32 set, - // else we would not show for example external devices connected via ALSA, since they are always - // marked as General MIDI device. - || (deviceGuiOption == Common::GUIO_MIDIGM && (_guioptions & Common::GUIO_MIDIMT32)) - || d->getMusicDriverId() == "auto" || d->getMusicDriverId() == "null") // always add default and null device - _midiPopUp->appendEntry(d->getCompleteName(), d->getHandle()); + if ((_domain == Common::ConfigManager::kApplicationDomain && d->getMusicType() != MT_TOWNS // global dialog - skip useless FM-Towns, C64, Amiga, AppleIIGS options there + && d->getMusicType() != MT_C64 && d->getMusicType() != MT_AMIGA && d->getMusicType() != MT_APPLEIIGS) + || (_domain != Common::ConfigManager::kApplicationDomain && !(_guioptions & allFlags)) // No flags are specified + || (_guioptions & deviceGuiOption) // flag is present + // HACK/FIXME: For now we have to show GM devices, even when the game only has GUIO_MIDIMT32 set, + // else we would not show for example external devices connected via ALSA, since they are always + // marked as General MIDI device. + || (deviceGuiOption == Common::GUIO_MIDIGM && (_guioptions & Common::GUIO_MIDIMT32)) + || d->getMusicDriverId() == "auto" || d->getMusicDriverId() == "null") // always add default and null device + _midiPopUp->appendEntry(d->getCompleteName(), d->getHandle()); } } @@ -728,8 +732,11 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi } // SoundFont - _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _("SoundFont:"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"), kChooseSoundFontCmd); - _soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _("None"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity")); + if (g_system->getOverlayWidth() > 320) + _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _("SoundFont:"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"), kChooseSoundFontCmd); + else + _soundFontButton = new ButtonWidget(boss, prefix + "mcFontButton", _c("SoundFont:", "lowres"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity"), kChooseSoundFontCmd); + _soundFont = new StaticTextWidget(boss, prefix + "mcFontPath", _c("None", "soundfont"), _("SoundFont is supported by some audio cards, Fluidsynth and Timidity")); _soundFontClearButton = new ButtonWidget(boss, prefix + "mcFontClearButton", "C", _("Clear value"), kClearSoundFontCmd); // Multi midi setting @@ -750,7 +757,10 @@ void OptionsDialog::addMT32Controls(GuiObject *boss, const Common::String &prefi _mt32DevicePopUp = new PopUpWidget(boss, prefix + "auPrefMt32Popup"); // Native mt32 setting - _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), _("Check if you want to use your real hardware Roland-compatible sound device connected to your computer")); + if (g_system->getOverlayWidth() > 320) + _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _("True Roland MT-32 (disable GM emulation)"), _("Check if you want to use your real hardware Roland-compatible sound device connected to your computer")); + else + _mt32Checkbox = new CheckboxWidget(boss, prefix + "mcMt32Checkbox", _c("True Roland MT-32 (disable GM emulation)", "lowres"), _("Check if you want to use your real hardware Roland-compatible sound device connected to your computer")); // GS Extensions setting _enableGSCheckbox = new CheckboxWidget(boss, prefix + "mcGSCheckbox", _("Enable Roland GS Mode"), _("Turns off General MIDI mapping for games with Roland MT-32 soundtrack")); @@ -777,24 +787,29 @@ void OptionsDialog::addMT32Controls(GuiObject *boss, const Common::String &prefi // make use of the widgets. The launcher range is 0-255. SCUMM's 0-9 void OptionsDialog::addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal) { - _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", _("Text and Speech:")); - if (g_system->getOverlayWidth() > 320) { + _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", _("Text and Speech:")); + _subToggleGroup = new RadiobuttonGroup(boss, kSubtitleToggle); _subToggleSpeechOnly = new RadiobuttonWidget(boss, prefix + "subToggleSpeechOnly", _subToggleGroup, kSubtitlesSpeech, _("Speech")); _subToggleSubOnly = new RadiobuttonWidget(boss, prefix + "subToggleSubOnly", _subToggleGroup, kSubtitlesSubs, _("Subtitles")); _subToggleSubBoth = new RadiobuttonWidget(boss, prefix + "subToggleSubBoth", _subToggleGroup, kSubtitlesBoth, _("Both")); + + _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", _("Subtitle speed:")); } else { + _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", _c("Text and Speech:", "lowres")); + _subToggleGroup = new RadiobuttonGroup(boss, kSubtitleToggle); _subToggleSpeechOnly = new RadiobuttonWidget(boss, prefix + "subToggleSpeechOnly", _subToggleGroup, kSubtitlesSpeech, _("Spch"), _("Speech")); _subToggleSubOnly = new RadiobuttonWidget(boss, prefix + "subToggleSubOnly", _subToggleGroup, kSubtitlesSubs, _("Subs"), _("Subtitles")); - _subToggleSubBoth = new RadiobuttonWidget(boss, prefix + "subToggleSubBoth", _subToggleGroup, kSubtitlesBoth, _("Both"), _("Show subtitles and play speech")); + _subToggleSubBoth = new RadiobuttonWidget(boss, prefix + "subToggleSubBoth", _subToggleGroup, kSubtitlesBoth, _c("Both", "lowres"), _("Show subtitles and play speech")); + + _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", _c("Subtitle speed:", "lowres")); } // Subtitle speed - _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", _("Subtitle speed:")); _subSpeedSlider = new SliderWidget(boss, prefix + "subSubtitleSpeedSlider", 0, kSubtitleSpeedChanged); _subSpeedLabel = new StaticTextWidget(boss, prefix + "subSubtitleSpeedLabel", "100%"); _subSpeedSlider->setMinValue(0); _subSpeedSlider->setMaxValue(maxSliderVal); @@ -806,7 +821,10 @@ void OptionsDialog::addSubtitleControls(GuiObject *boss, const Common::String &p void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &prefix) { // Volume controllers - _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _("Music volume:")); + if (g_system->getOverlayWidth() > 320) + _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _("Music volume:")); + else + _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _c("Music volume:", "lowres")); _musicVolumeSlider = new SliderWidget(boss, prefix + "vcMusicSlider", 0, kMusicVolumeChanged); _musicVolumeLabel = new StaticTextWidget(boss, prefix + "vcMusicLabel", "100%"); _musicVolumeSlider->setMinValue(0); @@ -815,15 +833,20 @@ void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &pre _muteCheckbox = new CheckboxWidget(boss, prefix + "vcMuteCheckbox", _("Mute All"), 0, kMuteAllChanged); - - _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _("SFX volume:"), _("Special sound effects volume")); + if (g_system->getOverlayWidth() > 320) + _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _("SFX volume:"), _("Special sound effects volume")); + else + _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _c("SFX volume:", "lowres"), _("Special sound effects volume")); _sfxVolumeSlider = new SliderWidget(boss, prefix + "vcSfxSlider", _("Special sound effects volume"), kSfxVolumeChanged); _sfxVolumeLabel = new StaticTextWidget(boss, prefix + "vcSfxLabel", "100%"); _sfxVolumeSlider->setMinValue(0); _sfxVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume); _sfxVolumeLabel->setFlags(WIDGET_CLEARBG); - _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _("Speech volume:")); + if (g_system->getOverlayWidth() > 320) + _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _("Speech volume:")); + else + _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _c("Speech volume:", "lowres")); _speechVolumeSlider = new SliderWidget(boss, prefix + "vcSpeechSlider", 0, kSpeechVolumeChanged); _speechVolumeLabel = new StaticTextWidget(boss, prefix + "vcSpeechLabel", "100%"); _speechVolumeSlider->setMinValue(0); @@ -922,7 +945,10 @@ GlobalOptionsDialog::GlobalOptionsDialog() addAudioControls(tab, "GlobalOptions_Audio."); addSubtitleControls(tab, "GlobalOptions_Audio."); - tab->addTab(_("Volume")); + if (g_system->getOverlayWidth() > 320) + tab->addTab(_("Volume")); + else + tab->addTab(_c("Volume", "lowres")); addVolumeControls(tab, "GlobalOptions_Volume."); // TODO: cd drive setting @@ -953,21 +979,24 @@ GlobalOptionsDialog::GlobalOptionsDialog() _savePath = new StaticTextWidget(tab, "GlobalOptions_Paths.SavePath", "/foo/bar", _("Specifies where your savegames are put")); new ButtonWidget(tab, "GlobalOptions_Paths.ThemeButton", _("Theme Path:"), 0, kChooseThemeDirCmd); - _themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _("None")); + _themePath = new StaticTextWidget(tab, "GlobalOptions_Paths.ThemePath", _c("None", "path")); new ButtonWidget(tab, "GlobalOptions_Paths.ExtraButton", _("Extra Path:"), _("Specifies path to additional data used by all games or ScummVM"), kChooseExtraDirCmd); - _extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", _("None"), _("Specifies path to additional data used by all games or ScummVM")); + _extraPath = new StaticTextWidget(tab, "GlobalOptions_Paths.ExtraPath", _c("None", "path"), _("Specifies path to additional data used by all games or ScummVM")); #ifdef DYNAMIC_MODULES new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _("Plugins Path:"), 0, kChoosePluginsDirCmd); - _pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _("None")); + _pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _c("None", "path")); #endif #endif // // 6) The miscellaneous tab // - tab->addTab(_("Misc")); + if (g_system->getOverlayWidth() > 320) + tab->addTab(_("Misc")); + else + tab->addTab(_c("Misc", "lowres")); new ButtonWidget(tab, "GlobalOptions_Misc.ThemeButton", _("Theme:"), 0, kChooseThemeCmd); _curTheme = new StaticTextWidget(tab, "GlobalOptions_Misc.CurTheme", g_gui.theme()->getThemeName()); @@ -976,10 +1005,18 @@ GlobalOptionsDialog::GlobalOptionsDialog() _rendererPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.RendererPopupDesc", _("GUI Renderer:")); _rendererPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.RendererPopup"); - for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i) - _rendererPopUp->appendEntry(_(GUI::ThemeEngine::_rendererModes[i].name), GUI::ThemeEngine::_rendererModes[i].mode); + if (g_system->getOverlayWidth() > 320) { + for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i) + _rendererPopUp->appendEntry(_(GUI::ThemeEngine::_rendererModes[i].name), GUI::ThemeEngine::_rendererModes[i].mode); + } else { + for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i) + _rendererPopUp->appendEntry(_c(GUI::ThemeEngine::_rendererModes[i].name, "lowres"), GUI::ThemeEngine::_rendererModes[i].mode); + } - _autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", _("Autosave:")); + if (g_system->getOverlayWidth() > 320) + _autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", _("Autosave:")); + else + _autosavePeriodPopUpDesc = new StaticTextWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopupDesc", _c("Autosave:", "lowres")); _autosavePeriodPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.AutosavePeriodPopup"); for (int i = 0; savePeriodLabels[i]; i++) { @@ -999,7 +1036,7 @@ GlobalOptionsDialog::GlobalOptionsDialog() #ifdef USE_DETECTLANG _guiLanguagePopUp->appendEntry(_("<default>"), Common::kTranslationAutodetectId); #endif // USE_DETECTLANG - _guiLanguagePopUp->appendEntry(_("English"), Common::kTranslationBuiltinId); + _guiLanguagePopUp->appendEntry("English", Common::kTranslationBuiltinId); _guiLanguagePopUp->appendEntry("", 0); Common::TLangArray languages = TransMan.getSupportedLanguageNames(); Common::TLangArray::iterator lang = languages.begin(); @@ -1050,19 +1087,19 @@ void GlobalOptionsDialog::open() { Common::String extraPath(ConfMan.get("extrapath", _domain)); if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) { - _savePath->setLabel(_("None")); + _savePath->setLabel(_c("None", "path")); } else { _savePath->setLabel(savePath); } if (themePath.empty() || !ConfMan.hasKey("themepath", _domain)) { - _themePath->setLabel(_("None")); + _themePath->setLabel(_c("None", "path")); } else { _themePath->setLabel(themePath); } if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) { - _extraPath->setLabel(_("None")); + _extraPath->setLabel(_c("None", "path")); } else { _extraPath->setLabel(extraPath); } @@ -1070,7 +1107,7 @@ void GlobalOptionsDialog::open() { #ifdef DYNAMIC_MODULES Common::String pluginsPath(ConfMan.get("pluginspath", _domain)); if (pluginsPath.empty() || !ConfMan.hasKey("pluginspath", _domain)) { - _pluginsPath->setLabel(_("None")); + _pluginsPath->setLabel(_c("None", "path")); } else { _pluginsPath->setLabel(pluginsPath); } @@ -1094,24 +1131,24 @@ void GlobalOptionsDialog::open() { void GlobalOptionsDialog::close() { if (getResult()) { Common::String savePath(_savePath->getLabel()); - if (!savePath.empty() && (savePath != _("None"))) + if (!savePath.empty() && (savePath != _c("None", "path"))) ConfMan.set("savepath", savePath, _domain); Common::String themePath(_themePath->getLabel()); - if (!themePath.empty() && (themePath != _("None"))) + if (!themePath.empty() && (themePath != _c("None", "path"))) ConfMan.set("themepath", themePath, _domain); else ConfMan.removeKey("themepath", _domain); Common::String extraPath(_extraPath->getLabel()); - if (!extraPath.empty() && (extraPath != _("None"))) + if (!extraPath.empty() && (extraPath != _c("None", "path"))) ConfMan.set("extrapath", extraPath, _domain); else ConfMan.removeKey("extrapath", _domain); #ifdef DYNAMIC_MODULES Common::String pluginsPath(_pluginsPath->getLabel()); - if (!pluginsPath.empty() && (pluginsPath != _("None"))) + if (!pluginsPath.empty() && (pluginsPath != _c("None", "path"))) ConfMan.set("pluginspath", pluginsPath, _domain); else ConfMan.removeKey("pluginspath", _domain); @@ -1210,7 +1247,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3 Common::FSNode file(browser.getResult()); _soundFont->setLabel(file.getPath()); - if (!file.getPath().empty() && (file.getPath() != _("None"))) + if (!file.getPath().empty() && (file.getPath() != _c("None", "path"))) _soundFontClearButton->setEnabled(true); else _soundFontClearButton->setEnabled(false); |