summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-12-02 18:19:49 +0000
commitc4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 (patch)
tree17a8627550b202d62df8e1df76d2585d3d0cdeaa /plugins/AutoShutdown/src
parent5ea5feb7e052ca45af7bc9ed76e4a252bd71950d (diff)
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
Diffstat (limited to 'plugins/AutoShutdown/src')
-rw-r--r--plugins/AutoShutdown/src/main.cpp14
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.cpp4
2 files changed, 12 insertions, 6 deletions
diff --git a/plugins/AutoShutdown/src/main.cpp b/plugins/AutoShutdown/src/main.cpp
index c81b86a0b8..4128bd7a1a 100644
--- a/plugins/AutoShutdown/src/main.cpp
+++ b/plugins/AutoShutdown/src/main.cpp
@@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HINSTANCE hInst;
static HANDLE hHookModulesLoaded;
-HANDLE hActiveIcon,hInactiveIcon;
int hLangpack;
PLUGININFOEX pluginInfo = {
@@ -39,6 +38,13 @@ PLUGININFOEX pluginInfo = {
{0x9de24579, 0x5c5c, 0x49aa, {0x80, 0xe8, 0x4d, 0x38, 0xe4, 0x34, 0x4e, 0x63}}
};
+IconItem iconList[] =
+{
+ { LPGEN("Header"), "AutoShutdown_Header", IDI_HEADER },
+ { LPGEN("Active"), "AutoShutdown_Active", IDI_ACTIVE },
+ { LPGEN("Inactive"), "AutoShutdown_Inactive", IDI_INACTIVE },
+};
+
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, VOID *pReserved)
{
hInst = hinstDLL;
@@ -89,6 +95,8 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD m
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[]={MIID_SHUTDOWN,MIID_LAST};
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfo);
@@ -100,9 +108,7 @@ extern "C" __declspec(dllexport) int Load(void)
if(InitFrame()) return 1; /* before icons */
/* shared */
- IcoLib_AddIconRes("AutoShutdown_Header",TranslateT("Automatic Shutdown"),TranslateT("Header"),hInst,IDI_HEADER,TRUE);
- hActiveIcon=IcoLib_AddIconRes("AutoShutdown_Active",TranslateT("Automatic Shutdown"),TranslateT("Active"),hInst,IDI_ACTIVE,FALSE);
- hInactiveIcon=IcoLib_AddIconRes("AutoShutdown_Inactive",TranslateT("Automatic Shutdown"),TranslateT("Inactive"),hInst,IDI_INACTIVE,FALSE);
+ Icon_Register(hInst, "Automatic Shutdown", iconList, SIZEOF(iconList));
InitShutdownSvc();
InitWatcher(); /* before InitSettingsDlg() */
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp
index 4c980117f2..36910dfdf7 100644
--- a/plugins/AutoShutdown/src/settingsdlg.cpp
+++ b/plugins/AutoShutdown/src/settingsdlg.cpp
@@ -435,14 +435,14 @@ void SetShutdownToolbarButton(BOOL fActive)
/************************* Menu Item **********************************/
static HANDLE hMainMenuItem,hTrayMenuItem;
-extern HANDLE hActiveIcon,hInactiveIcon;
+extern IconItem iconList[];
void SetShutdownMenuItem(BOOL fActive)
{
/* main menu */
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 2001090000;
- mi.icolibItem = fActive?hActiveIcon:hInactiveIcon;
+ mi.icolibItem = fActive ? iconList[1].hIcolib : iconList[2].hIcolib;
mi.ptszName = fActive?_T("Stop automatic &shutdown"):_T("Automatic &shutdown..."); /* autotranslated */
mi.pszService = "AutoShutdown/MenuCommand";
mi.flags = CMIF_TCHAR|CMIF_ICONFROMICOLIB;