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 | |
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')
-rw-r--r-- | plugins/PluginUpdater/res/Resource.rc | 5 | ||||
-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 |
5 files changed, 37 insertions, 18 deletions
diff --git a/plugins/PluginUpdater/res/Resource.rc b/plugins/PluginUpdater/res/Resource.rc index 2048ecaf87..11a90b4ab9 100644 --- a/plugins/PluginUpdater/res/Resource.rc +++ b/plugins/PluginUpdater/res/Resource.rc @@ -52,7 +52,7 @@ BEGIN PUSHBUTTON "Select &none",IDC_SELNONE,175,218,60,14,NOT WS_TABSTOP
END
-IDD_OPT_UPDATENOTIFY DIALOGEX 0, 0, 273, 219
+IDD_OPT_UPDATENOTIFY DIALOGEX 0, 0, 273, 238
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
@@ -76,6 +76,7 @@ BEGIN CONTROL "Custom version",IDC_CUSTOM,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,11,150,247,10
EDITTEXT IDC_CUSTOMURL,11,164,234,16,ES_AUTOHSCROLL | WS_DISABLED
CTEXT "Some component(s) was updated.\nYou need to restart your Miranda to apply installed updates.",IDC_NEEDRESTARTLABEL,11,193,247,15,NOT WS_VISIBLE
+ LTEXT "!!! Switch to Stable version is now impossible due to incompatibility with currrent Dev version",IDC_DONTSWITCHTOSTABLE,11,214,247,19,NOT WS_VISIBLE
END
IDD_POPUP DIALOGEX 0, 0, 316, 174
@@ -176,7 +177,7 @@ BEGIN VERTGUIDE, 11
VERTGUIDE, 258
VERTGUIDE, 264
- BOTTOMMARGIN, 214
+ BOTTOMMARGIN, 233
END
IDD_POPUP, DIALOG
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
|