aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-07 19:52:36 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit62a640ff440919ae762072a6e6acea415f0957dd (patch)
tree21087cbd99cdf61deb2f29e9ecaa845ea829aacb
parentab1d160ec8f99e472667b83aa4bdd7697b702f3a (diff)
downloadscummvm-rg350-62a640ff440919ae762072a6e6acea415f0957dd.tar.gz
scummvm-rg350-62a640ff440919ae762072a6e6acea415f0957dd.tar.bz2
scummvm-rg350-62a640ff440919ae762072a6e6acea415f0957dd.zip
GUI: Disable "Run in background" for "difficult" engines
During saves sync slots of MetaEngines with simpleSaveNames() == false would not be available at all. User would have to wait for sync to complete.
-rw-r--r--gui/saveload-dialog.cpp8
-rw-r--r--gui/saveload-dialog.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index 0dde1a4060..3ac6074bf8 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -44,7 +44,7 @@ enum {
kBackgroundSyncCmd = 'PDBS'
};
-SaveLoadCloudSyncProgressDialog::SaveLoadCloudSyncProgressDialog(): Dialog("SaveLoadCloudSyncProgress"), _close(false) {
+SaveLoadCloudSyncProgressDialog::SaveLoadCloudSyncProgressDialog(bool canRunInBackground): Dialog("SaveLoadCloudSyncProgress"), _close(false) {
_label = new StaticTextWidget(this, "SaveLoadCloudSyncProgress.TitleText", "Downloading saves...");
uint32 progress = (uint32)(100 * CloudMan.getSyncDownloadingProgress());
_progressBar = new SliderWidget(this, "SaveLoadCloudSyncProgress.ProgressBar");
@@ -54,7 +54,9 @@ SaveLoadCloudSyncProgressDialog::SaveLoadCloudSyncProgressDialog(): Dialog("Save
_progressBar->setEnabled(false);
_percentLabel = new StaticTextWidget(this, "SaveLoadCloudSyncProgress.PercentText", Common::String::format("%u %%", progress));
new ButtonWidget(this, "SaveLoadCloudSyncProgress.Cancel", "Cancel", 0, kCancelSyncCmd, Common::ASCII_ESCAPE); // Cancel dialog
- new ButtonWidget(this, "SaveLoadCloudSyncProgress.Background", "Run in background", 0, kBackgroundSyncCmd, Common::ASCII_RETURN); // Confirm dialog
+ ButtonWidget *backgroundButton = new ButtonWidget(this, "SaveLoadCloudSyncProgress.Background", "Run in background", 0, kBackgroundSyncCmd, Common::ASCII_RETURN); // Confirm dialog
+ backgroundButton->setEnabled(canRunInBackground);
+ draw();
}
SaveLoadCloudSyncProgressDialog::~SaveLoadCloudSyncProgressDialog() {
@@ -223,7 +225,7 @@ void SaveLoadChooserDialog::handleTickle() {
Common::Array<Common::String> files = CloudMan.getSyncingFiles();
if (!files.empty()) {
{
- SaveLoadCloudSyncProgressDialog dialog;
+ SaveLoadCloudSyncProgressDialog dialog(_metaEngine ? _metaEngine->simpleSaveNames() : false);
CloudMan.setSyncTarget(&dialog);
int result = dialog.runModal();
if (result == kCancelSyncCmd) {
diff --git a/gui/saveload-dialog.h b/gui/saveload-dialog.h
index 3f2c5dfdc3..890169c99a 100644
--- a/gui/saveload-dialog.h
+++ b/gui/saveload-dialog.h
@@ -40,7 +40,7 @@ class SaveLoadCloudSyncProgressDialog : public Dialog { //protected?
SliderWidget *_progressBar;
bool _close;
public:
- SaveLoadCloudSyncProgressDialog();
+ SaveLoadCloudSyncProgressDialog(bool canRunInBackground);
virtual ~SaveLoadCloudSyncProgressDialog();
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);