CLOUD: Fix SaveLoadDialogs to check USE_CLOUD
Linking was failing when disabling curl support.
This commit is contained in:
parent
ad069f442c
commit
81c85b6651
3 changed files with 27 additions and 1 deletions
|
@ -22,9 +22,11 @@
|
|||
|
||||
#include "gui/saveload-dialog.h"
|
||||
|
||||
#ifdef USE_CLOUD
|
||||
#include "backends/cloud/cloudmanager.h"
|
||||
#include "backends/cloud/savessyncrequest.h"
|
||||
#include "backends/networking/curl/connectionmanager.h"
|
||||
#endif
|
||||
|
||||
#include "common/translation.h"
|
||||
#include "common/config-manager.h"
|
||||
|
@ -39,6 +41,8 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
#ifdef USE_CLOUD
|
||||
|
||||
enum {
|
||||
kCancelSyncCmd = 'PDCS',
|
||||
kBackgroundSyncCmd = 'PDBS'
|
||||
|
@ -93,6 +97,7 @@ void SaveLoadCloudSyncProgressDialog::handleTickle() {
|
|||
|
||||
Dialog::handleTickle();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_SAVELOADCHOOSER_GRID
|
||||
SaveLoadChooserType getRequestedSaveLoadDialog(const MetaEngine &metaEngine) {
|
||||
|
@ -152,7 +157,9 @@ SaveLoadChooserDialog::SaveLoadChooserDialog(int x, int y, int w, int h, const b
|
|||
}
|
||||
|
||||
SaveLoadChooserDialog::~SaveLoadChooserDialog() {
|
||||
#ifdef USE_CLOUD
|
||||
CloudMan.setSyncTarget(nullptr); //not that dialog, at least
|
||||
#endif
|
||||
}
|
||||
|
||||
void SaveLoadChooserDialog::open() {
|
||||
|
@ -166,7 +173,9 @@ void SaveLoadChooserDialog::open() {
|
|||
}
|
||||
|
||||
void SaveLoadChooserDialog::close() {
|
||||
#ifdef USE_CLOUD
|
||||
CloudMan.setSyncTarget(nullptr); //not that dialog, at least
|
||||
#endif
|
||||
Dialog::close();
|
||||
}
|
||||
|
||||
|
@ -206,14 +215,17 @@ void SaveLoadChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uin
|
|||
}
|
||||
#endif // !DISABLE_SAVELOADCHOOSER_GRID
|
||||
|
||||
#ifdef USE_CLOUD
|
||||
if (cmd == kSavesSyncProgressCmd || cmd == kSavesSyncEndedCmd) {
|
||||
//this dialog only gets these commands if the progress dialog was shown and user clicked "run in background"
|
||||
return updateSaveList();
|
||||
}
|
||||
#endif
|
||||
|
||||
return Dialog::handleCommand(sender, cmd, data);
|
||||
}
|
||||
|
||||
#ifdef USE_CLOUD
|
||||
void SaveLoadChooserDialog::runSaveSync(bool hasSavepathOverride) {
|
||||
if (!CloudMan.isSyncing()) {
|
||||
if (hasSavepathOverride) {
|
||||
|
@ -224,8 +236,10 @@ void SaveLoadChooserDialog::runSaveSync(bool hasSavepathOverride) {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void SaveLoadChooserDialog::handleTickle() {
|
||||
#ifdef USE_CLOUD
|
||||
if (!_dialogWasShown && CloudMan.isSyncing()) {
|
||||
Common::Array<Common::String> files = CloudMan.getSyncingFiles();
|
||||
if (!files.empty()) {
|
||||
|
@ -243,6 +257,7 @@ void SaveLoadChooserDialog::handleTickle() {
|
|||
updateSaveList();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Dialog::handleTickle();
|
||||
}
|
||||
|
||||
|
@ -263,9 +278,11 @@ void SaveLoadChooserDialog::reflowLayout() {
|
|||
Dialog::reflowLayout();
|
||||
}
|
||||
|
||||
void SaveLoadChooserDialog::updateSaveList() {
|
||||
void SaveLoadChooserDialog::updateSaveList() {
|
||||
#ifdef USE_CLOUD
|
||||
Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing
|
||||
g_system->getSavefileManager()->updateSavefilesList(files);
|
||||
#endif
|
||||
listSaves();
|
||||
}
|
||||
|
||||
|
@ -273,6 +290,8 @@ void SaveLoadChooserDialog::listSaves() {
|
|||
if (!_metaEngine) return; //very strange
|
||||
_saveList = _metaEngine->listSaves(_target.c_str());
|
||||
|
||||
#ifdef USE_CLOUD
|
||||
//if there is Cloud support, add currently synced files as "locked" saves in the list
|
||||
if (_metaEngine->simpleSaveNames()) {
|
||||
Common::String pattern = _target + ".###";
|
||||
Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing
|
||||
|
@ -294,6 +313,7 @@ void SaveLoadChooserDialog::listSaves() {
|
|||
|
||||
Common::sort(_saveList.begin(), _saveList.end(), SaveStateDescriptorSlotComparator());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef DISABLE_SAVELOADCHOOSER_GRID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue