aboutsummaryrefslogtreecommitdiff
path: root/scumm/dialogs.cpp
diff options
context:
space:
mode:
authorMax Horn2004-03-15 02:28:47 +0000
committerMax Horn2004-03-15 02:28:47 +0000
commitdeb96003a2e02efc1f394ebf8ddc772f5e37ddd3 (patch)
treee2564f6c89d0ffb923d84d621ada5f4d26f26db0 /scumm/dialogs.cpp
parent782dabbcd399b0582df73ff82107ffca70abb0f7 (diff)
downloadscummvm-rg350-deb96003a2e02efc1f394ebf8ddc772f5e37ddd3.tar.gz
scummvm-rg350-deb96003a2e02efc1f394ebf8ddc772f5e37ddd3.tar.bz2
scummvm-rg350-deb96003a2e02efc1f394ebf8ddc772f5e37ddd3.zip
Aaargh, didn't mean to commit this...
svn-id: r13296
Diffstat (limited to 'scumm/dialogs.cpp')
-rw-r--r--scumm/dialogs.cpp53
1 files changed, 27 insertions, 26 deletions
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp
index a0992ee8c0..ce7884eb48 100644
--- a/scumm/dialogs.cpp
+++ b/scumm/dialogs.cpp
@@ -395,6 +395,10 @@ void MainMenuDialog::load() {
#pragma mark -
enum {
+ kOKCmd = 'ok '
+};
+
+enum {
kKeysCmd = 'KEYS'
};
@@ -409,14 +413,12 @@ ConfigDialog::ConfigDialog(ScummEngine *scumm)
// Add the buttons
//
#ifdef _WIN32_WCE
- 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');
+ 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');
#else
- 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');
+ addButton(_w - kButtonWidth-8, _h - 24, "OK", GUI::OptionsDialog::kOKCmd, 'O');
+ addButton(_w - 2 * kButtonWidth-12, _h - 24, "Cancel", kCloseCmd, 'C');
#endif
//
@@ -444,8 +446,24 @@ ConfigDialog::~ConfigDialog() {
#endif
}
-void ConfigDialog::applySettings() {
- ConfigDialog::applySettings();
+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();
// Sync the engine with the config manager
int soundVolumeMaster = ConfMan.getInt("master_volume");
@@ -461,25 +479,8 @@ void ConfigDialog::applySettings() {
_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) {