aboutsummaryrefslogtreecommitdiff
path: root/gui/launcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/launcher.cpp')
-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.