summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-08-06 12:08:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-08-06 12:08:39 +0000
commit4207fda2535b6c1c1aa8e242da2de04ab40ba76b (patch)
treee3faf3288fac0cafd5ed8b60fb7824db798fa27b /plugins/PluginUpdater/src/Utils.cpp
parentda90f70ee92d2fcf13451ae40516c985f728a560 (diff)
- added "Update Icons" option;
- removed some garbage from options dialog; - modeless Apply Updates dialog git-svn-id: http://svn.miranda-ng.org/main/trunk@1377 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Utils.cpp')
-rw-r--r--plugins/PluginUpdater/src/Utils.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp
index bbce5de63d..2f1e0b17b5 100644
--- a/plugins/PluginUpdater/src/Utils.cpp
+++ b/plugins/PluginUpdater/src/Utils.cpp
@@ -22,14 +22,11 @@ Boston, MA 02111-1307, USA.
//vector<FILEINFO> Files;
BOOL DlgDld;
INT /*CurrentFile = 0,*/ Number = 0;
-BYTE Reminder, AutoUpdate;
-BYTE UpdateOnStartup, UpdateOnPeriod, OnlyOnceADay, PeriodMeasure;
-INT Period;
TCHAR tszDialogMsg[2048] = {0};
FILEINFO* pFileInfo = NULL;
//FILEURL* pFileUrl = NULL;
HANDLE CheckThread = NULL, hNetlibUser = NULL;
-MYOPTIONS MyOptions = {0};
+POPUP_OPTIONS PopupOptions = {0};
aPopups PopupsList[POPUPS];
struct
@@ -113,16 +110,18 @@ VOID InitPopupList()
VOID LoadOptions()
{
- MyOptions.DefColors = DBGetContactSettingByte(NULL, MODNAME, "DefColors", DEFAULT_COLORS);
- MyOptions.LeftClickAction= DBGetContactSettingByte(NULL, MODNAME, "LeftClickAction", DEFAULT_POPUP_LCLICK);
- MyOptions.RightClickAction = DBGetContactSettingByte(NULL, MODNAME, "RightClickAction", DEFAULT_POPUP_RCLICK);
- MyOptions.Timeout = DBGetContactSettingDword(NULL, MODNAME, "Timeout", DEFAULT_TIMEOUT_VALUE);
- UpdateOnStartup = DBGetContactSettingByte(NULL, MODNAME, "UpdateOnStartup", DEFAULT_UPDATEONSTARTUP);
- OnlyOnceADay = DBGetContactSettingByte(NULL, MODNAME, "OnlyOnceADay", DEFAULT_ONLYONCEADAY);
- UpdateOnPeriod = DBGetContactSettingByte(NULL, MODNAME, "UpdateOnPeriod", DEFAULT_UPDATEONPERIOD);
- Period = DBGetContactSettingDword(NULL, MODNAME, "Period", DEFAULT_PERIOD);
- PeriodMeasure = DBGetContactSettingByte(NULL, MODNAME, "PeriodMeasure", DEFAULT_PERIODMEASURE);
- Reminder = DBGetContactSettingByte(NULL, MODNAME, "Reminder", DEFAULT_REMINDER);
+ PopupOptions.DefColors = DBGetContactSettingByte(NULL, MODNAME, "DefColors", DEFAULT_COLORS);
+ PopupOptions.LeftClickAction= DBGetContactSettingByte(NULL, MODNAME, "LeftClickAction", DEFAULT_POPUP_LCLICK);
+ PopupOptions.RightClickAction = DBGetContactSettingByte(NULL, MODNAME, "RightClickAction", DEFAULT_POPUP_RCLICK);
+ PopupOptions.Timeout = DBGetContactSettingDword(NULL, MODNAME, "Timeout", DEFAULT_TIMEOUT_VALUE);
+
+ opts.bUpdateOnStartup = DBGetContactSettingByte(NULL, MODNAME, "UpdateOnStartup", DEFAULT_UPDATEONSTARTUP);
+ opts.bOnlyOnceADay = DBGetContactSettingByte(NULL, MODNAME, "OnlyOnceADay", DEFAULT_ONLYONCEADAY);
+ opts.bUpdateOnPeriod = DBGetContactSettingByte(NULL, MODNAME, "UpdateOnPeriod", DEFAULT_UPDATEONPERIOD);
+ opts.Period = DBGetContactSettingDword(NULL, MODNAME, "Period", DEFAULT_PERIOD);
+ opts.bPeriodMeasure = DBGetContactSettingByte(NULL, MODNAME, "PeriodMeasure", DEFAULT_PERIODMEASURE);
+ opts.bReminder = DBGetContactSettingByte(NULL, MODNAME, "Reminder", DEFAULT_REMINDER);
+ opts.bUpdateIcons = DBGetContactSettingByte(NULL, MODNAME, "UpdateIcons", DEFAULT_UPDATEICONS);
}
BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal)
@@ -181,7 +180,7 @@ VOID __stdcall RestartMe(void*)
BOOL AllowUpdateOnStartup()
{
- if (OnlyOnceADay) {
+ if (opts.bOnlyOnceADay) {
time_t now = time(NULL);
time_t was = DBGetContactSettingDword(NULL, MODNAME, "LastUpdate", 0);
@@ -218,8 +217,8 @@ VOID CALLBACK TimerAPCProc(LPVOID lpArg, DWORD dwTimerLowValue, DWORD dwTimerHig
VOID InitTimer()
{
CancelWaitableTimer(Timer);
- if (UpdateOnPeriod) {
- LONG interval = PeriodToMilliseconds(Period, PeriodMeasure);
+ if (opts.bUpdateOnPeriod) {
+ LONG interval = PeriodToMilliseconds(opts.Period, opts.bPeriodMeasure);
_int64 qwDueTime = -10000i64 * interval;