summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Options.cpp
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/PluginUpdater/src/Options.cpp
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/PluginUpdater/src/Options.cpp')
-rw-r--r--plugins/PluginUpdater/src/Options.cpp37
1 files changed, 37 insertions, 0 deletions
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;
}