aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJohannes Schickel2012-06-10 04:14:17 +0200
committerJohannes Schickel2012-06-10 04:19:45 +0200
commit15046a7529e3c755de1f00b4a2666786eb2bd4f8 (patch)
tree44ebb357905b837264abc117713d49ff47619239 /gui
parent0e5ae35e345d6e7f38177e158dcc871cf7a034d3 (diff)
downloadscummvm-rg350-15046a7529e3c755de1f00b4a2666786eb2bd4f8.tar.gz
scummvm-rg350-15046a7529e3c755de1f00b4a2666786eb2bd4f8.tar.bz2
scummvm-rg350-15046a7529e3c755de1f00b4a2666786eb2bd4f8.zip
GUI: Get rid of SaveLoadChooser::setSaveMode.
We already pass the title and process button name to the constructor of SaveLoadChooser and then do not offer any way of changing it, thus changing the edit mode of the chooser is kind of pointless and was never actually used. Instead we pass the mode on SaveLoadChooser construction now.
Diffstat (limited to 'gui')
-rw-r--r--gui/launcher.cpp2
-rw-r--r--gui/saveload.cpp8
-rw-r--r--gui/saveload.h3
3 files changed, 4 insertions, 9 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index c8ed3126c4..26fafa5279 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -677,7 +677,7 @@ LauncherDialog::LauncherDialog()
_browser = new BrowserDialog(_("Select directory with game data"), true);
// Create Load dialog
- _loadDialog = new SaveLoadChooser(_("Load game:"), _("Load"));
+ _loadDialog = new SaveLoadChooser(_("Load game:"), _("Load"), false);
}
void LauncherDialog::selectTarget(const String &target) {
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index 3dc9961906..c7da94357f 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -40,7 +40,7 @@ enum {
};
-SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
+SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode)
: Dialog("SaveLoadChooser"), _delSupport(0), _list(0), _chooseButton(0), _deleteButton(0), _gfxWidget(0) {
_delSupport = _metaInfoSupport = _thumbnailSupport = _saveDateSupport = _playTimeSupport = false;
@@ -51,7 +51,7 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
// Add choice list
_list = new GUI::ListWidget(this, "SaveLoadChooser.List");
_list->setNumberingMode(GUI::kListNumberingZero);
- setSaveMode(false);
+ _list->setEditable(saveMode);
_gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10);
@@ -117,10 +117,6 @@ const Common::String &SaveLoadChooser::getResultString() const {
return (selItem >= 0) ? _list->getSelectedString() : _resultString;
}
-void SaveLoadChooser::setSaveMode(bool saveMode) {
- _list->setEditable(saveMode);
-}
-
void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
int selItem = _list->getSelected();
diff --git a/gui/saveload.h b/gui/saveload.h
index adaf311fd2..e6fea0fb52 100644
--- a/gui/saveload.h
+++ b/gui/saveload.h
@@ -62,7 +62,7 @@ protected:
void updateSaveList();
void updateSelection(bool redraw);
public:
- SaveLoadChooser(const String &title, const String &buttonLabel);
+ SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode);
~SaveLoadChooser();
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
@@ -71,7 +71,6 @@ public:
void open();
const Common::String &getResultString() const;
- void setSaveMode(bool saveMode);
virtual void reflowLayout();