summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-23 21:56:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-23 21:56:20 +0000
commit037286255b6a26ed5fba94c5fe9e68b88c1755f7 (patch)
tree81508b2d8829b9757981ad5e39a1de6945859626 /plugins/UserInfoEx/src/dlg_anniversarylist.cpp
parent8110099815a7ab25ff492ba34814eb21c9640ab9 (diff)
unifoex moved to the standard db_* functions
git-svn-id: http://svn.miranda-ng.org/main/trunk@5103 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/dlg_anniversarylist.cpp')
-rw-r--r--plugins/UserInfoEx/src/dlg_anniversarylist.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
index d8637304fc..cc31b1c4c6 100644
--- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
+++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
@@ -373,17 +373,17 @@ class CAnnivList
}
// init reminder groups
- pDlg->_bRemindEnable = DB::Setting::GetByte(SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF;
+ pDlg->_bRemindEnable = db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF;
if (hCtrl = GetDlgItem(hDlg, CHECK_REMIND)) {
Button_SetCheck(hCtrl, pDlg->_bRemindEnable ? BST_INDETERMINATE : BST_UNCHECKED);
EnableWindow(hCtrl, pDlg->_bRemindEnable);
}
- CheckDlgButton(hDlg, CHECK_POPUP, DB::Setting::GetByte(SET_ANNIVLIST_POPUP, FALSE));
+ CheckDlgButton(hDlg, CHECK_POPUP, db_get_b(NULL, MODNAME, SET_ANNIVLIST_POPUP, FALSE));
// set number of days to show contact in advance
SetDlgItemInt(hDlg, EDIT_DAYS, pDlg->_filter.wDaysBefore , FALSE);
if (hCtrl = GetDlgItem(hDlg, CHECK_DAYS)) {
- Button_SetCheck(hCtrl, DB::Setting::GetByte(SET_ANNIVLIST_FILTER_DAYSENABLED, FALSE));
+ Button_SetCheck(hCtrl, db_get_b(NULL, MODNAME, SET_ANNIVLIST_FILTER_DAYSENABLED, FALSE));
DlgProc(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_DAYS, BN_CLICKED), (LPARAM)hCtrl);
}
@@ -673,7 +673,7 @@ class CAnnivList
CHAR pszSetting[MAXSETTING];
mir_snprintf(pszSetting, SIZEOF(pszSetting), "AnnivDlg_Col%d", iSubItem);
- lvc.cx = DB::Setting::GetWord(pszSetting, defaultWidth);
+ lvc.cx = db_get_w(NULL, MODNAME, pszSetting, defaultWidth);
lvc.mask = LVCF_WIDTH|LVCF_TEXT;
lvc.iSubItem = iSubItem;
lvc.pszText = TranslateTS(pszText);
@@ -816,7 +816,7 @@ class CAnnivList
MAnnivDate ad;
int i = 0;
DWORD age = 0;
- WORD wDaysBefore = DB::Setting::GetWord(SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
+ WORD wDaysBefore = db_get_w(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
WORD numMale = 0;
WORD numFemale = 0;
WORD numContacts = 0;
@@ -827,9 +827,7 @@ class CAnnivList
mtNow.GetLocalTime();
// insert the items into the list
- for (hContact = DB::Contact::FindFirst();
- hContact;
- hContact = DB::Contact::FindNext(hContact))
+ for (hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
{
// ignore meta subcontacts here, as they are not interesting.
if (!DB::MetaContact::IsSub(hContact)) {
@@ -924,8 +922,8 @@ class CAnnivList
**/
void LoadFilter()
{
- _filter.wDaysBefore = DB::Setting::GetWord(SET_ANNIVLIST_FILTER_DAYS, 9);
- _filter.bFilterIndex = DB::Setting::GetByte(SET_ANNIVLIST_FILTER_INDEX, 0);
+ _filter.wDaysBefore = db_get_w(NULL, MODNAME, SET_ANNIVLIST_FILTER_DAYS, 9);
+ _filter.bFilterIndex = db_get_b(NULL, MODNAME, SET_ANNIVLIST_FILTER_INDEX, 0);
}
/**
@@ -934,9 +932,9 @@ class CAnnivList
void SaveFilter()
{
if (_hDlg) {
- DB::Setting::WriteWord(SET_ANNIVLIST_FILTER_DAYS, (WORD)GetDlgItemInt(_hDlg, EDIT_DAYS, NULL, FALSE));
- DB::Setting::WriteByte(SET_ANNIVLIST_FILTER_DAYSENABLED, (BYTE)Button_GetCheck(GetDlgItem(_hDlg, CHECK_DAYS)));
- DB::Setting::WriteByte(SET_ANNIVLIST_FILTER_INDEX, (BYTE)ComboBox_GetCurSel(GetDlgItem(_hDlg, EDIT_DAYS)));
+ db_set_w(NULL, MODNAME, SET_ANNIVLIST_FILTER_DAYS, (WORD)GetDlgItemInt(_hDlg, EDIT_DAYS, NULL, FALSE));
+ db_set_b(NULL, MODNAME, SET_ANNIVLIST_FILTER_DAYSENABLED, (BYTE)Button_GetCheck(GetDlgItem(_hDlg, CHECK_DAYS)));
+ db_set_b(NULL, MODNAME, SET_ANNIVLIST_FILTER_INDEX, (BYTE)ComboBox_GetCurSel(GetDlgItem(_hDlg, EDIT_DAYS)));
}
}
@@ -985,12 +983,12 @@ public:
for (c = 0; c < cc; c++) {
mir_snprintf(pszSetting, MAXSETTING, "AnnivDlg_Col%d", c);
- DB::Setting::WriteWord(pszSetting, (WORD)ListView_GetColumnWidth(_hList, c));
+ db_set_w(NULL, MODNAME, pszSetting, (WORD)ListView_GetColumnWidth(_hList, c));
}
DeleteAllItems();
}
// remember popup setting
- DB::Setting::WriteByte(SET_ANNIVLIST_POPUP, (BYTE)IsDlgButtonChecked(_hDlg, CHECK_POPUP));
+ db_set_b(NULL, MODNAME, SET_ANNIVLIST_POPUP, (BYTE)IsDlgButtonChecked(_hDlg, CHECK_POPUP));
// save window position, size and column widths
Utils_SaveWindowPosition(_hDlg, NULL, MODNAME, "AnnivDlg_");
SaveFilter();
@@ -1037,7 +1035,7 @@ INT_PTR DlgAnniversaryListShow(WPARAM wParam, LPARAM lParam)
if (!gpDlg) {
try
{
- myGlobals.WantAeroAdaption = DB::Setting::GetByte(SET_PROPSHEET_AEROADAPTION, TRUE);
+ myGlobals.WantAeroAdaption = db_get_b(NULL, MODNAME, SET_PROPSHEET_AEROADAPTION, TRUE);
gpDlg = new CAnnivList();
}
catch(...)