Skip to content

Commit

Permalink
Update browser.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Sedictious committed Aug 10, 2018
1 parent 3fc6680 commit a0c1cdd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions gui/browser.cpp
Expand Up @@ -23,6 +23,7 @@
#include "gui/browser.h"
#include "gui/gui-manager.h"
#include "gui/widgets/list.h"
#include "gui/widgets/edittext.h"

#include "common/config-manager.h"
#include "common/system.h"
Expand Down Expand Up @@ -53,10 +54,9 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser)
_showHidden = false;

// Headline - TODO: should be customizable during creation time
new StaticTextWidget(this, "Browser.Headline", title);


// Current path - TODO: handle long paths ?
_currentPath = new StaticTextWidget(this, "Browser.Path", "DUMMY");
_currentPath = new EditTextWidget(this, "Browser.Path", "DUMMY");

// Add file list
_fileList = new ListWidget(this, "Browser.List");
Expand Down Expand Up @@ -94,6 +94,11 @@ void BrowserDialog::open() {

void BrowserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
switch (cmd) {
//Search by text input
case _ExitTxtCmd:
_node = Common::FSNode(_currentPath->getEditString());
updateListing();
break;
case kChooseCmd:
if (_isDirBrowser) {
// If nothing is selected in the list widget, choose the current dir.
Expand Down Expand Up @@ -157,7 +162,7 @@ void BrowserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data

void BrowserDialog::updateListing() {
// Update the path display
_currentPath->setLabel(_node.getPath());
_currentPath->setEditString(_node.getPath());

// We memorize the last visited path.
ConfMan.set("browser_lastpath", _node.getPath());
Expand Down

0 comments on commit a0c1cdd

Please sign in to comment.