summaryrefslogtreecommitdiff
path: root/plugins/SeenPlugin
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-08-04 17:52:34 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-08-04 17:52:34 +0300
commit3de995f6736e1869fedbff7d14c210df0b9b20a9 (patch)
tree659c27f242e1e0bca78013849f195564e6ab145b /plugins/SeenPlugin
parent4cb450857e40d6c61f1346801c40374e7f1b0d10 (diff)
custom icons for UserInfo (AVS, SeenPlugin)
Diffstat (limited to 'plugins/SeenPlugin')
-rw-r--r--plugins/SeenPlugin/res/clock.icobin0 -> 1150 bytes
-rw-r--r--plugins/SeenPlugin/res/resource.rc8
-rw-r--r--plugins/SeenPlugin/src/main.cpp31
-rw-r--r--plugins/SeenPlugin/src/resource.h1
-rw-r--r--plugins/SeenPlugin/src/stdafx.h2
-rw-r--r--plugins/SeenPlugin/src/userinfo.cpp2
6 files changed, 30 insertions, 14 deletions
diff --git a/plugins/SeenPlugin/res/clock.ico b/plugins/SeenPlugin/res/clock.ico
new file mode 100644
index 0000000000..082058308f
--- /dev/null
+++ b/plugins/SeenPlugin/res/clock.ico
Binary files 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
@@ -46,6 +46,14 @@ END
/////////////////////////////////////////////////////////////////////////////
//
+// 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;