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/res/clock.ico | Bin 0 -> 1150 bytes plugins/SeenPlugin/res/resource.rc | 8 ++++++++ plugins/SeenPlugin/src/main.cpp | 31 +++++++++++++++++++------------ plugins/SeenPlugin/src/resource.h | 1 + plugins/SeenPlugin/src/stdafx.h | 2 -- plugins/SeenPlugin/src/userinfo.cpp | 2 ++ 6 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 plugins/SeenPlugin/res/clock.ico (limited to 'plugins/SeenPlugin') diff --git a/plugins/SeenPlugin/res/clock.ico b/plugins/SeenPlugin/res/clock.ico new file mode 100644 index 0000000000..082058308f Binary files /dev/null and b/plugins/SeenPlugin/res/clock.ico differ diff --git a/plugins/SeenPlugin/res/resource.rc b/plugins/SeenPlugin/res/resource.rc index 41ee25ec08..93db3c9f5f 100644 --- a/plugins/SeenPlugin/res/resource.rc +++ b/plugins/SeenPlugin/res/resource.rc @@ -44,6 +44,14 @@ END #endif // APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +IDI_CLOCK ICON "clock.ico" + + ///////////////////////////////////////////////////////////////////////////// // // Dialog 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