summaryrefslogtreecommitdiff
path: root/plugins/FloatingContacts
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-05 22:27:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-05 22:27:16 +0000
commit007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch)
treeb1ee30b70c6e36d1a06aed6885cb80dc560a68ca /plugins/FloatingContacts
parentf4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff)
- rest of menus cleared;
- old database macroses wiped out from all plugins (left in m_database.h for compatibility) git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FloatingContacts')
-rw-r--r--plugins/FloatingContacts/src/main.cpp39
-rw-r--r--plugins/FloatingContacts/src/options.cpp6
-rw-r--r--plugins/FloatingContacts/src/thumbs.cpp2
3 files changed, 20 insertions, 27 deletions
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp
index ba94e8fd69..ceb9c2d971 100644
--- a/plugins/FloatingContacts/src/main.cpp
+++ b/plugins/FloatingContacts/src/main.cpp
@@ -66,15 +66,14 @@ BOOL bVersionOK = FALSE;
BOOL bDockHorz = TRUE;
//UINT nStatus = 0;
HMENU hContactMenu = NULL;
-HANDLE hMenuItemRemove = NULL;
-HANDLE hMenuItemHideAll = NULL;
-HANDLE hMainMenuItemHideAll = NULL;
RECT rcScreen;
DWORD dwOfflineModes = 0;
BOOL bEnableTip = FALSE;
UINT_PTR ToTopTimerID = 0;
BOOL bIsCListShow = TRUE;
+HGENMENU hMenuItemRemove, hMenuItemHideAll, hMainMenuItemHideAll;
+
int hLangpack;
pfnSHAutoComplete fnSHAutoComplete = NULL;
@@ -226,16 +225,15 @@ static int OnContactDrop( WPARAM wParam, LPARAM lParam )
static int OnContactDragStop( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = ( HANDLE )wParam;
+ HANDLE hContact = ( HANDLE )wParam;
ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
- if ( ( pThumb != NULL ) && ( hNewContact == hContact ))
- {
+ if (pThumb != NULL && hNewContact == hContact ) {
thumbList.RemoveThumb( pThumb );
hNewContact = NULL;
}
- return( 0 );
+ return 0;
}
@@ -248,7 +246,7 @@ static int OnSkinIconsChanged( WPARAM wParam, LPARAM lParam )
for (int i = 0; i < thumbList.getCount(); ++i)
thumbList[i]->UpdateContent();
- return( 0 );
+ return 0;
}
@@ -269,10 +267,10 @@ static int OnContactSettingChanged( WPARAM wParam, LPARAM lParam )
ApplyOptionsChanges();
}
- return( 0 );
+ return 0;
}
- if ( pThumb == NULL ) return( 0 );
+ if ( pThumb == NULL ) return 0;
// Only on these 2 events we need to refresh
if ( 0 == _stricmp( pdbcws->szSetting, "Status" ))
@@ -302,7 +300,7 @@ static int OnContactSettingChanged( WPARAM wParam, LPARAM lParam )
PostMessage( pThumb->hwnd, WM_REFRESH_CONTACT, 0, idStatus );
}
- return( 0 );
+ return 0;
}
@@ -322,7 +320,7 @@ static int OnStatusModeChange( WPARAM wParam, LPARAM lParam )
// Floating status window will use this
}
- return( 0 );
+ return 0;
}
@@ -331,14 +329,9 @@ static int OnPrebuildContactMenu( WPARAM wParam, LPARAM lParam )
{
ThumbInfo *pThumb = thumbList.FindThumbByContact( (HANDLE) wParam );
- CLISTMENUITEM clmi = { sizeof(clmi) };
- clmi.flags = ( pThumb == NULL ) ? CMIM_FLAGS | CMIF_HIDDEN : CMIM_FLAGS &~CMIF_HIDDEN;
- CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemRemove, (LPARAM)&clmi );
-
- clmi.flags = fcOpt.bHideAll ? CMIM_FLAGS | CMIF_HIDDEN : CMIM_FLAGS &~CMIF_HIDDEN;
- CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemHideAll, (LPARAM)&clmi );
-
- return( 0 );
+ Menu_ShowItem(hMenuItemRemove, pThumb != NULL);
+ Menu_ShowItem(hMenuItemHideAll, !fcOpt.bHideAll);
+ return 0;
}
@@ -680,7 +673,7 @@ static void CreateBackgroundBrush()
if (db_get_b(NULL, MODULE, "BkUseBitmap", FLT_DEFAULT_BKGNDUSEBITMAP)) {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, MODULE, "BkBitmap", &dbv)) {
+ if ( !db_get_ts(NULL, MODULE, "BkBitmap", &dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
@@ -736,7 +729,7 @@ void RegHotkey( HANDLE hContact, HWND hwnd )
char szBuf[ MAX_PATH ] = {0};
DBVARIANT dbv;
- if (DBGetContactSettingString(hContact, MODULE, "Hotkey", &dbv)) return;
+ if (db_get_s(hContact, MODULE, "Hotkey", &dbv)) return;
strncpy(szBuf, dbv.pszVal, MAX_PATH - 1);
db_free( &dbv );
@@ -1021,7 +1014,7 @@ static int OnModulesLoded( WPARAM wParam, LPARAM lParam )
fcOpt.ToTopTime = (fcOpt.ToTopTime>TOTOPTIME_MAX)?TOTOPTIME_MAX:fcOpt.ToTopTime;
ToTopTimerID = SetTimer(NULL, 0, fcOpt.ToTopTime*TOTOPTIME_P, ToTopTimerProc);
}
- return( 0 );
+ return 0;
}
extern "C" int __declspec(dllexport) Load()
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp
index 4eb3cf3fd1..0ec7c56a44 100644
--- a/plugins/FloatingContacts/src/options.cpp
+++ b/plugins/FloatingContacts/src/options.cpp
@@ -180,7 +180,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
SendMessage(hwndDlg, M_REFRESHBKGBOXES, 0, 0);
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, MODULE, "BkBitmap", &dbv)) {
+ if ( !db_get_ts(NULL, MODULE, "BkBitmap", &dbv)) {
SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.ptszVal);
db_free(&dbv);
}
@@ -196,7 +196,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
fnSHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
// Windows 2K/XP
- BYTE btOpacity = (BYTE)DBGetContactSettingByte(NULL, MODULE, "Opacity", 100);
+ BYTE btOpacity = (BYTE)db_get_b(NULL, MODULE, "Opacity", 100);
SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_SETRANGE, TRUE, MAKELONG(0, 100));
SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_SETPOS, TRUE, btOpacity);
@@ -306,7 +306,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
TCHAR str[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
- DBWriteContactSettingTString(NULL, MODULE, "BkBitmap", str);
+ db_set_ts(NULL, MODULE, "BkBitmap", str);
WORD flags = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHH))
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp
index 407bf18220..c56bff0840 100644
--- a/plugins/FloatingContacts/src/thumbs.cpp
+++ b/plugins/FloatingContacts/src/thumbs.cpp
@@ -407,7 +407,7 @@ void ThumbInfo::RefreshContactStatus(int idStatus)
void ThumbInfo::DeleteContactPos()
{
- DBDeleteContactSetting( hContact, MODULE, "ThumbsPos" );
+ db_unset( hContact, MODULE, "ThumbsPos" );
}
void ThumbInfo::OnLButtonDown(int nX, int nY)