diff options
| author | Alexander Tkachev | 2016-07-20 15:00:44 +0600 |
|---|---|---|
| committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
| commit | b1264df120b6594a79d99cbb1cc5ef944fa2e448 (patch) | |
| tree | 7e43653a86497135e18e494ecdb2d7dc92575afe /gui | |
| parent | f743b319633dcd57ea08f5ac86d3daec548d1ab0 (diff) | |
| download | scummvm-rg350-b1264df120b6594a79d99cbb1cc5ef944fa2e448.tar.gz scummvm-rg350-b1264df120b6594a79d99cbb1cc5ef944fa2e448.tar.bz2 scummvm-rg350-b1264df120b6594a79d99cbb1cc5ef944fa2e448.zip | |
CLOUD: Check whether Storage is working when replacing it
We do that in CloudManager::replaceStorage(), but I've tried to
eliminate such possibility by adding a check in the StorageWizardDialog.
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/storagewizarddialog.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gui/storagewizarddialog.cpp b/gui/storagewizarddialog.cpp index 393b8263ef..a8574ab7d2 100644 --- a/gui/storagewizarddialog.cpp +++ b/gui/storagewizarddialog.cpp @@ -74,6 +74,29 @@ StorageWizardDialog::StorageWizardDialog(uint32 storageId): void StorageWizardDialog::open() { Dialog::open(); + + if (CloudMan.isWorking()) { + bool doClose = true; + + MessageDialog alert(_("The other Storage is working. Do you want to interrupt it?"), _("Yes"), _("No")); + if (alert.runModal() == GUI::kMessageOK) { + if (CloudMan.isDownloading()) CloudMan.cancelDownload(); + if (CloudMan.isSyncing()) CloudMan.cancelSync(); + + // I believe it still would return `true` here, but just in case + if (CloudMan.isWorking()) { + MessageDialog alert2(_("Wait until current Storage finishes up and try again.")); + alert2.runModal(); + } else + doClose = false; + } + + if (doClose) { + close(); + return; + } + } + #ifdef USE_SDL_NET _stopServerOnClose = !LocalServer.isRunning(); LocalServer.start(); |
