From 3de995f6736e1869fedbff7d14c210df0b9b20a9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Aug 2022 17:52:34 +0300 Subject: custom icons for UserInfo (AVS, SeenPlugin) --- plugins/SeenPlugin/src/main.cpp | 31 +++++++++++++++++++------------ plugins/SeenPlugin/src/resource.h | 1 + plugins/SeenPlugin/src/stdafx.h | 2 -- plugins/SeenPlugin/src/userinfo.cpp | 2 ++ 4 files changed, 22 insertions(+), 14 deletions(-) (limited to 'plugins/SeenPlugin/src') diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp index 6ba25a154c..1e2b114f73 100644 --- a/plugins/SeenPlugin/src/main.cpp +++ b/plugins/SeenPlugin/src/main.cpp @@ -68,6 +68,18 @@ void UninitHistoryDialog(void); ///////////////////////////////////////////////////////////////////////////////////////// +INT_PTR GetParsedFormat(WPARAM wParam, LPARAM) +{ + MCONTACT hContact = (MCONTACT)wParam; + ptrW wszStamp(g_plugin.getWStringA("MenuStamp")); + + CMStringW wszRet(ParseString(wszStamp ? wszStamp : DEFAULT_MENUSTAMP, hContact)); + + return (INT_PTR)wszRet.Detach(); +} + +///////////////////////////////////////////////////////////////////////////////////////// + static int MainInit(WPARAM, LPARAM) { if (g_bFileActive = g_plugin.getByte("FileOutput", 0)) @@ -92,8 +104,15 @@ static int OnShutdown(WPARAM, LPARAM) return 0; } +static IconItem iconList[] = +{ + { LPGEN("Clock"), "clock", IDI_CLOCK }, +}; + int CMPlugin::Load() { + registerIcon(MODULENAME, iconList); + g_pUserInfo = WindowList_Create(); g_hShutdownEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr); @@ -136,15 +155,3 @@ int CMPlugin::Unload() UninitHistoryDialog(); return 0; } - - -INT_PTR GetParsedFormat(WPARAM wParam, LPARAM) -{ - - MCONTACT hContact = (MCONTACT)wParam; - ptrW wszStamp(g_plugin.getWStringA("MenuStamp")); - - CMStringW wszRet(ParseString(wszStamp ? wszStamp : DEFAULT_MENUSTAMP, hContact)); - - return (INT_PTR)wszRet.Detach(); -} \ No newline at end of file diff --git a/plugins/SeenPlugin/src/resource.h b/plugins/SeenPlugin/src/resource.h index f3a5d84aec..f89bed3c03 100644 --- a/plugins/SeenPlugin/src/resource.h +++ b/plugins/SeenPlugin/src/resource.h @@ -8,6 +8,7 @@ #define IDD_USERDETAILS 104 #define IDD_HISTORY 105 #define IDD_POPUPS 106 +#define IDI_CLOCK 107 #define IDC_SEENMENUITEM 1000 #define IDC_MENUITEM 1001 #define IDC_UINFOTAB 1002 diff --git a/plugins/SeenPlugin/src/stdafx.h b/plugins/SeenPlugin/src/stdafx.h index 9172cce71d..61f6009db6 100644 --- a/plugins/SeenPlugin/src/stdafx.h +++ b/plugins/SeenPlugin/src/stdafx.h @@ -121,8 +121,6 @@ void ShowHistory(MCONTACT hContact, uint8_t isAlert); void InitFileOutput(void); void UninitFileOutput(void); -INT_PTR GetParsedFormat(WPARAM wParam, LPARAM lParam); - struct logthread_info { MCONTACT hContact; diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index adbe29c85c..3a4db98022 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -65,8 +65,10 @@ int UserinfoInit(WPARAM wparam, LPARAM hContact) char *szProto = Proto_GetBaseAccountName(hContact); if (IsWatchedProtocol(szProto) && !Contact::IsGroupChat(hContact, szProto)) { USERINFOPAGE uip = {}; + uip.flags = ODPF_ICON; uip.szTitle.a = LPGEN("Last seen"); uip.pDialog = new UserinfoDlg(); + uip.dwInitParam = (LPARAM)g_plugin.getIconHandle(IDI_CLOCK); g_plugin.addUserInfo(wparam, &uip); } return 0; -- cgit v1.2.3