aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorFilippos Karapetis2008-11-09 21:20:44 +0000
committerFilippos Karapetis2008-11-09 21:20:44 +0000
commita5502b296f2c26498813f6565b77bdc74011024e (patch)
tree2f70573470997631a92c7394f361df79eafa5832 /gui
parent1353a304f3b953b516815478825161413aef2d78 (diff)
downloadscummvm-rg350-a5502b296f2c26498813f6565b77bdc74011024e.tar.gz
scummvm-rg350-a5502b296f2c26498813f6565b77bdc74011024e.tar.bz2
scummvm-rg350-a5502b296f2c26498813f6565b77bdc74011024e.zip
Cleanup and simplification
svn-id: r34979
Diffstat (limited to 'gui')
-rw-r--r--gui/launcher.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 5440decdc8..d1267f8939 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -572,18 +572,6 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
break;
case GUI::kListSelectionChangedCmd:
updateSelection(true);
-
- if (_list->isEditable()) {
- if (!_metaInfoSupport) {
- _list->startEditMode();
- } else {
- SaveStateDescriptor desc = (*_plugin)->querySaveMetaInfos(_target.c_str(), atoi(_saveList[selItem].save_slot().c_str()));
- // Don't allow the user to change the description of write protected games
- if (!desc.getBool("is_write_protected"))
- _list->startEditMode();
- }
- }
-
break;
case kDelCmd:
if (selItem >= 0 && _delSupport) {
@@ -677,6 +665,7 @@ void SaveLoadChooser::updateSelection(bool redraw) {
bool isDeletable = _delSupport;
bool isWriteProtected = false;
+ bool startEditMode = _list->isEditable();
if (selItem >= 0 && !_list->getSelectedString().empty() && _metaInfoSupport) {
SaveStateDescriptor desc = (*_plugin)->querySaveMetaInfos(_target.c_str(), atoi(_saveList[selItem].save_slot().c_str()));
@@ -684,6 +673,10 @@ void SaveLoadChooser::updateSelection(bool redraw) {
isDeletable = desc.getBool("is_deletable") && _delSupport;
isWriteProtected = desc.getBool("is_write_protected");
+ // Don't allow the user to change the description of write protected games
+ if (isWriteProtected)
+ startEditMode = false;
+
if (_thumbnailSupport) {
const Graphics::Surface *thumb = desc.getThumbnail();
if (thumb) {
@@ -727,6 +720,9 @@ void SaveLoadChooser::updateSelection(bool redraw) {
// Disable the save button if nothing is selected, or if the selected
// game is write protected
_chooseButton->setEnabled(selItem >= 0 && !isWriteProtected);
+
+ if (startEditMode)
+ _list->startEditMode();
} else {
// Disable the load button if nothing is selected, or if an empty
// list item is selected.