diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-09-07 12:36:33 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-09-07 12:36:33 +0000 |
commit | d267c7e3f3462693a6264029308e239de115eda5 (patch) | |
tree | 0a7978b5492a4bdba2ddac775a5b399ac03cfd1f /plugins/PluginUpdater/src/Options.cpp | |
parent | 3306ec22ce0c8c8c973371910028f1456424aec0 (diff) |
PluginUpdater: Final fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@10392 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Options.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/Options.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index aa59496ac0..cd199df741 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -45,7 +45,7 @@ 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);
- BYTE UpdateMode = db_get_b(NULL, MODNAME, "UpdateMode", UPDATE_MODE_STABLE);
+ int UpdateMode = GetUpdateMode();
if (UpdateMode == UPDATE_MODE_STABLE) {
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, _T(DEFAULT_UPDATE_URL));
CheckDlgButton(hwndDlg, IDC_STABLE, TRUE);
@@ -61,13 +61,9 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA else {
CheckDlgButton(hwndDlg, IDC_CUSTOM, TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
- DBVARIANT dbv;
- if (!db_get_s(NULL, MODNAME, "UpdateURL", &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_CUSTOMURL, dbv.pszVal);
- db_free(&dbv);
- }
- else
- SetDlgItemText(hwndDlg, IDC_CUSTOMURL, ptrT(GetDefaultUrl()));
+
+ ptrT url(db_get_tsa(NULL, MODNAME, "UpdateURL"));
+ SetDlgItemText(hwndDlg, IDC_CUSTOMURL, (url == NULL) ? ptrT(GetDefaultUrl()) : url);
}
}
return TRUE;
@@ -110,13 +106,8 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case IDC_CUSTOM:
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), TRUE);
{
- DBVARIANT dbv;
- if (!db_get_ts(NULL, MODNAME, "UpdateURL", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_CUSTOMURL, dbv.ptszVal);
- db_free(&dbv);
- }
- else
- SetDlgItemText(hwndDlg, IDC_CUSTOMURL, ptrT(GetDefaultUrl()));
+ ptrT url(db_get_tsa(NULL, MODNAME, "UpdateURL"));
+ SetDlgItemText(hwndDlg, IDC_CUSTOMURL, (url == NULL) ? ptrT(GetDefaultUrl()) : url);
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -181,7 +172,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA else if ( IsDlgButtonChecked(hwndDlg, IDC_TRUNK))
db_set_b(NULL, MODNAME, "UpdateMode", UPDATE_MODE_TRUNK);
else if ( IsDlgButtonChecked(hwndDlg, IDC_TRUNK_SYMBOLS)) {
- BYTE oldMode = db_get_b(NULL, MODNAME, "UpdateMode",0);
+ int oldMode = GetUpdateMode();
if(oldMode != UPDATE_MODE_TRUNK_SYMBOLS) {
opts.bForceRedownload = true;
db_set_b(NULL, MODNAME, "ForceRedownload", 1);
|