aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/browser.cpp11
-rw-r--r--gui/launcher.cpp16
-rw-r--r--gui/massadd.cpp6
-rw-r--r--gui/options.cpp18
-rw-r--r--gui/themebrowser.cpp9
5 files changed, 32 insertions, 28 deletions
diff --git a/gui/browser.cpp b/gui/browser.cpp
index b0367fa1dc..ebe4aef0c4 100644
--- a/gui/browser.cpp
+++ b/gui/browser.cpp
@@ -28,7 +28,6 @@
#include "gui/ListWidget.h"
#include "common/config-manager.h"
-#include "common/fs.h"
#include "common/system.h"
#include "common/algorithm.h"
@@ -223,15 +222,15 @@ void BrowserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
void BrowserDialog::updateListing() {
// Update the path display
- _currentPath->setLabel(_node.path());
+ _currentPath->setLabel(_node.getPath());
// We memorize the last visited path.
- ConfMan.set("browser_lastpath", _node.path());
+ ConfMan.set("browser_lastpath", _node.getPath());
// Read in the data from the file system
FilesystemNode::ListMode listMode = _isDirBrowser ? FilesystemNode::kListDirectoriesOnly
: FilesystemNode::kListAll;
- if (!_node.listDir(_nodeContent, listMode)) {
+ if (!_node.getChildren(_nodeContent, listMode)) {
_nodeContent.clear();
} else {
Common::sort(_nodeContent.begin(), _nodeContent.end());
@@ -241,9 +240,9 @@ void BrowserDialog::updateListing() {
Common::StringList list;
for (FSList::iterator i = _nodeContent.begin(); i != _nodeContent.end(); ++i) {
if (!_isDirBrowser && i->isDirectory())
- list.push_back(i->displayName() + "/");
+ list.push_back(i->getDisplayName() + "/");
else
- list.push_back(i->displayName());
+ list.push_back(i->getDisplayName());
}
_fileList->setList(list);
_fileList->scrollTo(0);
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 59404dfd74..2dc3fbba28 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -394,9 +394,9 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
if (browser.runModal() > 0) {
// User made this choice...
FilesystemNode file(browser.getResult());
- _soundFont->setLabel(file.path());
+ _soundFont->setLabel(file.getPath());
- if (!file.path().empty() && (file.path() != "None"))
+ if (!file.getPath().empty() && (file.getPath() != "None"))
_soundFontClearButton->setEnabled(true);
else
_soundFontClearButton->setEnabled(false);
@@ -417,7 +417,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
// done with optional specific gameid to pluginmgr detectgames?
// FSList files = dir.listDir(FilesystemNode::kListFilesOnly);
- _gamePathWidget->setLabel(dir.path());
+ _gamePathWidget->setLabel(dir.getPath());
draw();
}
draw();
@@ -430,7 +430,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode dir(browser.getResult());
- _extraPathWidget->setLabel(dir.path());
+ _extraPathWidget->setLabel(dir.getPath());
draw();
}
draw();
@@ -442,7 +442,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode dir(browser.getResult());
- _savePathWidget->setLabel(dir.path());
+ _savePathWidget->setLabel(dir.getPath());
draw();
}
draw();
@@ -654,9 +654,9 @@ void LauncherDialog::addGame() {
// User made his choice...
FilesystemNode dir(_browser->getResult());
FSList files;
- if (!dir.listDir(files, FilesystemNode::kListAll)) {
+ if (!dir.getChildren(files, FilesystemNode::kListAll)) {
error("browser returned a node that is not a directory: '%s'",
- dir.path().c_str());
+ dir.getPath().c_str());
}
// ...so let's determine a list of candidates, games that
@@ -686,7 +686,7 @@ void LauncherDialog::addGame() {
GameDescriptor result = candidates[idx];
// TODO: Change the detectors to set "path" !
- result["path"] = dir.path();
+ result["path"] = dir.getPath();
Common::String domain = addGameToConf(result);
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index 802f1cf084..987a92efb5 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -128,9 +128,9 @@ void MassAddDialog::handleTickle() {
FilesystemNode dir = _scanStack.pop();
FSList files;
- if (!dir.listDir(files, FilesystemNode::kListAll)) {
+ if (!dir.getChildren(files, FilesystemNode::kListAll)) {
error("browser returned a node that is not a directory: '%s'",
- dir.path().c_str());
+ dir.getPath().c_str());
}
// Run the detector on the dir
@@ -142,7 +142,7 @@ void MassAddDialog::handleTickle() {
// e.g. ask the user which one to pick (make sure to display the
// path, too).
GameDescriptor result = candidates[0];
- result["path"] = dir.path();
+ result["path"] = dir.getPath();
_games.push_back(result);
}
diff --git a/gui/options.cpp b/gui/options.cpp
index c14677f007..66786eff6c 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -27,6 +27,7 @@
#include "gui/themebrowser.h"
#include "gui/chooser.h"
#include "gui/eval.h"
+#include "gui/message.h"
#include "gui/newgui.h"
#include "gui/options.h"
#include "gui/PopUpWidget.h"
@@ -813,9 +814,14 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode dir(browser.getResult());
- _savePath->setLabel(dir.path());
+ if(dir.isWritable()) {
+ _savePath->setLabel(dir.getPath());
+ } else {
+ MessageDialog error("The chosen directory cannot be written to. Please select another one.");
+ error.runModal();
+ return;
+ }
draw();
- // TODO - we should check if the directory is writeable before accepting it
}
break;
}
@@ -824,7 +830,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode dir(browser.getResult());
- _themePath->setLabel(dir.path());
+ _themePath->setLabel(dir.getPath());
draw();
}
break;
@@ -834,7 +840,7 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode dir(browser.getResult());
- _extraPath->setLabel(dir.path());
+ _extraPath->setLabel(dir.getPath());
draw();
}
break;
@@ -844,9 +850,9 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
if (browser.runModal() > 0) {
// User made his choice...
FilesystemNode file(browser.getResult());
- _soundFont->setLabel(file.path());
+ _soundFont->setLabel(file.getPath());
- if (!file.path().empty() && (file.path() != "None"))
+ if (!file.getPath().empty() && (file.getPath() != "None"))
_soundFontClearButton->setEnabled(true);
else
_soundFontClearButton->setEnabled(false);
diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp
index 234e0ed2b9..75fe5404c4 100644
--- a/gui/themebrowser.cpp
+++ b/gui/themebrowser.cpp
@@ -27,7 +27,6 @@
#include "gui/ListWidget.h"
#include "gui/widget.h"
#include "gui/theme.h"
-#include "common/fs.h"
#ifdef MACOSX
#include "CoreFoundation/CoreFoundation.h"
@@ -145,16 +144,16 @@ void ThemeBrowser::addDir(ThList &list, const Common::String &dir, int level) {
FilesystemNode node(dir);
- if (!node.isValid())
+ if (!node.exists() || !node.isReadable())
return;
FSList fslist;
- if (!node.listDir(fslist, FilesystemNode::kListAll))
+ if (!node.getChildren(fslist, FilesystemNode::kListAll))
return;
for (FSList::const_iterator i = fslist.begin(); i != fslist.end(); ++i) {
if (i->isDirectory()) {
- addDir(list, i->path(), level-1);
+ addDir(list, i->getPath(), level-1);
} else {
Entry th;
if (isTheme(*i, th)) {
@@ -177,7 +176,7 @@ bool ThemeBrowser::isTheme(const FilesystemNode &node, Entry &out) {
Common::ConfigFile cfg;
Common::String type;
- out.file = node.name();
+ out.file = node.getName();
for (int i = out.file.size()-1; out.file[i] != '.' && i > 0; --i) {
out.file.deleteLastChar();
}