From e7a40f49fabfb003a2603b08a59f205ba1a1a478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Tue, 7 Oct 2014 18:41:08 +0000 Subject: 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 --- plugins/PluginUpdater/src/Options.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'plugins/PluginUpdater/src/Options.cpp') 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; -- cgit v1.2.3