aboutsummaryrefslogtreecommitdiff
path: root/gui/updates-dialog.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2016-03-30 19:28:24 +0200
committerEugene Sandulenko2016-03-30 19:28:24 +0200
commit47985debe12a77513843f672df912d340cca5c7c (patch)
tree2c70ea9ac537f55806ec5281b70d42ea468c644a /gui/updates-dialog.cpp
parent73784c6a8488fef1ca7e6971a12868735d606de7 (diff)
downloadscummvm-rg350-47985debe12a77513843f672df912d340cca5c7c.tar.gz
scummvm-rg350-47985debe12a77513843f672df912d340cca5c7c.tar.bz2
scummvm-rg350-47985debe12a77513843f672df912d340cca5c7c.zip
UPDATES: Hook dialogs to UpdateManager
Diffstat (limited to 'gui/updates-dialog.cpp')
-rw-r--r--gui/updates-dialog.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/gui/updates-dialog.cpp b/gui/updates-dialog.cpp
index fe963e8623..56d8085c31 100644
--- a/gui/updates-dialog.cpp
+++ b/gui/updates-dialog.cpp
@@ -20,11 +20,11 @@
*
*/
-#include "common/str.h"
#include "common/system.h"
#include "common/translation.h"
#include "common/updates.h"
#include "common/config-manager.h"
+
#include "gui/updates-dialog.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
@@ -106,8 +106,10 @@ UpdatesDialog::UpdatesDialog() : Dialog(30, 20, 260, 124) {
int yesButtonPos = (_w - (buttonWidth * 2)) / 2;
int noButtonPos = ((_w - (buttonWidth * 2)) / 2) + buttonWidth + 10;
- _yesButton = new ButtonWidget(this, yesButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, _("Yes"), 0, kYesCmd, Common::ASCII_RETURN);
- _noButton = new ButtonWidget(this, noButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, _("No"), 0, kNoCmd, Common::ASCII_ESCAPE);
+ _yesButton = new ButtonWidget(this, yesButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight,
+ _("Yes"), 0, kYesCmd, Common::ASCII_RETURN);
+ _noButton = new ButtonWidget(this, noButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight,
+ _("No"), 0, kNoCmd, Common::ASCII_ESCAPE);
_state = 0;
}
@@ -125,10 +127,21 @@ void UpdatesDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
draw();
} else {
ConfMan.setInt("updates_check", _updatesPopUp->getSelectedTag());
+
+ if (g_system->getUpdateManager()) {
+ if (_updatesPopUp->getSelectedTag() == Common::UpdateManager::kUpdateIntervalNotSupported) {
+ g_system->getUpdateManager()->setAutomaticallyChecksForUpdates(Common::UpdateManager::kUpdateStateDisabled);
+ } else {
+ g_system->getUpdateManager()->setAutomaticallyChecksForUpdates(Common::UpdateManager::kUpdateStateEnabled);
+ g_system->getUpdateManager()->setUpdateCheckInterval(_updatesPopUp->getSelectedTag());
+ }
+ }
close();
}
} else if (cmd == kNoCmd) {
ConfMan.setInt("updates_check", Common::UpdateManager::kUpdateIntervalNotSupported);
+ g_system->getUpdateManager()->setAutomaticallyChecksForUpdates(Common::UpdateManager::kUpdateStateDisabled);
+
close();
} else {
Dialog::handleCommand(sender, cmd, data);