diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-08-13 18:05:18 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-08-13 18:05:18 +0000 |
commit | 9f478bb53be99c6ad5cf69c1a61cc14900cf72b8 (patch) | |
tree | 4dc4cce5c3a437d1f502834f70f97cf2fdef74bb /plugins/Ping/src | |
parent | f3700adeb2647b91f3613fe988be6e69e79c2e68 (diff) |
icons registration moved to Load()
git-svn-id: http://svn.miranda-ng.org/main/trunk@10180 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Ping/src')
-rw-r--r-- | plugins/Ping/src/common.h | 2 | ||||
-rw-r--r-- | plugins/Ping/src/ping.cpp | 12 | ||||
-rw-r--r-- | plugins/Ping/src/utils.cpp | 14 |
3 files changed, 15 insertions, 13 deletions
diff --git a/plugins/Ping/src/common.h b/plugins/Ping/src/common.h index 35792e7ea7..8e4398b4b9 100644 --- a/plugins/Ping/src/common.h +++ b/plugins/Ping/src/common.h @@ -134,4 +134,6 @@ extern CRITICAL_SECTION thread_finished_cs, list_changed_cs, data_list_cs; extern PINGLIST data_list;
+int ReloadIcons(WPARAM, LPARAM);
+
#endif
diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index 64dd259a65..d63cbcbe9c 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -117,6 +117,14 @@ int OnModulesLoaded(WPARAM, 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 },
+};
+
extern "C" __declspec(dllexport) int Load(void)
{
//if(init_raw_ping()) {
@@ -148,6 +156,10 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown);
+ Icon_Register(hInst, LPGEN("Ping"), iconList, SIZEOF(iconList));
+
+ HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
+
return 0;
}
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 6d089eb633..814e4d6f81 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -307,7 +307,7 @@ static int OnShutdown(WPARAM, LPARAM) return 0;
}
-static int ReloadIcons(WPARAM, LPARAM)
+int ReloadIcons(WPARAM, LPARAM)
{
hIconResponding = Skin_GetIcon("ping_responding");
hIconNotResponding = Skin_GetIcon("ping_not_responding");
@@ -318,25 +318,13 @@ static int ReloadIcons(WPARAM, 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()
{
- Icon_Register(hInst, LPGEN("Ping"), iconList, SIZEOF(iconList));
-
hIconResponding = Skin_GetIcon("ping_responding");
hIconNotResponding = Skin_GetIcon("ping_not_responding");
hIconTesting = Skin_GetIcon("ping_testing");
hIconDisabled = Skin_GetIcon("ping_disabled");
- HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
-
POPUPCLASS test = { sizeof(test) };
test.flags = PCF_TCHAR;
test.hIcon = hIconResponding;
|