diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-10-16 19:31:17 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-10-16 19:31:17 +0000 |
commit | 41772bfd42d7d1093bea6f84e69124450955bfe4 (patch) | |
tree | f6d4c021154aa6571bbfd838fb7657233aa4e6de /plugins/PluginUpdater/src | |
parent | 6659df4294af249406663de7a43745b30b8a7a61 (diff) |
added ability to lock update from dev version to stable
git-svn-id: http://svn.miranda-ng.org/main/trunk@10801 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src')
-rw-r--r-- | plugins/PluginUpdater/src/Common.h | 1 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/Options.cpp | 8 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/Utils.cpp | 38 | ||||
-rw-r--r-- | plugins/PluginUpdater/src/resource.h | 3 |
4 files changed, 34 insertions, 16 deletions
diff --git a/plugins/PluginUpdater/src/Common.h b/plugins/PluginUpdater/src/Common.h index 7b700ae3f0..78ce570d65 100644 --- a/plugins/PluginUpdater/src/Common.h +++ b/plugins/PluginUpdater/src/Common.h @@ -127,6 +127,7 @@ struct PlugOptions #define DB_SETTING_NEED_RESTART "NeedRestart"
#define DB_SETTING_RESTART_COUNT "RestartCount"
#define DB_SETTING_LAST_UPDATE "LastUpdate"
+#define DB_SETTING_DONT_SWITCH_TO_STABLE "DontSwitchToStable"
#define DB_MODULE_FILES MODNAME "Files"
#define MAX_RETRIES 3
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index f646cbdba9..b39b000bf8 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -45,7 +45,13 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ComboBox_InsertString(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), 1, TranslateT("days"));
ComboBox_SetCurSel(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), opts.bPeriodMeasure);
- switch(GetUpdateMode()) {
+ if (db_get_b(NULL, MODNAME, DB_SETTING_DONT_SWITCH_TO_STABLE, 0)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STABLE), FALSE);
+ db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_DONTSWITCHTOSTABLE), SW_SHOW);
+ }
+
+ switch (GetUpdateMode()) {
case UPDATE_MODE_STABLE:
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, _T(DEFAULT_UPDATE_URL));
CheckDlgButton(hwndDlg, IDC_STABLE, TRUE);
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 15b50d05ae..fb24329b92 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -246,21 +246,31 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes) char str[200];
while(fgets(str, SIZEOF(str), fp) != NULL) {
rtrim(str);
- Netlib_Logf(hNetlibUser,"Update: %s", str);
- char *p = strchr(str, ' ');
- if (p != NULL) {
- *p++ = 0;
- _strlwr(p);
-
- int dwCrc32;
- char *p1 = strchr(p, ' ');
- if (p1 == NULL)
- dwCrc32 = 0;
- else {
- *p1++ = 0;
- sscanf(p1, "%08x", &dwCrc32);
+ if (str[0] == ';') {
+ db_unset(NULL, MODNAME, DB_SETTING_DONT_SWITCH_TO_STABLE);
+ continue;
+ }
+ if (!strcmp(str, "DoNotSwitchToStable")) {
+ db_set_b(NULL, MODNAME, DB_SETTING_DONT_SWITCH_TO_STABLE, 1);
+ db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
+ }
+ else {
+ Netlib_Logf(hNetlibUser, "Update: %s", str);
+ char *p = strchr(str, ' ');
+ if (p != NULL) {
+ *p++ = 0;
+ _strlwr(p);
+
+ int dwCrc32;
+ char *p1 = strchr(p, ' ');
+ if (p1 == NULL)
+ dwCrc32 = 0;
+ else {
+ *p1++ = 0;
+ sscanf(p1, "%08x", &dwCrc32);
+ }
+ arHashes.insert(new ServListEntry(str, p, dwCrc32));
}
- arHashes.insert(new ServListEntry(str, p, dwCrc32));
}
}
fclose(fp);
diff --git a/plugins/PluginUpdater/src/resource.h b/plugins/PluginUpdater/src/resource.h index 6a8dbd2979..d4461bd62a 100644 --- a/plugins/PluginUpdater/src/resource.h +++ b/plugins/PluginUpdater/src/resource.h @@ -49,6 +49,7 @@ #define IDC_CUSTOM 1046
#define IDC_SILENTMODE 1047
#define IDC_NEEDRESTARTLABEL 1048
+#define IDC_DONTSWITCHTOSTABLE 1049
#define IDC_MSG_BOXES 40071
#define IDC_ERRORS 40072
#define IDC_INFO_MESSAGES 40073
@@ -68,7 +69,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 117
#define _APS_NEXT_COMMAND_VALUE 40075
-#define _APS_NEXT_CONTROL_VALUE 1049
+#define _APS_NEXT_CONTROL_VALUE 1050
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|