summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-10-01 12:57:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-10-01 12:57:17 +0000
commit5e64645f8c037b482c5f75d48300ccdac92ebb02 (patch)
treedb898e588007ee12614f0b42d5c6761f596624cf /plugins
parent4d52c4f9c25fd47d1ab49a5f9606395c78e7d962 (diff)
- update URL moved to the options dialog;
git-svn-id: http://svn.miranda-ng.org/main/trunk@1742 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/PluginUpdater/res/Resource.rc17
-rw-r--r--plugins/PluginUpdater/src/Common.h3
-rw-r--r--plugins/PluginUpdater/src/Options.cpp37
-rw-r--r--plugins/PluginUpdater/src/resource.h11
4 files changed, 58 insertions, 10 deletions
diff --git a/plugins/PluginUpdater/res/Resource.rc b/plugins/PluginUpdater/res/Resource.rc
index 97d9995539..e141a4935a 100644
--- a/plugins/PluginUpdater/res/Resource.rc
+++ b/plugins/PluginUpdater/res/Resource.rc
@@ -56,7 +56,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
END
-IDD_OPT_UPDATENOTIFY DIALOGEX 0, 0, 262, 92
+IDD_OPT_UPDATENOTIFY DIALOGEX 0, 0, 261, 181
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
@@ -64,7 +64,7 @@ BEGIN
GROUPBOX "Hotkey",IDC_STATIC,2,0,253,26
CONTROL "Go to Customize -> Hotkeys to change the hotkey",IDC_LINK_HOTKEY,
"Hyperlink",WS_TABSTOP,9,11,199,10
- GROUPBOX "Plugin updates options",IDC_STATIC,1,27,253,60
+ GROUPBOX "Plugin updates options",IDC_STATIC,1,29,253,61
CONTROL "On startup",IDC_UPDATEONSTARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,44,52,10
CONTROL "(but only once a day)",IDC_ONLYONCEADAY,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,92,44,161,10
CONTROL "Every",IDC_UPDATEONPERIOD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,58,52,10
@@ -72,6 +72,11 @@ BEGIN
CONTROL "",IDC_PERIODSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_DISABLED,92,56,10,15
COMBOBOX IDC_PERIODMEASURE,114,56,58,30,CBS_DROPDOWNLIST | CBS_SORT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
CONTROL "Update icons",IDC_UPDATEICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,72,198,10
+ GROUPBOX "Files source",IDC_STATIC,1,93,253,82
+ CONTROL "Stable version",IDC_STABLE,"Button",BS_AUTORADIOBUTTON,11,106,236,10
+ CONTROL "Development version (less stable)",IDC_TRUNK,"Button",BS_AUTORADIOBUTTON,11,121,236,10
+ CONTROL "Custom version",IDC_CUSTOM,"Button",BS_AUTORADIOBUTTON,11,136,236,10
+ EDITTEXT IDC_CUSTOMURL,11,150,234,16,ES_AUTOHSCROLL
END
IDD_POPUP DIALOGEX 0, 0, 316, 182
@@ -127,18 +132,18 @@ END
// TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"..\\src\\resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -166,6 +171,7 @@ BEGIN
IDD_OPT_UPDATENOTIFY, DIALOG
BEGIN
+ BOTTOMMARGIN, 180
END
IDD_POPUP, DIALOG
@@ -188,3 +194,4 @@ END
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/PluginUpdater/src/Common.h b/plugins/PluginUpdater/src/Common.h
index 110e32234d..adb92c447f 100644
--- a/plugins/PluginUpdater/src/Common.h
+++ b/plugins/PluginUpdater/src/Common.h
@@ -97,7 +97,8 @@ struct PlugOptions
#define DEFAULT_PERIOD 1
#define DEFAULT_PERIODMEASURE 1
-#define DEFAULT_UPDATE_URL "http://miranda-ng.org/distr/stable/x%platform%"
+#define DEFAULT_UPDATE_URL "http://miranda-ng.org/distr/stable/x%platform%"
+#define DEFAULT_UPDATE_URL_TRUNK "http://miranda-ng.org/distr/x%platform%"
#define IDINFO 3
#define IDDOWNLOAD 4
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp
index d710de7124..422502cbaf 100644
--- a/plugins/PluginUpdater/src/Options.cpp
+++ b/plugins/PluginUpdater/src/Options.cpp
@@ -34,6 +34,8 @@ LRESULT CALLBACK MyEditProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPara
INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
+ DBVARIANT dbv;
+
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
@@ -56,6 +58,24 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
ComboBox_SetCurSel(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), opts.bPeriodMeasure);
CheckDlgButton(hwndDlg, IDC_UPDATEICONS, opts.bUpdateIcons);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), FALSE);
+ if ( DBGetContactSettingString(NULL, MODNAME, "UpdateURL", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_CUSTOMURL, _T(DEFAULT_UPDATE_URL));
+ CheckDlgButton(hwndDlg, IDC_STABLE, TRUE);
+ }
+ else {
+ SetDlgItemTextA(hwndDlg, IDC_CUSTOMURL, dbv.pszVal);
+ if ( !strcmp(dbv.pszVal, DEFAULT_UPDATE_URL))
+ CheckDlgButton(hwndDlg, IDC_STABLE, TRUE);
+ else if ( !strcmp(dbv.pszVal, DEFAULT_UPDATE_URL_TRUNK))
+ CheckDlgButton(hwndDlg, IDC_TRUNK, TRUE);
+ else {
+ CheckDlgButton(hwndDlg, IDC_CUSTOM, TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
+ }
+ db_free(&dbv);
+ }
return TRUE;
case WM_COMMAND:
@@ -79,6 +99,13 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
}
break;
+ case IDC_TRUNK:
+ case IDC_STABLE:
+ case IDC_CUSTOM:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), IsDlgButtonChecked(hwndDlg, IDC_CUSTOM));
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
case IDC_PERIODMEASURE:
if (HIWORD(wParam) == CBN_SELCHANGE)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -127,6 +154,16 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
DBWriteContactSettingDword(NULL, MODNAME, "Period", opts.Period);
opts.bUpdateIcons = IsDlgButtonChecked(hwndDlg, IDC_UPDATEICONS);
DBWriteContactSettingByte(NULL, MODNAME, "UpdateIcons", opts.bUpdateIcons);
+
+ if ( IsDlgButtonChecked(hwndDlg, IDC_STABLE))
+ db_set_s(NULL, MODNAME, "UpdateURL", DEFAULT_UPDATE_URL);
+ else if ( IsDlgButtonChecked(hwndDlg, IDC_TRUNK))
+ db_set_s(NULL, MODNAME, "UpdateURL", DEFAULT_UPDATE_URL_TRUNK);
+ else {
+ char szUrl[100];
+ GetDlgItemTextA(hwndDlg, IDC_CUSTOMURL, szUrl, SIZEOF(szUrl));
+ db_set_s(NULL, MODNAME, "UpdateURL", szUrl);
+ }
}
break;
}
diff --git a/plugins/PluginUpdater/src/resource.h b/plugins/PluginUpdater/src/resource.h
index aa0c81abbf..2f940e3fee 100644
--- a/plugins/PluginUpdater/src/resource.h
+++ b/plugins/PluginUpdater/src/resource.h
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
-// Used by D:\Myranda\plugins\PluginUpdater\res\Resource.rc
+// Used by C:\Myranda\plugins\PluginUpdater\res\Resource.rc
//
#define IDI_MENU 101
#define IDD_UPDATE 102
@@ -48,7 +48,10 @@
#define IDC_PERIOD 1038
#define IDC_PERIODSPIN 1039
#define IDC_PERIODMEASURE 1040
-#define IDC_EDIT1 1042
+#define IDC_CUSTOMURL 1042
+#define IDC_STABLE 1043
+#define IDC_TRUNK 1044
+#define IDC_CUSTOM 1045
#define IDC_MSG_BOXES 40071
#define IDC_ERRORS 40072
#define IDC_INFO_MESSAGES 40073
@@ -63,12 +66,12 @@
#define IDC_PROGR_DLG_BG 42074
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 110
#define _APS_NEXT_COMMAND_VALUE 40075
-#define _APS_NEXT_CONTROL_VALUE 1043
+#define _APS_NEXT_CONTROL_VALUE 1044
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif