diff options
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_static_clui.h | 4 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_cachefuncs.cpp | 24 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcopts.cpp | 14 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcutils.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistevents.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistopts.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistsettings.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clisttray.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clui.cpp | 37 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_cluiframes.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_newrowopts.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_statusbar.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_viewmodebar.cpp | 14 |
15 files changed, 59 insertions, 76 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_static_clui.h b/plugins/Clist_modern/src/hdr/modern_static_clui.h index fb15b1e25a..ec4e3acc01 100644 --- a/plugins/Clist_modern/src/hdr/modern_static_clui.h +++ b/plugins/Clist_modern/src/hdr/modern_static_clui.h @@ -165,9 +165,7 @@ static BOOL bTransparentFocus=TRUE, bNeedFixSizingRect=FALSE, bShowEventStarted=FALSE; -static HANDLE hRenameMenuItem, - hShowAvatarMenuItem, - hHideAvatarMenuItem; +static HGENMENU hRenameMenuItem, hShowAvatarMenuItem, hHideAvatarMenuItem; static UINT uMsgGetProfile=0; diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 0c4e280d8d..14c460ed7a 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -299,7 +299,7 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus // Get XStatusName
if ( !noAwayMsg && !noXstatus && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -321,7 +321,7 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus // Get XStatusName
if ( !noAwayMsg && !noXstatus && !xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -347,7 +347,7 @@ void GetListeningTo(TCHAR *text, int text_size, ClcCacheEntry *pdnce) if (wStatus == ID_STATUS_OFFLINE || wStatus == 0)
return;
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "ListeningTo", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "ListeningTo", &dbv)) {
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
}
@@ -370,7 +370,7 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xst // Get XStatusMsg
if ( !noAwayMsg && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) {
// Try to get XStatusMsg
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -382,7 +382,7 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xst // Get StatusMsg
if (pdnce->hContact && text[0] == '\0') {
- if ( !DBGetContactSettingTString(pdnce->hContact, "CList", "StatusMsg", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, "CList", "StatusMsg", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -395,7 +395,7 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xst // Get XStatusMsg
if ( !noAwayMsg && !xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto && text[0] == '\0') {
// Try to get XStatusMsg
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -424,7 +424,7 @@ int Cache_GetLineText( DBVARIANT dbv = {0};
// Try to get XStatusMsg
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
if (dbv.ptszVal != NULL && dbv.ptszVal[0] != 0) {
TCHAR *tmp = NEWTSTR_ALLOCA(text);
mir_sntprintf(text, text_size, _T("%s: %s"), tmp, dbv.ptszVal);
@@ -439,7 +439,7 @@ int Cache_GetLineText( case TEXT_NICKNAME:
if (pdnce->hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
lstrcpyn(text, dbv.ptszVal, text_size);
db_free(&dbv);
CopySkipUnprintableChars(text, text, text_size-1);
@@ -453,7 +453,7 @@ int Cache_GetLineText( DBVARIANT dbv = {0};
// Try to get XStatusName
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
if (dbv.pszVal != NULL && dbv.pszVal[0] != 0) {
TCHAR *tmp = NEWTSTR_ALLOCA(text);
mir_sntprintf(text, text_size, _T("%s: %s"), dbv.pszVal, tmp);
@@ -465,7 +465,7 @@ int Cache_GetLineText( else if (use_name_and_message_for_xstatus && xstatus_has_priority) {
DBVARIANT dbv = {0};
// Try to get XStatusName
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
if (dbv.pszVal != NULL && dbv.pszVal[0] != 0)
mir_sntprintf(text, text_size, _T("%s"), dbv.pszVal);
CopySkipUnprintableChars(text, text, text_size-1);
@@ -525,7 +525,7 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) TCHAR *name = pcli->pfnGetContactDisplayName(contact->hContact,0);
if (dat->first_line_append_nick && (!dat->force_in_dialog)) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
TCHAR nick[SIZEOF(contact->szText)];
lstrcpyn(nick, dbv.ptszVal, SIZEOF(contact->szText));
db_free(&dbv);
@@ -856,7 +856,7 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact) contact->avatar_pos = AVATAR_POS_DONT_HAVE;
if (dat->avatars_show && !db_get_b(contact->hContact, "CList", "HideContactAvatar", 0)) {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(contact->hContact, "ContactPhoto", "File", &dbv)) {
+ if ( !db_get_ts(contact->hContact, "ContactPhoto", "File", &dbv)) {
HBITMAP hBmp = (HBITMAP) CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
if (hBmp != NULL) {
// Make bounds
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index fc2edc9c7a..e01d9be1bc 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1842,7 +1842,7 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) }
else
{
- //DBDeleteContactSetting(ack->hContact,"CList","StatusMsg");
+ //db_unset(ack->hContact,"CList","StatusMsg");
//char a = '\0';
{//Do not change DB if it is IRC protocol
if (ack->szModule != NULL)
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 08ced8922c..753a8f0682 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -735,7 +735,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, ClcDa filterResult = strstr(g_CluiData.protoFilter, szTemp) ? 1 : 0;
}
if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
- if ( !DBGetContactSettingTString(hContact, "CList", "Group", &dbv)) {
+ if ( !db_get_ts(hContact, "CList", "Group", &dbv)) {
mir_sntprintf(szGroupMask, SIZEOF(szGroupMask), _T("%s|"), &dbv.ptszVal[0]);
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
mir_free(dbv.ptszVal);
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 4dd2d44ec8..7cf0c32840 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -583,12 +583,12 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w CheckDlgButton(hwndDlg,IDC_BITMAP,db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)?BST_CHECKED:BST_UNCHECKED);
SendMessage(hwndDlg,WM_USER+10, 0, 0);
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_BKCOLOUR);
- // SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR));
+ // SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR, 0, db_get_dw(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR));
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR, 0, db_get_dw(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
{
DBVARIANT dbv;
- if ( !DBGetContactSettingString(NULL, "StatusBar", "BkBitmap", &dbv)) {
+ if ( !db_get_s(NULL, "StatusBar", "BkBitmap", &dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
char szPath[MAX_PATH];
@@ -1211,7 +1211,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP {
DBVARIANT dbv = {0};
TCHAR *s;
- if ( !DBGetContactSettingTString(NULL,"CList","TitleText",&dbv))
+ if ( !db_get_ts(NULL,"CList","TitleText",&dbv))
s = dbv.ptszVal;
else
s = _T(MIRANDANAME);
@@ -1224,17 +1224,17 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP sprintf(szUin,"%u",db_get_dw(NULL,"ICQ","UIN",0));
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING, 0, (LPARAM)szUin);
- if ( !DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
+ if ( !db_get_s(NULL,"ICQ","Nick",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
dbv.pszVal = NULL;
}
- if ( !DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
+ if ( !db_get_s(NULL,"ICQ","FirstName",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
dbv.pszVal = NULL;
}
- if ( !DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
+ if ( !db_get_s(NULL,"ICQ","e-mail",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
dbv.pszVal = NULL;
@@ -1494,7 +1494,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, dat->item[indx].useWinColours = db_get_b(NULL,module, "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
{
DBVARIANT dbv;
- if ( !DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
+ if ( !db_get_s(NULL,module,"BkBitmap",&dbv))
{
int retval = PathToAbsolute(dbv.pszVal, dat->item[indx].filename);
if ( !retval || retval == CALLSERVICE_NOTFOUND)
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 63a30b58de..037143b7d6 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -629,7 +629,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(NULL, "CList","SecondLineText", &dbv))
+ if ( !db_get_ts(NULL, "CList","SecondLineText", &dbv))
{
lstrcpyn(dat->second_line_text, dbv.ptszVal, SIZEOF(dat->second_line_text)-1);
dat->second_line_text[SIZEOF(dat->second_line_text)-1] = _T('\0');
@@ -667,7 +667,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(NULL, "CList","ThirdLineText", &dbv))
+ if ( !db_get_ts(NULL, "CList","ThirdLineText", &dbv))
{
lstrcpyn(dat->third_line_text, dbv.ptszVal, SIZEOF(dat->third_line_text)-1);
dat->third_line_text[SIZEOF(dat->third_line_text)-1] = _T('\0');
@@ -721,7 +721,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) {
if ( db_get_b(NULL,"CLC","UseBitmap",CLCDEFAULT_USEBITMAP))
{
- if ( !DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv))
+ if ( !db_get_s(NULL,"CLC","BkBitmap",&dbv))
{
dat->hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
@@ -737,7 +737,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) dat->MenuTextHiColor = sttGetColor("Menu","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR);
if ( db_get_b(NULL,"Menu","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL,"Menu","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"Menu","BkBitmap",&dbv)) {
dat->hMenuBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index c335c32bbc..7778b24724 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -278,7 +278,7 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
event_area.bkColour = sttGetColor("EventArea","BkColour",CLCDEFAULT_BKCOLOUR);
if ( db_get_b(NULL,"EventArea","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL,"EventArea","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"EventArea","BkBitmap",&dbv)) {
event_area.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index 7d18bd4c34..ec7a3bdb85 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -529,7 +529,7 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_RTL, db_get_b(NULL,"CList","TextRTL",SETTING_TEXT_RTL_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- //TODO: init IDC_ALIGNGROUPCOMBO from DBGetContactSettingByte(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
+ //TODO: init IDC_ALIGNGROUPCOMBO from db_get_b(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
{
int item;
TCHAR *align[] = {LPGENT("Left align group names"), LPGENT("Center group names"), LPGENT("Right align group names")};
@@ -575,7 +575,7 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
db_set_b(NULL,"CList","TextRTL", (BYTE)IsDlgButtonChecked(hwndDlg,IDC_RTL));
- //TODO: Store IDC_ALIGNGROUPCOMBO at DBGetContactSettingByte(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
+ //TODO: Store IDC_ALIGNGROUPCOMBO at db_get_b(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
db_set_b(NULL,"CList","AlignGroupCaptions",(BYTE)SendDlgItemMessage(hwndDlg,IDC_ALIGNGROUPCOMBO,CB_GETCURSEL, 0, 0));
db_set_b(NULL,"CList","TextAlignToRight", (BYTE)IsDlgButtonChecked(hwndDlg,IDC_ALIGN_RIGHT));
db_set_b(NULL,"CList","TextReplaceSmileys", (BYTE)IsDlgButtonChecked(hwndDlg,IDC_REPLACE_SMILEYS));
@@ -610,7 +610,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL,"CList","SecondLineDrawSmileys",SETTING_SECONDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "CList","SecondLineText", &dbv)) {
+ if ( !db_get_ts(NULL, "CList","SecondLineText", &dbv)) {
SetWindowText(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT), dbv.ptszVal);
db_free(&dbv);
}
@@ -786,7 +786,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL,"CList","ThirdLineDrawSmileys",SETTING_THIRDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "CList","ThirdLineText", &dbv)) {
+ if ( !db_get_ts(NULL, "CList","ThirdLineText", &dbv)) {
SetWindowText(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT), dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index dd241971ee..7d2c965705 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -251,7 +251,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) if (pdnce->tszGroup == NULL) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(pdnce->hContact,"CList","Group",&dbv)) {
+ if ( !db_get_ts(pdnce->hContact,"CList","Group",&dbv)) {
pdnce->tszGroup = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 9a4525ad1f..b4339c7720 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -196,7 +196,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto) if ( db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE &&
db_get_b(NULL,"CList","AlwaysPrimary",SETTING_ALWAYSPRIMARY_DEFAULT))
{
- if ( !DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv)) {
+ if ( !db_get_s(NULL,"CList","PrimaryStatus",&dbv)) {
szProto = NEWSTR_ALLOCA(dbv.pszVal);
db_free(&dbv);
}
@@ -209,7 +209,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto) switch( db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT)) {
case SETTING_TRAYICON_SINGLE:
{
- if ( !DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv)) {
+ if ( !db_get_s(NULL,"CList","PrimaryStatus",&dbv)) {
szProto = NEWSTR_ALLOCA(dbv.pszVal);
db_free(&dbv);
}
@@ -330,7 +330,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto) }
else if (status >= ID_STATUS_OFFLINE && status <= ID_STATUS_IDLE)
{
- if (DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv))
+ if (db_get_s(NULL,"CList","PrimaryStatus",&dbv))
szProto = NULL;
else
szProto = dbv.pszVal;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 012fea9575..3ab3bafa9e 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -107,18 +107,12 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) if ( lstrcmp( _T(CLISTCONTROL_CLASS), cls))
hwndClist = pcli->hwndContactList;
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
- if ( !hItem)
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hRenameMenuItem, (LPARAM)&mi);
+ Menu_ShowItem(hRenameMenuItem, hItem != 0);
if ( !hItem || !IsHContactContact(hItem) || !db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT)) {
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowAvatarMenuItem, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideAvatarMenuItem, (LPARAM)&mi);
+ Menu_ShowItem(hShowAvatarMenuItem, false);
+ Menu_ShowItem(hHideAvatarMenuItem, false);
}
else {
int has_avatar;
@@ -126,8 +120,8 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) if ( ServiceExists(MS_AV_GETAVATARBITMAP))
has_avatar = CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hItem, 0);
else {
- DBVARIANT dbv = {0};
- if ( DBGetContactSettingTString(hItem, "ContactPhoto", "File", &dbv))
+ DBVARIANT dbv;
+ if ( db_get_ts(hItem, "ContactPhoto", "File", &dbv))
has_avatar = 0;
else {
has_avatar = 1;
@@ -135,18 +129,9 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) }
}
- if ( db_get_b(hItem, "CList", "HideContactAvatar", 0)) {
- mi.flags = CMIM_FLAGS | (has_avatar ? 0 : CMIF_GRAYED);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowAvatarMenuItem, (LPARAM)&mi);
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideAvatarMenuItem, (LPARAM)&mi);
- }
- else {
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowAvatarMenuItem, (LPARAM)&mi);
- mi.flags = CMIM_FLAGS | (has_avatar ? 0 : CMIF_GRAYED);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideAvatarMenuItem, (LPARAM)&mi);
- }
+ bool bHideAvatar = db_get_b(hItem, "CList", "HideContactAvatar", 0) != 0;
+ Menu_ShowItem(hShowAvatarMenuItem, bHideAvatar);
+ Menu_ShowItem(hHideAvatarMenuItem, !bHideAvatar);
}
return 0;
@@ -641,7 +626,7 @@ void CLUI_ChangeWindowMode() //4- Set Title
TCHAR titleText[255] = {0};
DBVARIANT dbv;
- if ( DBGetContactSettingTString(NULL, "CList", "TitleText", &dbv))
+ if ( db_get_ts(NULL, "CList", "TitleText", &dbv))
lstrcpyn(titleText,_T(MIRANDANAME),SIZEOF(titleText));
else {
lstrcpyn(titleText,dbv.ptszVal,SIZEOF(titleText));
@@ -1003,7 +988,7 @@ static int CLUI_CreateTimerForConnectingIcon(WPARAM wParam,LPARAM lParam) KillTimer(pcli->hwndContactList,TM_STATUSBARUPDATE+pt->nIndex);
int cnt = CLUI_GetConnectingIconForProtoCount(szProto);
if (cnt != 0) {
- nAnimatedIconStep = 100;/*DBGetContactSettingWord(NULL,"CLUI","DefaultStepConnectingIcon",100);*/
+ nAnimatedIconStep = 100;/*db_get_w(NULL,"CLUI","DefaultStepConnectingIcon",100);*/
pt->nIconsCount = cnt;
if (pt->himlIconList)
ImageList_Destroy(pt->himlIconList);
@@ -1296,7 +1281,7 @@ int CLUI_TestCursorOnBorders() if (g_bTransparentFlag) {
if ( !bTransparentFocus && gf != hwnd) {
CLUI_SmoothAlphaTransition(hwnd, db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1);
- //g_proc_SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ //g_proc_SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
bTransparentFocus = 1;
CLUI_SafeSetTimer(hwnd, TM_AUTOALPHA,250, NULL);
}
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp index 56357fb542..ff162fc7f7 100644 --- a/plugins/Clist_modern/src/modern_cluiframes.cpp +++ b/plugins/Clist_modern/src/modern_cluiframes.cpp @@ -672,7 +672,7 @@ static int DBLoadFrameSettingsAtPos(int pos,int Frameid) _itoa(pos,sadd,10);
- //DBWriteContactSettingString(0, CLUIFrameModule,strcat("Name",sadd),Frames[Frameid].name);
+ //db_set_s(0, CLUIFrameModule,strcat("Name",sadd),Frames[Frameid].name);
//bool
g_pfwFrames[Frameid].collapsed = db_get_b(0, CLUIFrameModule,AS(buf,"Collapse",sadd),g_pfwFrames[Frameid].collapsed);
@@ -735,7 +735,7 @@ static int LocateStorePosition(int Frameid,int maxstored) for (int i=0; i < maxstored; i++) {
mir_snprintf(settingname,SIZEOF(settingname),"Name%d",i);
DBVARIANT dbv = {0};
- if ( DBGetContactSettingTString( NULL, CLUIFrameModule, settingname, &dbv ))
+ if ( db_get_ts( NULL, CLUIFrameModule, settingname, &dbv ))
continue;
if ( lstrcmpi(dbv.ptszVal, g_pfwFrames[Frameid].Name) == 0) {
@@ -2600,7 +2600,7 @@ int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam) }
- //if (DBGetContactSettingByte(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT))GetWindowRect(pcli->hwndStatus,&rcStatus);
+ //if (db_get_b(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT))GetWindowRect(pcli->hwndStatus,&rcStatus);
//else rcStatus.top = rcStatus.bottom = 0;
// nRect.top--;
/* $$$ rcStatus.top = rcStatus.bottom = 0;
@@ -2663,7 +2663,7 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam) if (g_CluiData.fDisableSkinEngine)
{
if ( db_get_b(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_newrowopts.cpp b/plugins/Clist_modern/src/modern_newrowopts.cpp index 3cbb3fc197..7e5d9533cc 100644 --- a/plugins/Clist_modern/src/modern_newrowopts.cpp +++ b/plugins/Clist_modern/src/modern_newrowopts.cpp @@ -173,7 +173,7 @@ BOOL CALLBACK DlgProcItemNewRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (RemoveNode(res1)) res1 = 0;
TRACE("*********** Nodes DUMP 2 ***********\n");
TraceTreeLevel(RootNode);
- //CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, DBGetContactSettingByte(NULL,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
+ //CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, db_get_b(NULL,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
MessageBox(hwndDlg,_T("Init NewRow Dialog"),_T("Notify"),MB_OK);
break;
}
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 8cf08c44d8..496c18ffd4 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -119,7 +119,7 @@ int LoadStatusBarData() DBVARIANT dbv;
g_StatusBarData.bkColour = sttGetColor("StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
if ( db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"StatusBar","BkBitmap",&dbv)) {
g_StatusBarData.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 8b7598c66e..592320f7c9 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -261,7 +261,7 @@ static int FillDialog(HWND hwnd) for (i=0;;i++)
{
mir_snprintf(buf, 20, "%d", i);
- if (DBGetContactSettingTString(NULL, "CListGroups", buf, &dbv))
+ if (db_get_ts(NULL, "CListGroups", buf, &dbv))
break;
item.pszText = &dbv.ptszVal[1];
@@ -557,10 +557,10 @@ static void UpdateFilters() mir_sntprintf(szTemp, 100, TranslateT("Configuring view mode: %s"), szTempBuf);
SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
mir_snprintf(szSetting, 128, "%c%s_PF", 246, szBuf);
- if (DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv_pf))
+ if (db_get_s(NULL, CLVM_MODULE, szSetting, &dbv_pf))
goto cleanup;
mir_snprintf(szSetting, 128, "%c%s_GF", 246, szBuf);
- if (DBGetContactSettingTString(NULL, CLVM_MODULE, szSetting, &dbv_gf))
+ if (db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv_gf))
goto cleanup;
mir_snprintf(szSetting, 128, "%c%s_OPT", 246, szBuf);
if ((opt = db_get_dw(NULL, CLVM_MODULE, szSetting, -1)) != -1)
@@ -1275,7 +1275,7 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
view_mode.bkColour = sttGetColor("ViewMode","BkColour",CLCDEFAULT_BKCOLOUR);
if ( db_get_b(NULL,"ViewMode","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL,"ViewMode","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"ViewMode","BkBitmap",&dbv)) {
view_mode.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
@@ -1341,7 +1341,7 @@ void ApplyViewMode(const char *Name, bool onlySelector ) if ( !name) // Name is null - apply last stored view mode
{
- if ( !DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv))
+ if ( !db_get_s(NULL, CLVM_MODULE, szSetting, &dbv))
{
name = (char*)_alloca(strlen(dbv.pszVal)+1);
strcpy(name,dbv.pszVal);
@@ -1378,7 +1378,7 @@ void ApplyViewMode(const char *Name, bool onlySelector ) if ( !onlySelector )
{
mir_snprintf(szSetting, 256, "%c%s_PF", 246, name);
- if ( !DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if ( !db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (lstrlenA(dbv.pszVal) >= 2)
{
strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter));
@@ -1388,7 +1388,7 @@ void ApplyViewMode(const char *Name, bool onlySelector ) mir_free(dbv.pszVal);
}
mir_snprintf(szSetting, 256, "%c%s_GF", 246, name);
- if ( !DBGetContactSettingTString(NULL, CLVM_MODULE, szSetting, &dbv))
+ if ( !db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv))
{
if (lstrlen(dbv.ptszVal) >= 2)
{
|