aboutsummaryrefslogtreecommitdiff
path: root/gui/updates-dialog.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2016-03-30 14:28:25 +0200
committerEugene Sandulenko2016-03-30 14:28:25 +0200
commitf58b43b38a8f13c90df41bf1202f48b551b2edd5 (patch)
treeef81ad6b4def596f298baf0ffe9946a420c27bf6 /gui/updates-dialog.cpp
parentcb51af0d6d2fccc72571149a8ff15a416ca6e701 (diff)
downloadscummvm-rg350-f58b43b38a8f13c90df41bf1202f48b551b2edd5.tar.gz
scummvm-rg350-f58b43b38a8f13c90df41bf1202f48b551b2edd5.tar.bz2
scummvm-rg350-f58b43b38a8f13c90df41bf1202f48b551b2edd5.zip
UPDATES: Beginnings of the update frequency control
Diffstat (limited to 'gui/updates-dialog.cpp')
-rw-r--r--gui/updates-dialog.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/gui/updates-dialog.cpp b/gui/updates-dialog.cpp
index 7b98e4f942..b08f317618 100644
--- a/gui/updates-dialog.cpp
+++ b/gui/updates-dialog.cpp
@@ -23,10 +23,11 @@
#include "common/str.h"
#include "common/system.h"
#include "common/translation.h"
+#include "common/updates.h"
#include "gui/updates-dialog.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
-#include "gui/widget.h"
+#include "gui/widgets/popup.h"
namespace GUI {
@@ -56,13 +57,12 @@ UpdatesDialog::UpdatesDialog() : Dialog(30, 20, 260, 124) {
// Using this, and accounting for the space the button(s) need, we can set
// the real size of the dialog
Common::Array<Common::String> lines, lines2;
- int lineCount, okButtonPos, cancelButtonPos;
int maxlineWidth = g_gui.getFont().wordWrapText(message, screenW - 2 * 20, lines);
int maxlineWidth2 = g_gui.getFont(ThemeEngine::kFontStyleTooltip).wordWrapText(message2, screenW - 2 * 20, lines2);
_w = MAX(MAX(maxlineWidth, maxlineWidth2), (2 * buttonWidth) + 10) + 20;
- lineCount = lines.size() + 1 + lines2.size();
+ int lineCount = lines.size() + 1 + lines2.size();
_h = 16;
_h += buttonHeight + 8;
@@ -86,11 +86,20 @@ UpdatesDialog::UpdatesDialog() : Dialog(30, 20, 260, 124) {
y += kLineHeight;
}
- okButtonPos = (_w - (buttonWidth * 2)) / 2;
- cancelButtonPos = ((_w - (buttonWidth * 2)) / 2) + buttonWidth + 10;
+ _updatesPopUpDesc = new StaticTextWidget(this, "GlobalOptions_Misc.UpdatesPopupDesc", _("Update check:"), _("How often to check ScummVM updates"));
+ _updatesPopUp = new PopUpWidget(this, "GlobalOptions_Misc.UpdatesPopup");
- new ButtonWidget(this, okButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, _("Yes"), 0, kYesCmd, Common::ASCII_RETURN); // Confirm dialog
- new ButtonWidget(this, cancelButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, _("No"), 0, kNoCmd, Common::ASCII_ESCAPE); // Cancel dialog
+ _updatesPopUp->appendEntry(_("Never"), Common::UpdateManager::kUpdateIntervalNotSupported);
+ _updatesPopUp->appendEntry(_("Daily"), Common::UpdateManager::kUpdateIntervalOneDay);
+ _updatesPopUp->appendEntry(_("Weekly"), Common::UpdateManager::kUpdateIntervalOneWeek);
+ _updatesPopUp->appendEntry(_("Monthly"), Common::UpdateManager::kUpdateIntervalOneMonth);
+
+
+ int yesButtonPos = (_w - (buttonWidth * 2)) / 2;
+ int noButtonPos = ((_w - (buttonWidth * 2)) / 2) + buttonWidth + 10;
+
+ new ButtonWidget(this, yesButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, _("Yes"), 0, kYesCmd, Common::ASCII_RETURN); // Confirm dialog
+ new ButtonWidget(this, noButtonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, _("No"), 0, kNoCmd, Common::ASCII_ESCAPE); // Cancel dialog
}
void UpdatesDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {