diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-10-07 18:41:08 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-10-07 18:41:08 +0000 |
commit | e7a40f49fabfb003a2603b08a59f205ba1a1a478 (patch) | |
tree | e1e04e7d3ef0b5c8e04f62e4659e508cdec58cab /plugins/PluginUpdater/src/Options.cpp | |
parent | b4b974a256953c3e97a7e7b8426740e98fd4541f (diff) |
PluginUpdater:
- Fix setting custom URL ("UpdateURL" is not same as "UpdateUrl")
- Use constants for often used db setting names
- Version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@10733 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Options.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/Options.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 3a51c9ac90..f646cbdba9 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -33,7 +33,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA EnableWindow(GetDlgItem(hwndDlg, IDC_PERIODSPIN), opts.bUpdateOnPeriod);
EnableWindow(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), opts.bUpdateOnPeriod);
CheckDlgButton(hwndDlg, IDC_SILENTMODE, opts.bSilentMode);
- if (db_get_b(NULL, MODNAME, "NeedRestart", 0))
+ if (db_get_b(NULL, MODNAME, DB_SETTING_NEED_RESTART, 0))
ShowWindow(GetDlgItem(hwndDlg, IDC_NEEDRESTARTLABEL), SW_SHOW);
SendDlgItemMessage(hwndDlg, IDC_PERIODSPIN, UDM_SETRANGE, 0, MAKELONG(99, 1));
@@ -62,7 +62,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA CheckDlgButton(hwndDlg, IDC_CUSTOM, TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
- ptrT url(db_get_tsa(NULL, MODNAME, "UpdateURL"));
+ ptrT url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, (url == NULL) ? ptrT(GetDefaultUrl()) : url);
}
}
@@ -106,7 +106,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case IDC_CUSTOM:
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
{
- ptrT url(db_get_tsa(NULL, MODNAME, "UpdateURL"));
+ ptrT url(db_get_tsa(NULL, MODNAME, DB_SETTING_UPDATE_URL));
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, (url == NULL) ? ptrT(GetDefaultUrl()) : url);
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -154,30 +154,30 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA mir_forkthread(InitTimer, (void*)1);
if ( IsDlgButtonChecked(hwndDlg, IDC_STABLE)) {
- db_set_b(NULL, MODNAME, "UpdateMode", UPDATE_MODE_STABLE);
+ db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE);
opts.bForceRedownload = 0;
- db_unset(NULL, MODNAME, "ForceRedownload");
+ db_unset(NULL, MODNAME, DB_SETTING_REDOWNLOAD);
}
else if ( IsDlgButtonChecked(hwndDlg, IDC_TRUNK)) {
- db_set_b(NULL, MODNAME, "UpdateMode", UPDATE_MODE_TRUNK);
+ db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK);
opts.bForceRedownload = 0;
- db_unset(NULL, MODNAME, "ForceRedownload");
+ db_unset(NULL, MODNAME, DB_SETTING_REDOWNLOAD);
}
else if ( IsDlgButtonChecked(hwndDlg, IDC_TRUNK_SYMBOLS)) {
// Only set ForceRedownload if the previous UpdateMode was different
// to redownload all plugin with pdb files
- if(db_get_b(NULL, MODNAME, "UpdateMode", UPDATE_MODE_STABLE) != UPDATE_MODE_TRUNK_SYMBOLS) {
- db_set_b(NULL, MODNAME, "ForceRedownload", opts.bForceRedownload = 1);
- db_set_b(NULL, MODNAME, "UpdateMode", UPDATE_MODE_TRUNK_SYMBOLS);
+ if (db_get_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_STABLE) != UPDATE_MODE_TRUNK_SYMBOLS) {
+ db_set_b(NULL, MODNAME, DB_SETTING_REDOWNLOAD, opts.bForceRedownload = 1);
+ db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK_SYMBOLS);
}
}
else {
- char szUrl[100];
- GetDlgItemTextA(hwndDlg, IDC_CUSTOMURL, szUrl, SIZEOF(szUrl));
- db_set_s(NULL, MODNAME, "UpdateURL", szUrl);
- db_set_b(NULL, MODNAME, "UpdateMode", UPDATE_MODE_CUSTOM);
+ TCHAR tszUrl[100];
+ GetDlgItemText(hwndDlg, IDC_CUSTOMURL, tszUrl, SIZEOF(tszUrl));
+ db_set_ts(NULL, MODNAME, DB_SETTING_UPDATE_URL, tszUrl);
+ db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_CUSTOM);
opts.bForceRedownload = 0;
- db_unset(NULL, MODNAME, "ForceRedownload");
+ db_unset(NULL, MODNAME, DB_SETTING_REDOWNLOAD);
}
}
break;
|