aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2008-11-09 20:18:51 +0000
committerJohannes Schickel2008-11-09 20:18:51 +0000
commitd7c5e9ce873e03e0664c4ceb6b32e8385a22c51c (patch)
tree39deb9cdd02a34a478aea1169b753cb21a17cbac
parentfac44f1e57b3a63df1d0215b30a59763a1e7e7be (diff)
downloadscummvm-rg350-d7c5e9ce873e03e0664c4ceb6b32e8385a22c51c.tar.gz
scummvm-rg350-d7c5e9ce873e03e0664c4ceb6b32e8385a22c51c.tar.bz2
scummvm-rg350-d7c5e9ce873e03e0664c4ceb6b32e8385a22c51c.zip
Fixed 'Save'/'Load' button enable/disable triggering.
svn-id: r34972
-rw-r--r--gui/launcher.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 3f569c22bb..2ed028f26a 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -570,18 +570,12 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
}
close();
break;
- case GUI::kListSelectionChangedCmd: {
+ case GUI::kListSelectionChangedCmd:
updateSelection(true);
- if (_list->isEditable()) {
+ if (_list->isEditable())
_list->startEditMode();
- }
- // Disable button if nothing is selected, or (in load mode) if an empty
- // list item is selected. We allow choosing an empty item in save mode
- // because we then just assign a default name.
- _chooseButton->setEnabled(selItem >= 0 && (_list->isEditable() || !getResultString().empty()));
- _chooseButton->draw();
- } break;
+ break;
case kDelCmd:
if (selItem >= 0 && _delSupport) {
MessageDialog alert("Do you really want to delete this savegame?",
@@ -722,7 +716,7 @@ void SaveLoadChooser::updateSelection(bool redraw) {
// Disable these buttons if nothing is selected, or if an empty
// list item is selected.
- _chooseButton->setEnabled(selItem >= 0 && (!_list->getSelectedString().empty()) && !isWriteProtected);
+ _chooseButton->setEnabled((selItem >= 0 && (!_list->getSelectedString().empty())) || (_list->isEditable() && !isWriteProtected));
// Delete will always be disabled if the engine doesn't support it.
_deleteButton->setEnabled(isDeletable && (selItem >= 0) && (!_list->getSelectedString().empty()));