diff options
author | Filippos Karapetis | 2008-11-06 20:26:19 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-11-06 20:26:19 +0000 |
commit | 27d195968380963220f55caf62b767cd19626ed3 (patch) | |
tree | 89ffdb401b76babfda61c9f0444d0e348c6c18f6 /gui | |
parent | 54b94fdf037bcaf1f9df678f26a23e241a1d8e21 (diff) | |
download | scummvm-rg350-27d195968380963220f55caf62b767cd19626ed3.tar.gz scummvm-rg350-27d195968380963220f55caf62b767cd19626ed3.tar.bz2 scummvm-rg350-27d195968380963220f55caf62b767cd19626ed3.zip |
Added some WIP code for the GMM save dialog (still not working correctly)
svn-id: r34918
Diffstat (limited to 'gui')
-rw-r--r-- | gui/launcher.cpp | 22 | ||||
-rw-r--r-- | gui/launcher.h | 3 |
2 files changed, 24 insertions, 1 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 9a201fd936..090e3e2406 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -536,6 +536,15 @@ int SaveLoadChooser::runModal(const EnginePlugin *plugin, const String &target) return ret; } +const Common::String &SaveLoadChooser::getResultString() const { + return _list->getSelectedString(); +} + +void SaveLoadChooser::setSaveMode(bool saveMode) { + _list->setEditable(saveMode); + _list->setNumberingMode(saveMode ? GUI::kListNumberingOne : GUI::kListNumberingZero); +} + void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { int selItem = _list->getSelected(); @@ -543,7 +552,7 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da case GUI::kListItemActivatedCmd: case GUI::kListItemDoubleClickedCmd: if (selItem >= 0) { - if (!_list->getSelectedString().empty()) { + if (_list->isEditable() || !_list->getSelectedString().empty()) { _list->endEditMode(); setResult(atoi(_saveList[selItem].save_slot().c_str())); close(); @@ -556,6 +565,17 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da break; case GUI::kListSelectionChangedCmd: { updateSelection(true); + + /* + 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; case kDelCmd: if (selItem >= 0 && _delSupport) { diff --git a/gui/launcher.h b/gui/launcher.h index 7e04e865f9..4b873d6186 100644 --- a/gui/launcher.h +++ b/gui/launcher.h @@ -114,6 +114,9 @@ public: void setList(const StringList& list); int runModal(const EnginePlugin *plugin, const String &target); + const Common::String &SaveLoadChooser::getResultString() const; + void setSaveMode(bool saveMode); + virtual void reflowLayout(); virtual void close(); |