Skip to content

Commit

Permalink
GUI: Remember last save/load chooser selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Jun 29, 2012
1 parent 37fd9b7 commit e2056bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions base/commandLine.cpp
Expand Up @@ -237,6 +237,8 @@ void registerDefaults() {
ConfMan.registerDefault("record_temp_file_name", "record.tmp");
ConfMan.registerDefault("record_time_file_name", "record.time");

ConfMan.registerDefault("gui_saveload_chooser", "grid");

}

//
Expand Down
7 changes: 6 additions & 1 deletion gui/saveload.cpp
Expand Up @@ -43,9 +43,12 @@ void SaveLoadChooser::selectChooser(const MetaEngine &engine) {
delete _impl;
_impl = 0;

Common::String userConfig = ConfMan.get("gui_saveload_chooser", Common::ConfigManager::kApplicationDomain);

if (!_saveMode && g_gui.getWidth() > 320 && g_gui.getHeight() > 200
&& engine.hasFeature(MetaEngine::kSavesSupportMetaInfo)
&& engine.hasFeature(MetaEngine::kSavesSupportThumbnail)) {
&& engine.hasFeature(MetaEngine::kSavesSupportThumbnail)
&& userConfig.equalsIgnoreCase("grid")) {
_impl = new LoadChooserThumbnailed(_title);
} else {
_impl = new SaveLoadChooserSimple(_title, _buttonLabel, _saveMode);
Expand Down Expand Up @@ -90,9 +93,11 @@ int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, con
if (ret == kSwitchToList) {
delete _impl;
_impl = new SaveLoadChooserSimple(_title, _buttonLabel, _saveMode);
ConfMan.set("gui_saveload_chooser", "list", Common::ConfigManager::kApplicationDomain);
} else if (ret == kSwitchToGrid) {
delete _impl;
_impl = new LoadChooserThumbnailed(_title);
ConfMan.set("gui_saveload_chooser", "grid", Common::ConfigManager::kApplicationDomain);
}
} while (ret < -1);

Expand Down

0 comments on commit e2056bd

Please sign in to comment.