diff options
-rw-r--r-- | gui/downloaddialog.cpp | 18 | ||||
-rw-r--r-- | gui/downloaddialog.h | 2 |
2 files changed, 8 insertions, 12 deletions
diff --git a/gui/downloaddialog.cpp b/gui/downloaddialog.cpp index 001a058205..1d838f142c 100644 --- a/gui/downloaddialog.cpp +++ b/gui/downloaddialog.cpp @@ -40,7 +40,7 @@ enum { }; DownloadDialog::DownloadDialog(uint32 storageId): - Dialog("GlobalOptions_Cloud_DownloadDialog"), _close(false), _redraw(false) { + Dialog("GlobalOptions_Cloud_DownloadDialog"), _close(false) { _backgroundType = GUI::ThemeEngine::kDialogBackgroundPlain; _browser = new BrowserDialog(_("Select directory where to download game data"), true); @@ -72,6 +72,7 @@ DownloadDialog::~DownloadDialog() { void DownloadDialog::open() { Dialog::open(); + CloudMan.setDownloadTarget(this); if (!CloudMan.isDownloading()) if (!selectDirectories()) close(); @@ -92,10 +93,11 @@ void DownloadDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat close(); break; } - case kDownloadProgressCmd: - _percentLabel->setLabel(Common::String::format("%u %%", data)); - _progressBar->setValue(data); - _redraw = true; + case kDownloadProgressCmd: + if (!_close) { + refreshWidgets(); + draw(); + } break; case kDownloadEndedCmd: _close = true; @@ -169,12 +171,6 @@ void DownloadDialog::handleTickle() { return; } - if (_redraw) { - refreshWidgets(); - draw(); - _redraw = false; - } - Dialog::handleTickle(); } diff --git a/gui/downloaddialog.h b/gui/downloaddialog.h index baa3f153e6..39c4cea2e4 100644 --- a/gui/downloaddialog.h +++ b/gui/downloaddialog.h @@ -54,7 +54,7 @@ class DownloadDialog : public Dialog { ButtonWidget *_closeButton; Common::String _localDirectory; - bool _close, _redraw; + bool _close; void refreshWidgets(); bool selectDirectories(); |