[Scummvm-cvs-logs] CVS: scummvm/scumm dialogs.cpp,1.106,1.107 dialogs.h,1.39,1.40

Max Horn fingolfin at users.sourceforge.net
Sun Mar 14 18:39:40 CET 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20451/scumm

Modified Files:
	dialogs.cpp dialogs.h 
Log Message:
Aaargh, didn't mean to commit this...

Index: dialogs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- dialogs.cpp	15 Mar 2004 02:21:04 -0000	1.106
+++ dialogs.cpp	15 Mar 2004 02:28:47 -0000	1.107
@@ -395,6 +395,10 @@
 #pragma mark -
 
 enum {
+	kOKCmd					= 'ok  '
+};
+
+enum {
 	kKeysCmd = 'KEYS'
 };
 
@@ -409,14 +413,12 @@
 	// 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 @@
 #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 @@
 
 	_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) {

Index: dialogs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- dialogs.h	15 Mar 2004 02:21:04 -0000	1.39
+++ dialogs.h	15 Mar 2004 02:28:47 -0000	1.40
@@ -112,15 +112,12 @@
 	ConfigDialog(ScummEngine *scumm);
 	~ConfigDialog();
 
+	virtual void open();
+	virtual void close();
 	virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
 
 protected:
 	GUI::CheckboxWidget *subtitlesCheckbox;
-
-
-	virtual void applySettings();
-	virtual void loadSettings();
-	virtual void saveSettings();
 };
 
 class InfoDialog : public ScummDialog {





More information about the Scummvm-git-logs mailing list