aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/options.cpp83
-rw-r--r--gui/options.h3
-rw-r--r--gui/themes/scummclassic.zipbin129668 -> 130414 bytes
-rw-r--r--gui/themes/scummclassic/classic_layout.stx12
-rw-r--r--gui/themes/scummclassic/classic_layout_lowres.stx12
-rw-r--r--gui/themes/scummmodern.zipbin1649476 -> 1650222 bytes
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx12
-rw-r--r--gui/themes/scummmodern/scummmodern_layout_lowres.stx12
8 files changed, 132 insertions, 2 deletions
diff --git a/gui/options.cpp b/gui/options.cpp
index f798f1e59d..3f2674b016 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -103,7 +103,9 @@ enum {
kDownloadStorageCmd = 'dlst',
kRunServerCmd = 'rnsv',
kCloudTabContainerReflowCmd = 'ctcr',
- kServerPortClearCmd = 'spcl'
+ kServerPortClearCmd = 'spcl',
+ kChooseRootDirCmd = 'chrp',
+ kRootPathClearCmd = 'clrp'
};
#endif
@@ -1319,6 +1321,15 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher)
_runServerButton = new ButtonWidget(container, "GlobalOptions_Cloud_Container.RunServerButton", _("Run server"), _("Run local webserver"), kRunServerCmd);
_serverInfoLabel = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.ServerInfoLabel", _("Not running"));
+ // Root path
+ if (g_system->getOverlayWidth() > 320)
+ _rootPathButton = new ButtonWidget(container, "GlobalOptions_Cloud_Container.RootPathButton", _("/root/ Path:"), _("Specifies where Files Manager can access to"), kChooseRootDirCmd);
+ else
+ _rootPathButton = new ButtonWidget(container, "GlobalOptions_Cloud_Container.RootPathButton", _c("/root/ Path:", "lowres"), _("Specifies where Files Manager can access to"), kChooseRootDirCmd);
+ _rootPath = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.RootPath", "/foo/bar", _("Specifies where Files Manager can access to"));
+
+ _rootPathClearButton = addClearButton(container, "GlobalOptions_Cloud_Container.RootPathClearButton", kRootPathClearCmd);
+
#ifdef USE_SDL_NET
uint32 port = Networking::LocalWebserver::getPort();
#else
@@ -1411,6 +1422,15 @@ void GlobalOptionsDialog::open() {
if (mode == ThemeEngine::kGfxDisabled)
mode = ThemeEngine::_defaultRendererMode;
_rendererPopUp->setSelectedTag(mode);
+
+#ifdef USE_CLOUD
+ Common::String rootPath(ConfMan.get("rootpath", "cloud"));
+ if (rootPath.empty() || !ConfMan.hasKey("rootpath", "cloud")) {
+ _rootPath->setLabel(_c("None", "path"));
+ } else {
+ _rootPath->setLabel(rootPath);
+ }
+#endif
}
void GlobalOptionsDialog::close() {
@@ -1441,6 +1461,14 @@ void GlobalOptionsDialog::close() {
ConfMan.removeKey("pluginspath", _domain);
#endif
+#ifdef USE_CLOUD
+ Common::String rootPath(_rootPath->getLabel());
+ if (!rootPath.empty() && (rootPath != _c("None", "path")))
+ ConfMan.set("rootpath", rootPath, "cloud");
+ else
+ ConfMan.removeKey("rootpath", "cloud");
+#endif
+
ConfMan.setInt("autosave_period", _autosavePeriodPopUp->getSelectedTag(), _domain);
GUI::ThemeEngine::GraphicsMode selected = (GUI::ThemeEngine::GraphicsMode)_rendererPopUp->getSelectedTag();
@@ -1571,6 +1599,21 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
break;
}
#endif
+#ifdef USE_CLOUD
+ case kChooseRootDirCmd: {
+ BrowserDialog browser(_("Select directory for Files Manager /root/"), true);
+ if (browser.runModal() > 0) {
+ // User made his choice...
+ Common::FSNode dir(browser.getResult());
+ Common::String path = dir.getPath();
+ if (path.empty())
+ path = "/"; // absolute root
+ _rootPath->setLabel(path);
+ draw();
+ }
+ break;
+ }
+#endif
case kThemePathClearCmd:
_themePath->setLabel(_c("None", "path"));
break;
@@ -1580,6 +1623,11 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
case kSavePathClearCmd:
_savePath->setLabel(_("Default"));
break;
+#ifdef USE_CLOUD
+ case kRootPathClearCmd:
+ _rootPath->setLabel(_c("None", "path"));
+ break;
+#endif
case kChooseSoundFontCmd: {
BrowserDialog browser(_("Select SoundFont"), false);
if (browser.runModal() > 0) {
@@ -1868,13 +1916,26 @@ void GlobalOptionsDialog::setupCloudTab() {
//determine original widget's positions
int16 x, y;
uint16 w, h;
- int serverButtonY, serverInfoY, serverPortDescY, serverPortY, serverPortClearButtonY;
+ int serverButtonY, serverInfoY;
+ int serverRootButtonY, serverRootY, serverRootClearButtonY;
+ int serverPortDescY, serverPortY, serverPortClearButtonY;
if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.RunServerButton", x, y, w, h))
warning("GlobalOptions_Cloud_Container.RunServerButton's position is undefined");
serverButtonY = y;
if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.ServerInfoLabel", x, y, w, h))
warning("GlobalOptions_Cloud_Container.ServerInfoLabel's position is undefined");
serverInfoY = y;
+
+ if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.RootPathButton", x, y, w, h))
+ warning("GlobalOptions_Cloud_Container.RootPathButton's position is undefined");
+ serverRootButtonY = y;
+ if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.RootPath", x, y, w, h))
+ warning("GlobalOptions_Cloud_Container.RootPath's position is undefined");
+ serverRootY = y;
+ if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.RootPathClearButton", x, y, w, h))
+ warning("GlobalOptions_Cloud_Container.RootPathClearButton's position is undefined");
+ serverRootClearButtonY = y;
+
if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.ServerPortDesc", x, y, w, h))
warning("GlobalOptions_Cloud_Container.ServerPortDesc's position is undefined");
serverPortDescY = y;
@@ -1903,6 +1964,18 @@ void GlobalOptionsDialog::setupCloudTab() {
else
_serverInfoLabel->setLabel(_("Not running"));
}
+ if (_rootPathButton) {
+ _rootPathButton->setVisible(true);
+ _rootPathButton->setPos(_rootPathButton->getRelX(), serverLabelPosition + serverRootButtonY - serverInfoY);
+ }
+ if (_rootPath) {
+ _rootPath->setVisible(true);
+ _rootPath->setPos(_rootPath->getRelX(), serverLabelPosition + serverRootY - serverInfoY);
+ }
+ if (_rootPathClearButton) {
+ _rootPathClearButton->setVisible(true);
+ _rootPathClearButton->setPos(_rootPathClearButton->getRelX(), serverLabelPosition + serverRootClearButtonY - serverInfoY);
+ }
#ifdef NETWORKING_LOCALWEBSERVER_ENABLE_PORT_OVERRIDE
if (_serverPortDesc) {
_serverPortDesc->setVisible(true);
@@ -1932,6 +2005,12 @@ void GlobalOptionsDialog::setupCloudTab() {
_runServerButton->setVisible(false);
if (_serverInfoLabel)
_serverInfoLabel->setVisible(false);
+ if (_rootPathButton)
+ _rootPathButton->setVisible(false);
+ if (_rootPath)
+ _rootPath->setVisible(false);
+ if (_rootPathClearButton)
+ _rootPathClearButton->setVisible(false);
if (_serverPortDesc)
_serverPortDesc->setVisible(false);
if (_serverPort)
diff --git a/gui/options.h b/gui/options.h
index 42e8ffbbde..03dbdac492 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -268,6 +268,9 @@ protected:
ButtonWidget *_storageDownloadButton;
ButtonWidget *_runServerButton;
StaticTextWidget *_serverInfoLabel;
+ ButtonWidget *_rootPathButton;
+ StaticTextWidget *_rootPath;
+ ButtonWidget *_rootPathClearButton;
StaticTextWidget *_serverPortDesc;
EditTextWidget *_serverPort;
ButtonWidget *_serverPortClearButton;
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 86d5c497a0..e574fe5039 100644
--- a/gui/themes/scummclassic.zip
+++ b/gui/themes/scummclassic.zip
Binary files differ
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 79320b0756..c67631ad22 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -584,6 +584,18 @@
/>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'RootPathButton'
+ type = 'Button'
+ />
+ <widget name = 'RootPath'
+ height = 'Globals.Line.Height'
+ />
+ <widget name = 'RootPathClearButton'
+ height = 'Globals.Line.Height'
+ width = 'Globals.Line.Height'
+ />
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<widget name = 'ServerPortDesc'
type = 'OptionsLabel'
/>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 9bdea8fa8d..e19256695c 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -596,6 +596,18 @@
height = 'Globals.Line.Height'
/>
</layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'>
+ <widget name = 'RootPathButton'
+ type = 'Button'
+ />
+ <widget name = 'RootPathPath'
+ height = 'Globals.Line.Height'
+ />
+ <widget name = 'RootPathClearButton'
+ height = 'Globals.Line.Height'
+ width = 'Globals.Line.Height'
+ />
+ </layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
<widget name = 'ServerPortDesc'
width = '80'
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 3c1fe66f62..78b62d4286 100644
--- a/gui/themes/scummmodern.zip
+++ b/gui/themes/scummmodern.zip
Binary files differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index f4fa200cda..bb182c9dbb 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -598,6 +598,18 @@
/>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <widget name = 'RootPathButton'
+ type = 'Button'
+ />
+ <widget name = 'RootPath'
+ height = 'Globals.Line.Height'
+ />
+ <widget name = 'RootPathClearButton'
+ height = 'Globals.Line.Height'
+ width = 'Globals.Line.Height'
+ />
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<widget name = 'ServerPortDesc'
type = 'OptionsLabel'
/>
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 3f7e263306..3416fbeb5e 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -594,6 +594,18 @@
height = 'Globals.Line.Height'
/>
</layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' center = 'true'>
+ <widget name = 'RootPathButton'
+ type = 'Button'
+ />
+ <widget name = 'RootPathPath'
+ height = 'Globals.Line.Height'
+ />
+ <widget name = 'RootPathClearButton'
+ height = 'Globals.Line.Height'
+ width = 'Globals.Line.Height'
+ />
+ </layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
<widget name = 'ServerPortDesc'
width = '80'