diff options
author | Eugene Sandulenko | 2016-10-17 18:45:12 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-10-17 18:55:22 +0200 |
commit | e8b70a4686916774a1bf499c9c3136e3052b6b43 (patch) | |
tree | 93ca440db8e01bf53376909ebb5670f961613c8b /gui | |
parent | d3c173da7aa3ffcb62243816bd74ccb4ca3ec5b2 (diff) | |
download | scummvm-rg350-e8b70a4686916774a1bf499c9c3136e3052b6b43.tar.gz scummvm-rg350-e8b70a4686916774a1bf499c9c3136e3052b6b43.tar.bz2 scummvm-rg350-e8b70a4686916774a1bf499c9c3136e3052b6b43.zip |
ALL: Fix compilation with disabled cloud but enabled libcurl
Diffstat (limited to 'gui')
-rw-r--r-- | gui/editgamedialog.cpp | 4 | ||||
-rw-r--r-- | gui/launcher.cpp | 4 | ||||
-rw-r--r-- | gui/module.mk | 2 | ||||
-rw-r--r-- | gui/options.cpp | 12 | ||||
-rw-r--r-- | gui/saveload-dialog.cpp | 18 | ||||
-rw-r--r-- | gui/saveload-dialog.h | 4 | ||||
-rw-r--r-- | gui/saveload.cpp | 2 |
7 files changed, 25 insertions, 21 deletions
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp index a4731c1595..36af271d2c 100644 --- a/gui/editgamedialog.cpp +++ b/gui/editgamedialog.cpp @@ -38,7 +38,7 @@ #include "gui/widgets/tab.h" #include "gui/widgets/popup.h" -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) #include "backends/cloud/cloudmanager.h" #endif @@ -506,7 +506,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat // User made his choice... Common::FSNode dir(browser.getResult()); _savePathWidget->setLabel(dir.getPath()); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) MessageDialog warningMessage(_("Saved games sync feature doesn't work with non-default directories. If you want your saved games to sync, use default directory.")); warningMessage.runModal(); #endif diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 50f060de65..cf9c0bf56d 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -52,7 +52,7 @@ #include "gui/ThemeEval.h" #include "graphics/cursorman.h" -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) #include "backends/cloud/cloudmanager.h" #endif @@ -328,7 +328,7 @@ void LauncherDialog::addGame() { if (_browser->runModal() > 0) { // User made his choice... -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) String selectedDirectory = _browser->getResult().getPath(); String bannedDirectory = CloudMan.getDownloadLocalDirectory(); if (selectedDirectory.size() && selectedDirectory.lastChar() != '/' && selectedDirectory.lastChar() != '\\') diff --git a/gui/module.mk b/gui/module.mk index 54818c264e..5b32689a82 100644 --- a/gui/module.mk +++ b/gui/module.mk @@ -58,12 +58,14 @@ MODULE_OBJS += \ endif endif +ifdef USE_CLOUD ifdef USE_LIBCURL MODULE_OBJS += \ downloaddialog.o \ remotebrowser.o \ storagewizarddialog.o endif +endif ifdef ENABLE_EVENTRECORDER MODULE_OBJS += \ diff --git a/gui/options.cpp b/gui/options.cpp index 7a5f9d4386..7965cfd752 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -45,6 +45,7 @@ #include "widgets/scrollcontainer.h" #include "widgets/edittext.h" +#ifdef USE_CLOUD #ifdef USE_LIBCURL #include "backends/cloud/cloudmanager.h" #include "gui/downloaddialog.h" @@ -54,6 +55,7 @@ #ifdef USE_SDL_NET #include "backends/networking/sdl_net/localwebserver.h" #endif +#endif namespace GUI { @@ -412,7 +414,7 @@ void OptionsDialog::close() { g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen", _domain)); if (ConfMan.hasKey("filtering")) g_system->setFeatureState(OSystem::kFeatureFilteringMode, ConfMan.getBool("filtering", _domain)); - + OSystem::TransactionError gfxError = g_system->endGFXTransaction(); // Since this might change the screen resolution we need to give @@ -455,7 +457,7 @@ void OptionsDialog::close() { message += "\n"; message += _("the fullscreen setting could not be changed"); } - + if (gfxError & OSystem::kTransactionFilteringFailed) { ConfMan.setBool("filtering", g_system->getFeatureState(OSystem::kFeatureFilteringMode), _domain); message += "\n"; @@ -806,7 +808,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr // Fullscreen checkbox _fullscreenCheckbox = new CheckboxWidget(boss, prefix + "grFullscreenCheckbox", _("Fullscreen mode")); - + // Filtering checkbox _filteringCheckbox = new CheckboxWidget(boss, prefix + "grFilteringCheckbox", _("Filter graphics"), _("Use linear filtering when scaling graphics")); @@ -1310,7 +1312,7 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher) ScrollContainerWidget *container = new ScrollContainerWidget(tab, "GlobalOptions_Cloud.Container", kCloudTabContainerReflowCmd); container->setTarget(this); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) _selectedStorageIndex = CloudMan.getStorageIndex(); #else _selectedStorageIndex = 0; @@ -1318,7 +1320,7 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher) _storagePopUpDesc = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StoragePopupDesc", _("Storage:"), _("Active cloud storage")); _storagePopUp = new PopUpWidget(container, "GlobalOptions_Cloud_Container.StoragePopup"); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) Common::StringArray list = CloudMan.listStorages(); for (uint32 i = 0; i < list.size(); ++i) _storagePopUp->appendEntry(list[i], i); diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp index 4ae873229f..af02e36c13 100644 --- a/gui/saveload-dialog.cpp +++ b/gui/saveload-dialog.cpp @@ -22,7 +22,7 @@ #include "gui/saveload-dialog.h" -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) #include "backends/cloud/cloudmanager.h" #include "backends/cloud/savessyncrequest.h" #include "backends/networking/curl/connectionmanager.h" @@ -41,7 +41,7 @@ namespace GUI { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) enum { kCancelSyncCmd = 'PDCS', @@ -157,7 +157,7 @@ SaveLoadChooserDialog::SaveLoadChooserDialog(int x, int y, int w, int h, const b } SaveLoadChooserDialog::~SaveLoadChooserDialog() { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) CloudMan.setSyncTarget(nullptr); //not that dialog, at least #endif } @@ -173,7 +173,7 @@ void SaveLoadChooserDialog::open() { } void SaveLoadChooserDialog::close() { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) CloudMan.setSyncTarget(nullptr); //not that dialog, at least #endif Dialog::close(); @@ -215,7 +215,7 @@ void SaveLoadChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uin } #endif // !DISABLE_SAVELOADCHOOSER_GRID -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) 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(); @@ -225,7 +225,7 @@ void SaveLoadChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uin return Dialog::handleCommand(sender, cmd, data); } -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) void SaveLoadChooserDialog::runSaveSync(bool hasSavepathOverride) { if (!CloudMan.isSyncing()) { if (hasSavepathOverride) { @@ -240,7 +240,7 @@ void SaveLoadChooserDialog::runSaveSync(bool hasSavepathOverride) { #endif void SaveLoadChooserDialog::handleTickle() { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) if (!_dialogWasShown && CloudMan.isSyncing()) { Common::Array<Common::String> files = CloudMan.getSyncingFiles(); if (!files.empty()) { @@ -280,7 +280,7 @@ void SaveLoadChooserDialog::reflowLayout() { } void SaveLoadChooserDialog::updateSaveList() { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing g_system->getSavefileManager()->updateSavefilesList(files); #endif @@ -291,7 +291,7 @@ void SaveLoadChooserDialog::listSaves() { if (!_metaEngine) return; //very strange _saveList = _metaEngine->listSaves(_target.c_str()); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) //if there is Cloud support, add currently synced files as "locked" saves in the list if (_metaEngine->hasFeature(MetaEngine::kSimpleSavesNames)) { Common::String pattern = _target + ".###"; diff --git a/gui/saveload-dialog.h b/gui/saveload-dialog.h index fb2833355f..43721aa270 100644 --- a/gui/saveload-dialog.h +++ b/gui/saveload-dialog.h @@ -30,7 +30,7 @@ namespace GUI { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) enum SaveLoadCloudSyncProgress { kSavesSyncProgressCmd = 'SSPR', kSavesSyncEndedCmd = 'SSEN' @@ -81,7 +81,7 @@ public: virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) virtual void runSaveSync(bool hasSavepathOverride); #endif diff --git a/gui/saveload.cpp b/gui/saveload.cpp index 3072aa6082..2ac68dd8f9 100644 --- a/gui/saveload.cpp +++ b/gui/saveload.cpp @@ -87,7 +87,7 @@ int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, con if (!_impl) return -1; -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) _impl->runSaveSync(ConfMan.hasKey("savepath", target)); #endif |