aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-05 15:44:05 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commite7763700e2e2016f4573e3feb77b5fab69268683 (patch)
tree11f66f0ea476782613618451d5630d1e32a04a92 /gui
parent8de2862eaa6513c43502bea86f53967015298884 (diff)
downloadscummvm-rg350-e7763700e2e2016f4573e3feb77b5fab69268683.tar.gz
scummvm-rg350-e7763700e2e2016f4573e3feb77b5fab69268683.tar.bz2
scummvm-rg350-e7763700e2e2016f4573e3feb77b5fab69268683.zip
CLOUD: Make Save/Load dialog start saves sync
It also shows a "sync disabled" icon in case it has a savepath override.
Diffstat (limited to 'gui')
-rw-r--r--gui/saveload-dialog.cpp16
-rw-r--r--gui/saveload-dialog.h2
-rw-r--r--gui/saveload.cpp2
3 files changed, 20 insertions, 0 deletions
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index 3d4adfff2b..d9713505e6 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -21,6 +21,11 @@
*/
#include "gui/saveload-dialog.h"
+
+#include "backends/cloud/cloudmanager.h"
+#include "backends/cloud/savessyncrequest.h"
+#include "backends/networking/curl/connectionmanager.h"
+
#include "common/translation.h"
#include "common/config-manager.h"
@@ -135,6 +140,17 @@ void SaveLoadChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uin
return Dialog::handleCommand(sender, cmd, data);
}
+void SaveLoadChooserDialog::runSaveSync(bool hasSavepathOverride) {
+ if (!CloudMan.isSyncing()) {
+ if (hasSavepathOverride) {
+ ConnMan.showCloudDisabledIcon();
+ } else {
+ Cloud::SavesSyncRequest *request = CloudMan.syncSaves();
+ if (request) request->setTarget(this);
+ }
+ }
+}
+
void SaveLoadChooserDialog::reflowLayout() {
#ifndef DISABLE_SAVELOADCHOOSER_GRID
addChooserButtons();
diff --git a/gui/saveload-dialog.h b/gui/saveload-dialog.h
index 31f28f6452..0e67ba89fe 100644
--- a/gui/saveload-dialog.h
+++ b/gui/saveload-dialog.h
@@ -60,6 +60,8 @@ public:
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
+ virtual void runSaveSync(bool hasSavepathOverride);
+
#ifndef DISABLE_SAVELOADCHOOSER_GRID
virtual SaveLoadChooserType getType() const = 0;
#endif // !DISABLE_SAVELOADCHOOSER_GRID
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index b94d30289b..b3e669899f 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -87,6 +87,8 @@ int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, con
if (!_impl)
return -1;
+ _impl->runSaveSync(ConfMan.hasKey("savepath", target));
+
// Set up the game domain as newly active domain, so
// target specific savepath will be checked
String oldDomain = ConfMan.getActiveDomainName();