aboutsummaryrefslogtreecommitdiff
path: root/scumm/dialogs.cpp
diff options
context:
space:
mode:
authorMax Horn2004-03-15 02:21:04 +0000
committerMax Horn2004-03-15 02:21:04 +0000
commit782dabbcd399b0582df73ff82107ffca70abb0f7 (patch)
treec4752b3709de6bc55349f4d1584be794ad421747 /scumm/dialogs.cpp
parentb389dfa2a328f28f5e90982a7146f7e221b1dba1 (diff)
downloadscummvm-rg350-782dabbcd399b0582df73ff82107ffca70abb0f7.tar.gz
scummvm-rg350-782dabbcd399b0582df73ff82107ffca70abb0f7.tar.bz2
scummvm-rg350-782dabbcd399b0582df73ff82107ffca70abb0f7.zip
...and mor. Next big thing should be to document the overlay stuff, but that'll have to wait till after I slept :-)
svn-id: r13295
Diffstat (limited to 'scumm/dialogs.cpp')
-rw-r--r--scumm/dialogs.cpp53
1 files changed, 26 insertions, 27 deletions
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp
index ce7884eb48..a0992ee8c0 100644
--- a/scumm/dialogs.cpp
+++ b/scumm/dialogs.cpp
@@ -395,10 +395,6 @@ void MainMenuDialog::load() {
#pragma mark -
enum {
- kOKCmd = 'ok '
-};
-
-enum {
kKeysCmd = 'KEYS'
};
@@ -413,12 +409,14 @@ ConfigDialog::ConfigDialog(ScummEngine *scumm)
// Add the buttons
//
#ifdef _WIN32_WCE
- addButton(_w - kButtonWidth - 8, _h - 24 - 4, "OK", GUI::OptionsDialog::kOKCmd, 'O');
- addButton(_w - 2 * kButtonWidth - 12, _h - 24 - 4, "Cancel", kCloseCmd, 'C');
- addButton(_w - 3 * kButtonWidth - 16, _h - 24 - 4, "Keys", kKeysCmd, 'K');
+ addButton(_w - kButtonWidth - 8, _h - 24 - 4, "Save", GUI::OptionsDialog::kSaveCmd, 'S');
+ addButton(_w - 2 * kButtonWidth - 12, _h - 24 - 4, "Apply", GUI::OptionsDialog::kApplyCmd, 'A');
+ addButton(_w - 3 * kButtonWidth - 16, _h - 24 - 4, "Revert", GUI::OptionsDialog::kRevertCmd, 'R');
+ addButton(_w - 4 * kButtonWidth - 16, _h - 24 - 4, "Keys", kKeysCmd, 'K');
#else
- addButton(_w - kButtonWidth-8, _h - 24, "OK", GUI::OptionsDialog::kOKCmd, 'O');
- addButton(_w - 2 * kButtonWidth-12, _h - 24, "Cancel", kCloseCmd, 'C');
+ addButton(_w - kButtonWidth - 8, _h - 24, "Save", GUI::OptionsDialog::kSaveCmd, 'S');
+ addButton(_w - 2 * kButtonWidth - 12, _h - 24, "Apply", GUI::OptionsDialog::kApplyCmd, 'A');
+ addButton(_w - 3 * kButtonWidth - 16, _h - 24, "Revert", GUI::OptionsDialog::kRevertCmd, 'R');
#endif
//
@@ -446,24 +444,8 @@ ConfigDialog::~ConfigDialog() {
#endif
}
-void ConfigDialog::open() {
- GUI_OptionsDialog::open();
-
- // update checkboxes, too
- subtitlesCheckbox->setState(ConfMan.getBool("subtitles"));
-}
-
-void ConfigDialog::close() {
-
- if (getResult()) {
- // Subtitles
- ConfMan.set("subtitles", subtitlesCheckbox->getState(), _domain);
- // Sync with current setting
- if (_vm->_version >= 7)
- _vm->VAR(_vm->VAR_VOICE_MODE) = subtitlesCheckbox->getState();
- }
-
- GUI_OptionsDialog::close();
+void ConfigDialog::applySettings() {
+ ConfigDialog::applySettings();
// Sync the engine with the config manager
int soundVolumeMaster = ConfMan.getInt("master_volume");
@@ -479,8 +461,25 @@ void ConfigDialog::close() {
_vm->_mixer->setVolume(soundVolumeSfx * soundVolumeMaster / 255);
_vm->_mixer->setMusicVolume(soundVolumeMusic);
+
+ // Sync with current setting
+ if (_vm->_version >= 7)
+ _vm->VAR(_vm->VAR_VOICE_MODE) = ConfMan.getBool("subtitles");
}
+void ConfigDialog::loadSettings() {
+ GUI_OptionsDialog::loadSettings();
+
+ // Update subtitles checkbox
+ subtitlesCheckbox->setState(ConfMan.getBool("subtitles"));
+}
+
+void ConfigDialog::saveSettings() {
+ // Subtitles
+ ConfMan.set("subtitles", subtitlesCheckbox->getState(), _domain);
+
+ GUI_OptionsDialog::saveSettings();
+}
void ConfigDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
switch (cmd) {