From c4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Dec 2012 18:19:49 +0000 Subject: new easy standard way of registering icons: Icon_Register git-svn-id: http://svn.miranda-ng.org/main/trunk@2601 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Ping/src/utils.cpp | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) (limited to 'plugins/Ping/src') diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 22b8b2e63d..28200aa85c 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -315,38 +315,17 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam) return 0; } +static IconItem iconList[] = +{ + { LPGEN("Responding"), "ping_responding", IDI_ICON_RESPONDING }, + { LPGEN("Not Responding"), "ping_not_responding", IDI_ICON_NOTRESPONDING }, + { LPGEN("Testing"), "ping_testing", IDI_ICON_TESTING }, + { LPGEN("Disabled"), "ping_disabled", IDI_ICON_DISABLED }, +}; + void InitUtils() { - TCHAR file[MAX_PATH]; - GetModuleFileName(hInst,file,MAX_PATH); - - SKINICONDESC sid = { sizeof(sid) }; - sid.ptszSection = LPGENT("Ping"); - sid.flags = SIDF_PATH_TCHAR; - - sid.pszDescription = LPGEN("Responding"); - sid.pszName = "ping_responding"; - sid.ptszDefaultFile = file; - sid.iDefaultIndex = -IDI_ICON_RESPONDING; - Skin_AddIcon(&sid); - - sid.pszDescription = LPGEN("Not Responding"); - sid.pszName = "ping_not_responding"; - sid.ptszDefaultFile = file; - sid.iDefaultIndex = -IDI_ICON_NOTRESPONDING; - Skin_AddIcon(&sid); - - sid.pszDescription = LPGEN("Testing"); - sid.pszName = "ping_testing"; - sid.ptszDefaultFile = file; - sid.iDefaultIndex = -IDI_ICON_TESTING; - Skin_AddIcon(&sid); - - sid.pszDescription = LPGEN("Disabled"); - sid.pszName = "ping_disabled"; - sid.ptszDefaultFile = file; - sid.iDefaultIndex = -IDI_ICON_DISABLED; - Skin_AddIcon(&sid); + Icon_Register(hInst, LPGENT("Ping"), iconList, SIZEOF(iconList)); hIconResponding = Skin_GetIcon("ping_responding"); hIconNotResponding = Skin_GetIcon("ping_not_responding"); @@ -365,4 +344,4 @@ void InitUtils() test.PluginWindowProc = NullWindowProc; CallService(MS_POPUP_REGISTERCLASS, 0, (WPARAM)&test); } -} \ No newline at end of file +} -- cgit v1.2.3