diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
commit | 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch) | |
tree | b1ee30b70c6e36d1a06aed6885cb80dc560a68ca /plugins/SeenPlugin/src | |
parent | f4a1bbc6ba4b8137cb868639ac146aa97e97e9df (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/SeenPlugin/src')
-rw-r--r-- | plugins/SeenPlugin/src/file.cpp | 6 | ||||
-rw-r--r-- | plugins/SeenPlugin/src/history.cpp | 4 | ||||
-rw-r--r-- | plugins/SeenPlugin/src/main.cpp | 1 | ||||
-rw-r--r-- | plugins/SeenPlugin/src/menu.cpp | 17 | ||||
-rw-r--r-- | plugins/SeenPlugin/src/options.cpp | 14 | ||||
-rw-r--r-- | plugins/SeenPlugin/src/seen.h | 4 | ||||
-rw-r--r-- | plugins/SeenPlugin/src/userinfo.cpp | 2 | ||||
-rw-r--r-- | plugins/SeenPlugin/src/utils.cpp | 22 |
8 files changed, 32 insertions, 38 deletions
diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp index 0c9fbf5372..2e78e8f5c6 100644 --- a/plugins/SeenPlugin/src/file.cpp +++ b/plugins/SeenPlugin/src/file.cpp @@ -31,7 +31,7 @@ int InitFileOutput(void) GetModuleFileName(NULL, szmpath, MAX_PATH);
DBVARIANT dbv;
- _tcscpy(szfpath, !DBGetContactSettingTString(NULL, S_MOD, "FileName", &dbv) ? dbv.ptszVal : _T(DEFAULT_FILENAME));
+ _tcscpy(szfpath, !db_get_ts(NULL, S_MOD, "FileName", &dbv) ? dbv.ptszVal : _T(DEFAULT_FILENAME));
db_free(&dbv);
if (szfpath[0] == '\\')
@@ -60,7 +60,7 @@ void FileWrite(HANDLE hcontact) TCHAR szout[1024];
DBVARIANT dbv;
- DBGetContactSettingTString(NULL, S_MOD, "PathToFile", &dbv);
+ db_get_ts(NULL, S_MOD, "PathToFile", &dbv);
_tcscpy(szout, ParseString(dbv.ptszVal, hcontact, 1));
HANDLE fhout = CreateFile(szout, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, 0, NULL);
@@ -78,7 +78,7 @@ void FileWrite(HANDLE hcontact) db_free(&dbv);
SetFilePointer(fhout,0,0,FILE_END);
- if ( !DBGetContactSettingTString(NULL, S_MOD,"FileStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD,"FileStamp", &dbv)) {
_tcscpy(szout, ParseString(dbv.ptszVal, hcontact, 1));
db_free(&dbv);
}
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 60d08bc89e..13d5b88277 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -51,7 +51,7 @@ void HistoryWrite(HANDLE hContact) TCHAR *ptszString;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, S_MOD, "HistoryStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "HistoryStamp", &dbv)) {
ptszString = ParseString(dbv.ptszVal, hContact, 0);
db_free(&dbv);
}
@@ -87,7 +87,7 @@ void LoadHistoryList(HANDLE hContact, HWND hwnd, int nList) i = (i-1+historyMax) % historyMax;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(hContact, S_MOD, BuildSetting(i), &dbv)) {
+ if ( !db_get_ts(hContact, S_MOD, BuildSetting(i), &dbv)) {
SendDlgItemMessage(hwnd, nList, LB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp index 9dd4e7ea1c..98391ee155 100644 --- a/plugins/SeenPlugin/src/main.cpp +++ b/plugins/SeenPlugin/src/main.cpp @@ -115,7 +115,6 @@ extern "C" __declspec(dllexport) int Unload(void) arContacts.destroy();
CloseHandle(g_hShutdownEvent);
- UninitMenuitem();
return 0;
}
diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index 00afddde37..7c0e2222db 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -20,7 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "seen.h"
-HANDLE hmenuitem=NULL, hLSUserDet = NULL, hBuildMenu = NULL;
+HANDLE hLSUserDet = NULL;
+HGENMENU hmenuitem = NULL;
void InitHistoryDialog(void);
@@ -47,7 +48,7 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam) cmi.hIcon = NULL;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, S_MOD, "MenuStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "MenuStamp", &dbv)) {
cmi.ptszName = ParseString(dbv.ptszVal, (HANDLE)wparam, 0);
db_free(&dbv);
}
@@ -65,13 +66,13 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam) }
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hmenuitem, (LPARAM)&cmi);
+ Menu_ModifyItem(hmenuitem, &cmi);
return 0;
}
void InitMenuitem()
{
- hLSUserDet = CreateServiceFunction("LastSeenUserDetails", MenuitemClicked);
+ CreateServiceFunction("LastSeenUserDetails", MenuitemClicked);
CLISTMENUITEM cmi = { sizeof(cmi) };
cmi.position = -0x7FFFFFFF;
@@ -80,13 +81,7 @@ void InitMenuitem() cmi.pszService = "LastSeenUserDetails";
hmenuitem = Menu_AddContactMenuItem(&cmi);
- hBuildMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU,BuildContactMenu);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU,BuildContactMenu);
InitHistoryDialog();
}
-
-void UninitMenuitem()
-{
- DestroyServiceFunction(hLSUserDet);
- UnhookEvent(hBuildMenu);
-}
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 18d5bd478f..6fa34e2a1b 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -65,13 +65,13 @@ INT_PTR CALLBACK OptsPopUpsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara EnableWindow( GetDlgItem(hdlg, i+20), hasPopups);
}
- if ( !DBGetContactSettingTString(NULL, S_MOD, "PopupStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_POPUPSTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_POPUPSTAMP, DEFAULT_POPUPSTAMP);
- if ( !DBGetContactSettingTString(NULL, S_MOD, "PopupStampText", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) {
SetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, dbv.ptszVal);
db_free(&dbv);
}
@@ -199,31 +199,31 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpa EnableWindow(GetDlgItem(hdlg, IDC_HISTORYSTAMP),IsDlgButtonChecked(hdlg, IDC_HISTORY));
EnableWindow(GetDlgItem(hdlg, IDC_COUNT),IsDlgButtonChecked(hdlg, IDC_MISSEDONES));
- if ( !DBGetContactSettingTString(NULL, S_MOD, "MenuStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "MenuStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_MENUSTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_MENUSTAMP, _T(DEFAULT_MENUSTAMP));
- if ( !DBGetContactSettingTString(NULL, S_MOD, "UserStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "UserStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_USERSTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_USERSTAMP, DEFAULT_USERSTAMP);
- if ( !DBGetContactSettingTString(NULL, S_MOD, "FileStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "FileStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_FILESTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_FILESTAMP, _T(DEFAULT_FILESTAMP));
- if ( !DBGetContactSettingTString(NULL, S_MOD, "FileName", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "FileName", &dbv)) {
SetDlgItemText(hdlg, IDC_FILENAME, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_FILENAME, _T(DEFAULT_FILENAME));
- if ( !DBGetContactSettingTString(NULL, S_MOD, "HistoryStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "HistoryStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_HISTORYSTAMP, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/SeenPlugin/src/seen.h b/plugins/SeenPlugin/src/seen.h index 1a07999868..0fb4921070 100644 --- a/plugins/SeenPlugin/src/seen.h +++ b/plugins/SeenPlugin/src/seen.h @@ -106,7 +106,6 @@ int ModeChange(WPARAM,LPARAM); void SetOffline(void);
int ModeChange_mo(WPARAM,LPARAM);
int CheckIfOnline(void);
-void UninitMenuitem();
void ShowHistory(HANDLE hContact, BYTE isAlert);
struct logthread_info
@@ -120,7 +119,8 @@ extern HINSTANCE hInstance; extern DWORD StatusColors15bits[];
extern BOOL includeIdle;
extern HANDLE ehmissed;
-extern HANDLE ehuserinfo, hmenuitem, ehmissed_proto;
+extern HANDLE ehuserinfo, ehmissed_proto;
+extern HGENMENU hmenuitem;
extern DWORD dwmirver;
extern LIST<logthread_info> arContacts;
\ No newline at end of file diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 1bc7f1c805..6205dcaa1e 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -39,7 +39,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) mir_subclassWindow( GetDlgItem(hdlg, IDC_INFOTEXT), EditProc);
{
TCHAR *szout;
- if ( !DBGetContactSettingTString(NULL, S_MOD, "UserStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "UserStamp", &dbv)) {
szout = ParseString(dbv.ptszVal, (HANDLE)lparam, 0);
db_free(&dbv);
}
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index e22fff1911..a7948c6baa 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -41,7 +41,7 @@ int IsWatchedProtocol(const char* szProto) int iProtoLen = (int)strlen(szProto);
char *szWatched;
DBVARIANT dbv;
- if ( DBGetContactSettingString(NULL, S_MOD, "WatchedProtocols", &dbv))
+ if ( db_get_s(NULL, S_MOD, "WatchedProtocols", &dbv))
szWatched = DEFAULT_WATCHEDPROTOCOLS;
else {
szWatched = NEWSTR_ALLOCA(dbv.pszVal);
@@ -261,7 +261,7 @@ LBL_charPtr: goto LBL_noData;
case 'G':
- if ( !DBGetContactSettingTString(hcontact, "CList", "Group", &dbv)) {
+ if ( !db_get_ts(hcontact, "CList", "Group", &dbv)) {
_tcscpy(szdbsetting, dbv.ptszVal);
db_free(&dbv);
charPtr = szdbsetting;
@@ -289,18 +289,18 @@ LBL_charPtr: }
else if (ci.szProto != NULL) {
if ( isYahoo(ci.szProto)) { // YAHOO support
- DBGetContactSettingTString(hcontact, ci.szProto, "id", &dbv);
+ db_get_ts(hcontact, ci.szProto, "id", &dbv);
_tcscpy(szdbsetting, dbv.ptszVal);
db_free(&dbv);
}
else if ( isJabber(ci.szProto)) { // JABBER support
- if ( DBGetContactSettingTString(hcontact, ci.szProto, "LoginName", &dbv))
+ if ( db_get_ts(hcontact, ci.szProto, "LoginName", &dbv))
goto LBL_noData;
_tcscpy(szdbsetting, dbv.ptszVal);
db_free(&dbv);
- DBGetContactSettingTString(hcontact, ci.szProto, "LoginServer", &dbv);
+ db_get_ts(hcontact, ci.szProto, "LoginServer", &dbv);
_tcscat(szdbsetting, _T("@"));
_tcscat(szdbsetting, dbv.ptszVal);
db_free(&dbv);
@@ -324,7 +324,7 @@ LBL_charPtr: goto LBL_noData;
case 'T':
- if ( DBGetContactSettingTString(hcontact, "CList", "StatusMsg", &dbv))
+ if ( db_get_ts(hcontact, "CList", "StatusMsg", &dbv))
goto LBL_noData;
d += mir_sntprintf(d, MAXSIZE-(d-sztemp), _T("%s"), dbv.ptszVal);
@@ -346,7 +346,7 @@ LBL_charPtr: case 'i':
case 'r':
if ( isJabber(ci.szProto)) {
- if ( DBGetContactSettingTString(hcontact, ci.szProto, *p == 'i' ? "Resource" : "System", &dbv))
+ if ( db_get_ts(hcontact, ci.szProto, *p == 'i' ? "Resource" : "System", &dbv))
goto LBL_noData;
_tcscpy(szdbsetting, dbv.ptszVal);
@@ -374,7 +374,7 @@ LBL_charPtr: goto LBL_charPtr;
case 'C': // Get Client Info
- if ( !DBGetContactSettingTString(hcontact, ci.szProto, "MirVer", &dbv)) {
+ if ( !db_get_ts(hcontact, ci.szProto, "MirVer", &dbv)) {
_tcscpy(szdbsetting, dbv.ptszVal);
db_free(&dbv);
}
@@ -497,13 +497,13 @@ void ShowPopup(HANDLE hcontact, const char * lpzProto, int newStatus) ppd.lchContact = hcontact;
ppd.lchIcon = LoadSkinnedProtoIcon(lpzProto, newStatus);
- if ( !DBGetContactSettingTString(NULL, S_MOD, "PopupStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) {
_tcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact, 0), MAX_CONTACTNAME);
db_free(&dbv);
}
else _tcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact, 0), MAX_CONTACTNAME);
- if ( !DBGetContactSettingTString(NULL, S_MOD, "PopupStampText", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) {
_tcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact, 0), MAX_SECONDLINE);
db_free(&dbv);
}
@@ -735,7 +735,7 @@ int ModeChange(WPARAM wparam,LPARAM lparam) short int isDbZero(HANDLE hContact, const char *module_name, const char *setting_name)
{
DBVARIANT dbv;
- if ( !DBGetContactSetting(hContact, module_name, setting_name, &dbv)) {
+ if ( !db_get(hContact, module_name, setting_name, &dbv)) {
short int res = 0;
switch (dbv.type) {
case DBVT_BYTE: res=dbv.bVal==0; break;
|