diff options
author | Bastien Bouclet | 2018-08-27 06:39:40 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-08-27 06:39:40 +0200 |
commit | ac4b2efd3fb7fd7a02fc2bc74de249045d353b2b (patch) | |
tree | 739b866bd386c64eae8f507f7903a75bd571198e | |
parent | 94a520d299e0001f40d1ccd0eed00d304a56b583 (diff) | |
download | scummvm-rg350-ac4b2efd3fb7fd7a02fc2bc74de249045d353b2b.tar.gz scummvm-rg350-ac4b2efd3fb7fd7a02fc2bc74de249045d353b2b.tar.bz2 scummvm-rg350-ac4b2efd3fb7fd7a02fc2bc74de249045d353b2b.zip |
GUI: Clean up file browser path entry
-rw-r--r-- | gui/browser.cpp | 7 | ||||
-rw-r--r-- | gui/widgets/edittext.cpp | 5 | ||||
-rw-r--r-- | gui/widgets/edittext.h | 5 |
3 files changed, 4 insertions, 13 deletions
diff --git a/gui/browser.cpp b/gui/browser.cpp index 0e2d6b87bc..264f3a64f9 100644 --- a/gui/browser.cpp +++ b/gui/browser.cpp @@ -36,7 +36,8 @@ namespace GUI { enum { kChooseCmd = 'Chos', kGoUpCmd = 'GoUp', - kHiddenCmd = 'Hidd' + kHiddenCmd = 'Hidd', + kPathEditedCmd = 'Path' }; /* We want to use this as a general directory selector at some point... possible uses @@ -57,7 +58,7 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser) new StaticTextWidget(this, "Browser.Headline", title); // Current path - TODO: handle long paths ? - _currentPath = new EditTextWidget(this, "Browser.Path", "DUMMY"); + _currentPath = new EditTextWidget(this, "Browser.Path", "", nullptr, 0, kPathEditedCmd); // Add file list _fileList = new ListWidget(this, "Browser.List"); @@ -96,7 +97,7 @@ void BrowserDialog::open() { void BrowserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { switch (cmd) { //Search for typed-in directory - case kExitTxtCmd: + case kPathEditedCmd: _node = Common::FSNode(_currentPath->getEditString()); updateListing(); break; diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp index 540dc27932..8dabb0df61 100644 --- a/gui/widgets/edittext.cpp +++ b/gui/widgets/edittext.cpp @@ -132,7 +132,6 @@ void EditTextWidget::startEditMode() { void EditTextWidget::endEditMode() { releaseFocus(); - sendCommand(kExitTxtCmd, 0); sendCommand(_finishCmd, 0); } @@ -143,8 +142,4 @@ void EditTextWidget::abortEditMode() { releaseFocus(); } -Common::String EditTextWidget::getEditString() { - return _backupString; -} - } // End of namespace GUI diff --git a/gui/widgets/edittext.h b/gui/widgets/edittext.h index d382c8f067..9a1b698606 100644 --- a/gui/widgets/edittext.h +++ b/gui/widgets/edittext.h @@ -29,10 +29,6 @@ namespace GUI { -enum { - kExitTxtCmd = 'TXTE' -}; - /* EditTextWidget */ class EditTextWidget : public EditableWidget { protected: @@ -48,7 +44,6 @@ public: EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0, uint32 finishCmd = 0); void setEditString(const String &str); - String getEditString(); virtual void handleMouseDown(int x, int y, int button, int clickCount); |