diff options
| author | Jordi Vilalta Prat | 2008-05-09 01:58:12 +0000 | 
|---|---|---|
| committer | Jordi Vilalta Prat | 2008-05-09 01:58:12 +0000 | 
| commit | 420d376a9004a60c0443c74c07554506ad2344c6 (patch) | |
| tree | 263339eb7de28f2bd9c245c34e0a40fab61648c7 /gui/options.cpp | |
| parent | c7c8bb99eefa3b19bc25fa921cd93255489656c5 (diff) | |
| download | scummvm-rg350-420d376a9004a60c0443c74c07554506ad2344c6.tar.gz scummvm-rg350-420d376a9004a60c0443c74c07554506ad2344c6.tar.bz2 scummvm-rg350-420d376a9004a60c0443c74c07554506ad2344c6.zip | |
Added the option to specify the custom path for loading plugins
svn-id: r31960
Diffstat (limited to 'gui/options.cpp')
| -rw-r--r-- | gui/options.cpp | 35 | 
1 files changed, 35 insertions, 0 deletions
| diff --git a/gui/options.cpp b/gui/options.cpp index 7972ceebb2..d6f5306ce2 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -55,6 +55,7 @@ enum {  	kChooseSaveDirCmd		= 'chos',  	kChooseThemeDirCmd		= 'chth',  	kChooseExtraDirCmd		= 'chex', +	kChoosePluginsDirCmd	= 'chpl',  	kChooseThemeCmd			= 'chtf'  }; @@ -706,6 +707,11 @@ GlobalOptionsDialog::GlobalOptionsDialog()  	new ButtonWidget(tab, "globaloptions_extrabutton", "Extra Path:", kChooseExtraDirCmd, 0);  	_extraPath = new StaticTextWidget(tab, "globaloptions_extrapath", "None"); + +#ifdef DYNAMIC_MODULES +	new ButtonWidget(tab, "globaloptions_pluginsbutton", "Plugins Path:", kChoosePluginsDirCmd, 0); +	_pluginsPath = new StaticTextWidget(tab, "globaloptions_pluginspath", "None"); +#endif  #endif  #ifdef SMALL_SCREEN_DEVICE @@ -772,6 +778,15 @@ void GlobalOptionsDialog::open() {  	} else {  		_extraPath->setLabel(extraPath);  	} + +#ifdef DYNAMIC_MODULES +	Common::String pluginsPath(ConfMan.get("pluginspath", _domain)); +	if (pluginsPath.empty() || !ConfMan.hasKey("pluginspath", _domain)) { +		_pluginsPath->setLabel("None"); +	} else { +		_pluginsPath->setLabel(pluginsPath); +	} +#endif  #endif  	// Misc Tab @@ -801,6 +816,14 @@ void GlobalOptionsDialog::close() {  		else  			ConfMan.removeKey("extrapath", _domain); +#ifdef DYNAMIC_MODULES +		String pluginsPath(_pluginsPath->getLabel()); +		if (!pluginsPath.empty() && (pluginsPath != "None")) +			ConfMan.set("pluginspath", pluginsPath, _domain); +		else +			ConfMan.removeKey("pluginspath", _domain); +#endif +  		ConfMan.setInt("autosave_period", _autosavePeriodPopUp->getSelectedTag(), _domain);  	}  	OptionsDialog::close(); @@ -844,6 +867,18 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3  		}  		break;  	} +#ifdef DYNAMIC_MODULES +	case kChoosePluginsDirCmd: { +		BrowserDialog browser("Select directory for plugins", true); +		if (browser.runModal() > 0) { +			// User made his choice... +			FilesystemNode dir(browser.getResult()); +			_pluginsPath->setLabel(dir.getPath()); +			draw(); +		} +		break; +	} +#endif  	case kChooseSoundFontCmd: {  		BrowserDialog browser("Select SoundFont", false);  		if (browser.runModal() > 0) { | 
