aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/options.cpp94
-rw-r--r--gui/options.h2
-rw-r--r--gui/themes/scummclassic.zipbin136743 -> 137446 bytes
-rw-r--r--gui/themes/scummclassic/classic_layout.stx10
-rw-r--r--gui/themes/scummclassic/classic_layout_lowres.stx10
-rw-r--r--gui/themes/scummmodern.zipbin265510 -> 266213 bytes
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx10
-rw-r--r--gui/themes/scummmodern/scummmodern_layout_lowres.stx10
-rw-r--r--gui/themes/scummremastered.zipbin265448 -> 266151 bytes
-rw-r--r--gui/themes/scummremastered/remastered_layout.stx10
-rw-r--r--gui/themes/scummremastered/remastered_layout_lowres.stx10
11 files changed, 127 insertions, 29 deletions
diff --git a/gui/options.cpp b/gui/options.cpp
index 7d9558a4a7..6645e9db67 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -114,7 +114,8 @@ enum {
kConnectStorageCmd = 'Cnnt',
kOpenUrlStorageCmd = 'OpUr',
kPasteCodeStorageCmd = 'PsCd',
- kDisconnectStorageCmd = 'DcSt'
+ kDisconnectStorageCmd = 'DcSt',
+ kEnableStorageCmd = 'EnSt'
};
#endif
@@ -1481,6 +1482,8 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher)
_selectedStorageIndex = CloudMan.getStorageIndex();
_storagePopUpDesc = 0;
_storagePopUp = 0;
+ _storageDisabledHint = 0;
+ _storageEnableButton = 0;
_storageUsernameDesc = 0;
_storageUsername = 0;
_storageUsedSpaceDesc = 0;
@@ -1872,6 +1875,9 @@ void GlobalOptionsDialog::addCloudControls(GuiObject *boss, const Common::String
_storagePopUp->appendEntry(list[i], i);
_storagePopUp->setSelected(_selectedStorageIndex);
+ _storageDisabledHint = new StaticTextWidget(boss, prefix + "StorageDisabledHint", _c("4. Storage is yet disabled. Verify that username is correct and enable it:", context));
+ _storageEnableButton = new ButtonWidget(boss, prefix + "StorageEnableButton", _("Enable storage"), _("Confirm you want to use this account for this storage"), kEnableStorageCmd);
+
_storageUsernameDesc = new StaticTextWidget(boss, prefix + "StorageUsernameDesc", _("Username:"), _("Username used by this storage"));
_storageUsername = new StaticTextWidget(boss, prefix + "StorageUsernameLabel", "<none>", "", ThemeEngine::kFontStyleNormal);
@@ -2220,6 +2226,13 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
reflowLayout();
break;
}
+ case kEnableStorageCmd: {
+ CloudMan.enableStorage();
+ _redrawCloudTab = true;
+
+ // also, automatically start saves sync when user enables the storage
+ // fall through
+ }
case kSyncSavesStorageCmd: {
CloudMan.syncSaves(
new Common::Callback<GlobalOptionsDialog, Cloud::Storage::BoolResponse>(this, &GlobalOptionsDialog::storageSavesSyncedCallback)
@@ -2467,9 +2480,28 @@ void GlobalOptionsDialog::setupCloudTab() {
bool storageConnected = (username != "");
bool shown = (_selectedStorageIndex != Cloud::kStorageNoneId);
bool shownConnectedInfo = (shown && storageConnected);
+ bool showingCurrentStorage = (shownConnectedInfo && _selectedStorageIndex == CloudMan.getStorageIndex());
+ bool enabled = (shownConnectedInfo && CloudMan.isStorageEnabled());
// there goes layout for connected Storage
+ if (_storageDisabledHint) _storageDisabledHint->setVisible(showingCurrentStorage && !enabled);
+ if (_storageEnableButton) _storageEnableButton->setVisible(showingCurrentStorage && !enabled);
+
+ // calculate shift
+ int16 x, y;
+ uint16 w, h;
+ int16 shiftUp = 0;
+ if (!showingCurrentStorage || enabled) {
+ // "storage is disabled" hint is not shown, shift everything up
+ if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.StorageDisabledHint", x, y, w, h))
+ warning("GlobalOptions_Cloud_Container.StorageUsernameDesc's position is undefined");
+ shiftUp = y;
+ if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.StorageUsernameDesc", x, y, w, h))
+ warning("GlobalOptions_Cloud_Container.StorageWizardNotConnectedHint's position is undefined");
+ shiftUp = y - shiftUp;
+ }
+
if (_storageUsernameDesc) _storageUsernameDesc->setVisible(shownConnectedInfo);
if (_storageUsername) {
_storageUsername->setLabel(username);
@@ -2499,37 +2531,42 @@ void GlobalOptionsDialog::setupCloudTab() {
_storageLastSync->setLabel(sync);
_storageLastSync->setVisible(shownConnectedInfo);
}
- if (_storageSyncSavesButton)
- _storageSyncSavesButton->setVisible(shownConnectedInfo && _selectedStorageIndex == CloudMan.getStorageIndex());
+ if (_storageSyncSavesButton) {
+ _storageSyncSavesButton->setVisible(showingCurrentStorage);
+ _storageSyncSavesButton->setEnabled(enabled);
+ }
- int16 x, y;
- uint16 w, h;
- int16 downloadHintY, downloadButtonY, disconnectHintY;
- if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.StorageDownloadHint", x, y, w, h))
- warning("GlobalOptions_Cloud_Container.StorageDownloadHint's position is undefined");
- downloadHintY = y;
- if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.DownloadButton", x, y, w, h))
- warning("GlobalOptions_Cloud_Container.DownloadButton's position is undefined");
- downloadButtonY = y;
- if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.StorageDisconnectHint", x, y, w, h))
- warning("GlobalOptions_Cloud_Container.StorageDisconnectHint's position is undefined");
- disconnectHintY = y;
-
- bool showDownloadButton = (shownConnectedInfo && _selectedStorageIndex == CloudMan.getStorageIndex() && _selectedStorageIndex != Cloud::kStorageGoogleDriveId); // cannot download via Google Drive
+ bool showDownloadButton = (showingCurrentStorage && _selectedStorageIndex != Cloud::kStorageGoogleDriveId); // cannot download via Google Drive
if (_storageDownloadHint) _storageDownloadHint->setVisible(showDownloadButton);
- if (_storageDownloadButton) _storageDownloadButton->setVisible(showDownloadButton);
+ if (_storageDownloadButton) {
+ _storageDownloadButton->setVisible(showDownloadButton);
+ _storageDownloadButton->setEnabled(enabled);
+ }
if (_storageDisconnectHint) _storageDisconnectHint->setVisible(shownConnectedInfo);
if (_storageDisconnectButton) _storageDisconnectButton->setVisible(shownConnectedInfo);
- if (showDownloadButton) {
- if (_storageDownloadHint) _storageDownloadHint->setPos(_storageDownloadHint->getRelX(), downloadHintY);
- if (_storageDownloadButton) _storageDownloadButton->setPos(_storageDownloadButton->getRelX(), downloadButtonY);
- if (_storageDisconnectHint) _storageDisconnectHint->setPos(_storageDisconnectHint->getRelX(), disconnectHintY);
- if (_storageDisconnectButton)_storageDisconnectButton->setPos(_storageDisconnectButton->getRelX(), disconnectHintY + downloadButtonY - downloadHintY);
- } else {
- if (_storageDisconnectHint) _storageDisconnectHint->setPos(_storageDisconnectHint->getRelX(), downloadHintY);
- if (_storageDisconnectButton)_storageDisconnectButton->setPos(_storageDisconnectButton->getRelX(), downloadButtonY);
- }
+ int16 disconnectWidgetsAdditionalShift = 0;
+ if (!showDownloadButton) {
+ if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.StorageDownloadHint", x, y, w, h))
+ warning("GlobalOptions_Cloud_Container.StorageDownloadHint's position is undefined");
+ disconnectWidgetsAdditionalShift = y;
+ if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.StorageDisconnectHint", x, y, w, h))
+ warning("GlobalOptions_Cloud_Container.DownloadButton's position is undefined");
+ disconnectWidgetsAdditionalShift = y - disconnectWidgetsAdditionalShift;
+ }
+
+ shiftWidget(_storageUsernameDesc, "GlobalOptions_Cloud_Container.StorageUsernameDesc", 0, -shiftUp);
+ shiftWidget(_storageUsername, "GlobalOptions_Cloud_Container.StorageUsernameLabel", 0, -shiftUp);
+ shiftWidget(_storageUsedSpaceDesc, "GlobalOptions_Cloud_Container.StorageUsedSpaceDesc", 0, -shiftUp);
+ shiftWidget(_storageUsedSpace, "GlobalOptions_Cloud_Container.StorageUsedSpaceLabel", 0, -shiftUp);
+ shiftWidget(_storageSyncHint, "GlobalOptions_Cloud_Container.StorageSyncHint", 0, -shiftUp);
+ shiftWidget(_storageLastSyncDesc, "GlobalOptions_Cloud_Container.StorageLastSyncDesc", 0, -shiftUp);
+ shiftWidget(_storageLastSync, "GlobalOptions_Cloud_Container.StorageLastSyncLabel", 0, -shiftUp);
+ shiftWidget(_storageSyncSavesButton, "GlobalOptions_Cloud_Container.SyncSavesButton", 0, -shiftUp);
+ shiftWidget(_storageDownloadHint, "GlobalOptions_Cloud_Container.StorageDownloadHint", 0, -shiftUp);
+ shiftWidget(_storageDownloadButton, "GlobalOptions_Cloud_Container.DownloadButton", 0, -shiftUp);
+ shiftWidget(_storageDisconnectHint, "GlobalOptions_Cloud_Container.StorageDisconnectHint", 0, -shiftUp - disconnectWidgetsAdditionalShift);
+ shiftWidget(_storageDisconnectButton, "GlobalOptions_Cloud_Container.DisconnectButton", 0, -shiftUp - disconnectWidgetsAdditionalShift);
// there goes layout for non-connected Storage (connection wizard)
@@ -2560,8 +2597,7 @@ void GlobalOptionsDialog::setupCloudTab() {
}
if (!shownConnectedInfo) {
- int16 shiftUp;
- if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.StorageUsernameDesc", x, y, w, h))
+ if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.StorageDisabledHint", x, y, w, h))
warning("GlobalOptions_Cloud_Container.StorageUsernameDesc's position is undefined");
shiftUp = y;
if (!g_gui.xmlEval()->getWidgetData("GlobalOptions_Cloud_Container.StorageWizardNotConnectedHint", x, y, w, h))
diff --git a/gui/options.h b/gui/options.h
index a1cdcec6bc..10ff62d81c 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -298,6 +298,8 @@ protected:
uint32 _selectedStorageIndex;
StaticTextWidget *_storagePopUpDesc;
PopUpWidget *_storagePopUp;
+ StaticTextWidget *_storageDisabledHint;
+ ButtonWidget *_storageEnableButton;
StaticTextWidget *_storageUsernameDesc;
StaticTextWidget *_storageUsername;
StaticTextWidget *_storageUsedSpaceDesc;
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 15dd50ac2a..0eba01ad6f 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 5dbd4ca320..1ed4f6b2c6 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -625,6 +625,16 @@
</layout>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <layout type = 'vertical' padding = '0, 0, 8, 0' spacing = '4'>
+ <widget name = 'StorageDisabledHint'
+ height = 'Globals.Line.Height'
+ />
+ <widget name = 'StorageEnableButton'
+ type = 'Button'
+ />
+ </layout>
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<layout type = 'vertical' padding = '0, 0, 6, 0' spacing = '2'>
<widget name = 'StorageUsernameDesc'
type = 'CloudTabLabel'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index d849513c1d..d73327d2fa 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -630,6 +630,16 @@
</layout>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
+ <layout type = 'vertical' padding = '0, 0, 3, 0' spacing = '4'>
+ <widget name = 'StorageDisabledHint'
+ height = 'Globals.Line.Height'
+ />
+ <widget name = 'StorageEnableButton'
+ type = 'Button'
+ />
+ </layout>
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
<layout type = 'vertical' padding = '0, 0, 3, 0' spacing = '1'>
<widget name = 'StorageUsernameDesc'
type = 'CloudTabLabel'
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index b998e352be..cf5938805d 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 f6d5d6167d..ad4f6d71ca 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -639,6 +639,16 @@
</layout>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <layout type = 'vertical' padding = '0, 0, 8, 0' spacing = '4'>
+ <widget name = 'StorageDisabledHint'
+ height = 'Globals.Line.Height'
+ />
+ <widget name = 'StorageEnableButton'
+ type = 'Button'
+ />
+ </layout>
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<layout type = 'vertical' padding = '0, 0, 6, 0' spacing = '2'>
<widget name = 'StorageUsernameDesc'
type = 'CloudTabLabel'
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index e44aaa901e..bb06082017 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -628,6 +628,16 @@
</layout>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
+ <layout type = 'vertical' padding = '0, 0, 3, 0' spacing = '4'>
+ <widget name = 'StorageDisabledHint'
+ height = 'Globals.Line.Height'
+ />
+ <widget name = 'StorageEnableButton'
+ type = 'Button'
+ />
+ </layout>
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
<layout type = 'vertical' padding = '0, 0, 3, 0' spacing = '1'>
<widget name = 'StorageUsernameDesc'
type = 'CloudTabLabel'
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index 57775abf02..f9bf2e4559 100644
--- a/gui/themes/scummremastered.zip
+++ b/gui/themes/scummremastered.zip
Binary files differ
diff --git a/gui/themes/scummremastered/remastered_layout.stx b/gui/themes/scummremastered/remastered_layout.stx
index f6d5d6167d..ad4f6d71ca 100644
--- a/gui/themes/scummremastered/remastered_layout.stx
+++ b/gui/themes/scummremastered/remastered_layout.stx
@@ -639,6 +639,16 @@
</layout>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
+ <layout type = 'vertical' padding = '0, 0, 8, 0' spacing = '4'>
+ <widget name = 'StorageDisabledHint'
+ height = 'Globals.Line.Height'
+ />
+ <widget name = 'StorageEnableButton'
+ type = 'Button'
+ />
+ </layout>
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' center = 'true'>
<layout type = 'vertical' padding = '0, 0, 6, 0' spacing = '2'>
<widget name = 'StorageUsernameDesc'
type = 'CloudTabLabel'
diff --git a/gui/themes/scummremastered/remastered_layout_lowres.stx b/gui/themes/scummremastered/remastered_layout_lowres.stx
index 32191aab76..5a265e208a 100644
--- a/gui/themes/scummremastered/remastered_layout_lowres.stx
+++ b/gui/themes/scummremastered/remastered_layout_lowres.stx
@@ -628,6 +628,16 @@
</layout>
</layout>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
+ <layout type = 'vertical' padding = '0, 0, 3, 0' spacing = '4'>
+ <widget name = 'StorageDisabledHint'
+ height = 'Globals.Line.Height'
+ />
+ <widget name = 'StorageEnableButton'
+ type = 'Button'
+ />
+ </layout>
+ </layout>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '6' center = 'true'>
<layout type = 'vertical' padding = '0, 0, 3, 0' spacing = '1'>
<widget name = 'StorageUsernameDesc'
type = 'CloudTabLabel'