diff options
| author | Max Horn | 2004-03-15 02:21:04 +0000 | 
|---|---|---|
| committer | Max Horn | 2004-03-15 02:21:04 +0000 | 
| commit | 782dabbcd399b0582df73ff82107ffca70abb0f7 (patch) | |
| tree | c4752b3709de6bc55349f4d1584be794ad421747 /gui/launcher.cpp | |
| parent | b389dfa2a328f28f5e90982a7146f7e221b1dba1 (diff) | |
| download | scummvm-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 'gui/launcher.cpp')
| -rw-r--r-- | gui/launcher.cpp | 48 | 
1 files changed, 27 insertions, 21 deletions
| diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 0ab29f97c9..53772c67d4 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -86,8 +86,6 @@ class EditGameDialog : public OptionsDialog {  public:  	EditGameDialog(const String &domain, GameSettings target); -	void open(); -	void close();  	virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);  protected: @@ -100,6 +98,10 @@ protected:  	CheckboxWidget *_globalGraphicsOverride;  	CheckboxWidget *_globalAudioOverride;  	CheckboxWidget *_globalVolumeOverride; + +	virtual void applySettings(); +	virtual void loadSettings(); +	virtual void saveSettings();  };  EditGameDialog::EditGameDialog(const String &domain, GameSettings target) @@ -203,11 +205,17 @@ EditGameDialog::EditGameDialog(const String &domain, GameSettings target)  	// Add OK & Cancel buttons  	addButton(_w - 2 * (kButtonWidth + 10), _h - 24, "Cancel", kCloseCmd, 0); -	addButton(_w - (kButtonWidth + 10), _h - 24, "OK", kOKCmd, 0); +	addButton(_w - (kButtonWidth + 10), _h - 24, "OK", kSaveCmd, 0); +} + +void EditGameDialog::applySettings() { +	// Do *never* apply settings from the EditGameDialog! +	// After all, we are editing a game target in the launcher; that target +	// can definitely not be the active target, since we are in the launcher.  } -void EditGameDialog::open() { -	OptionsDialog::open(); +void EditGameDialog::loadSettings() { +	OptionsDialog::loadSettings();  	int sel, i;  	bool e; @@ -251,24 +259,22 @@ void EditGameDialog::open() {  	_platformPopUp->setSelected(sel);  } +void EditGameDialog::saveSettings() { +	ConfMan.set("description", _descriptionWidget->getLabel(), _domain); -void EditGameDialog::close() { -	if (getResult()) { -		ConfMan.set("description", _descriptionWidget->getLabel(), _domain); +	Common::Language lang = (Common::Language)_langPopUp->getSelectedTag(); +	if (lang < 0) +		ConfMan.removeKey("language", _domain); +	else +		ConfMan.set("language", Common::getLanguageCode(lang), _domain); -		Common::Language lang = (Common::Language)_langPopUp->getSelectedTag(); -		if (lang < 0) -			ConfMan.removeKey("language", _domain); -		else -			ConfMan.set("language", Common::getLanguageCode(lang), _domain); +	Common::Platform platform = (Common::Platform)_platformPopUp->getSelectedTag(); +	if (platform < 0) +		ConfMan.removeKey("platform", _domain); +	else +		ConfMan.set("platform", Common::getPlatformCode(platform), _domain); -		Common::Platform platform = (Common::Platform)_platformPopUp->getSelectedTag(); -		if (platform < 0) -			ConfMan.removeKey("platform", _domain); -		else -			ConfMan.set("platform", Common::getPlatformCode(platform), _domain); -	} -	OptionsDialog::close(); +	OptionsDialog::saveSettings();  }  void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { @@ -285,7 +291,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat  		setVolumeSettingsState(data != 0);  		draw();  		break; -	case kOKCmd: { +	case kSaveCmd: {  		// Write back changes made to config object  		String newDomain(_domainWidget->getLabel());  		if (newDomain != _domain) { | 
