From 95cc1e966d6f6fd6b0532f0de3d8970aba114408 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 15 Jun 2012 21:08:25 +0000 Subject: new icons for non-loadable plugins git-svn-id: http://svn.miranda-ng.org/main/trunk@440 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/plugins/pluginopts.cpp | 27 +++++++---- src/modules/skin/skinicons.cpp | 92 +++++++++++++++++++------------------- 2 files changed, 66 insertions(+), 53 deletions(-) (limited to 'src/modules') diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp index dc1cfb9e24..b7f5842541 100644 --- a/src/modules/plugins/pluginopts.cpp +++ b/src/modules/plugins/pluginopts.cpp @@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "plugins.h" +extern HANDLE hShutdownEvent, hPreShutdownEvent; static HANDLE hevLoadModule, hevUnloadModule; ///////////////////////////////////////////////////////////////////////////////////////// @@ -58,6 +59,8 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA* fd, TCHAR* path, WPARAM, LPARAM l return TRUE; int isdb = pi.pluginInfo->replacesDefaultModule == DEFMOD_DB; + int isclist = pi.pluginInfo->replacesDefaultModule == DEFMOD_CLISTALL; + PluginListItemData* dat = (PluginListItemData*)mir_alloc( sizeof( PluginListItemData )); dat->hInst = hInst; _tcsncpy(dat->fileName, fd->cFileName, SIZEOF(dat->fileName)); @@ -76,6 +79,8 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA* fd, TCHAR* path, WPARAM, LPARAM l it.iItem = iRow; it.iSubItem = 1; it.iImage = ( hInst != NULL ) ? 2 : 3; + if (isdb || isclist) + it.iImage += 2; ListView_SetItem( hwndList, &it ); ListView_SetItemText(hwndList, iRow, 2, fd->cFileName); @@ -181,6 +186,9 @@ static int UnloadPluginDynamically(PluginListItemData* dat) CallHookSubscribers(hevUnloadModule, (WPARAM)pPlug->bpi.InfoEx, 0); + CallPluginEventHook(pPlug->bpi.hInst, hPreShutdownEvent, 0, 0); + CallPluginEventHook(pPlug->bpi.hInst, hShutdownEvent, 0, 0); + dat->hInst = NULL; Plugin_Uninit(pPlug, true); return TRUE; @@ -194,20 +202,21 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP ListView_SubItemHitTest(hwnd, &hi); if ( hi.iSubItem == 1 ) { LVITEM lvi; - lvi.mask = LVIF_PARAM; + lvi.mask = LVIF_IMAGE | LVIF_PARAM; + lvi.stateMask = -1; lvi.iItem = hi.iItem; if ( ListView_GetItem( hwnd, &lvi )) { lvi.iSubItem = 1; lvi.mask = LVIF_IMAGE; PluginListItemData* dat = ( PluginListItemData* )lvi.lParam; - if (dat->hInst == NULL) { + if (lvi.iImage == 3) { if ( LoadPluginDynamically(dat)) { lvi.iImage = 2; ListView_SetItem(hwnd, &lvi); } } - else { + else if (lvi.iImage == 2) { if ( UnloadPluginDynamically(dat)) { lvi.iImage = 3; ListView_SetItem(hwnd, &lvi); @@ -228,11 +237,13 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar SetWindowLongPtr(hwndList, GWLP_WNDPROC, (LONG_PTR)PluginListWndProc); HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus()? ILC_COLOR32 : ILC_COLOR16), 4, 0); - ImageList_AddIcon_IconLibLoaded( hIml, SKINICON_OTHER_UNICODE ); - ImageList_AddIcon_IconLibLoaded( hIml, SKINICON_OTHER_ANSI ); - ImageList_AddIcon_IconLibLoaded( hIml, SKINICON_OTHER_LOADED ); - ImageList_AddIcon_IconLibLoaded( hIml, SKINICON_OTHER_NOTLOADED ); - ListView_SetImageList( hwndList, hIml, LVSIL_SMALL ); + ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_UNICODE); + ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_ANSI); + ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_LOADED); + ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_NOTLOADED); + ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_LOADEDGRAY); + ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_NOTLOADEDGRAY); + ListView_SetImageList(hwndList, hIml, LVSIL_SMALL); LVCOLUMN col; col.mask = LVCF_TEXT | LVCF_WIDTH; diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index 31100a41bd..a291309d93 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -34,51 +34,53 @@ struct StandardIconDescription static const struct StandardIconDescription mainIcons[] = { - { SKINICON_OTHER_MIRANDA, LPGEN("Miranda IM"), -IDI_MIRANDA }, - { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG }, - { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL }, - { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE }, - { SKINICON_OTHER_USERONLINE, LPGEN("User Online"), -IDI_USERONLINE }, - { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (Open)"), -IDI_GROUPOPEN }, - { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (Closed)"), -IDI_GROUPSHUT }, - { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD }, - { SKINICON_OTHER_ADDCONTACT, LPGEN("Add Contact"), -IDI_ADDCONTACT }, - { SKINICON_OTHER_USERDETAILS, LPGEN("User Details"), -IDI_USERDETAILS }, - { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY }, - { SKINICON_OTHER_DOWNARROW, LPGEN("Down Arrow"), -IDI_DOWNARROW }, - { SKINICON_OTHER_FINDUSER, LPGEN("Find User"), -IDI_FINDUSER }, - { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS }, - { SKINICON_OTHER_SENDEMAIL, LPGEN("Send E-mail"), -IDI_SENDEMAIL }, - { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE }, - { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME }, - { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS }, - { SKINICON_OTHER_SEARCHALL, LPGEN("Search All"), -IDI_SEARCHALL }, - { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK }, - { SKINICON_OTHER_NOTICK, LPGEN("No Tick"), -IDI_NOTICK }, - { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP }, - { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda Website"), -IDI_MIRANDAWEBSITE }, - { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING }, - { SKINICON_OTHER_SMALLDOT, LPGEN("Small Dot"), -IDI_SMALLDOT }, - { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled Blob"), -IDI_FILLEDBLOB }, - { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty Blob"), -IDI_EMPTYBLOB }, - { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE }, - { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI }, - { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED }, - { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED }, - { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO }, - { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW }, - { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS }, - { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR }, - { SKINICON_OTHER_SHOWHIDE, LPGEN("ShowHide"), -IDI_SHOWHIDE }, - { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT }, - { SKINICON_OTHER_MAINMENU, LPGEN("Main Menu"), -IDI_MIRANDA }, - { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE }, - { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT }, - { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT }, - { SKINICON_OTHER_GROUP, LPGEN("Move to Group"), -IDI_MOVETOGROUP }, - { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON }, - { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF }, - { SKINICON_OTHER_STATUS_LOCKED, LPGEN("Locked status"), -IDI_STATUS_LOCKED, 0, "Status Icons" }, + { SKINICON_OTHER_MIRANDA, LPGEN("Miranda IM"), -IDI_MIRANDA }, + { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG }, + { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL }, + { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE }, + { SKINICON_OTHER_USERONLINE, LPGEN("User Online"), -IDI_USERONLINE }, + { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (Open)"), -IDI_GROUPOPEN }, + { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (Closed)"), -IDI_GROUPSHUT }, + { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD }, + { SKINICON_OTHER_ADDCONTACT, LPGEN("Add Contact"), -IDI_ADDCONTACT }, + { SKINICON_OTHER_USERDETAILS, LPGEN("User Details"), -IDI_USERDETAILS }, + { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY }, + { SKINICON_OTHER_DOWNARROW, LPGEN("Down Arrow"), -IDI_DOWNARROW }, + { SKINICON_OTHER_FINDUSER, LPGEN("Find User"), -IDI_FINDUSER }, + { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS }, + { SKINICON_OTHER_SENDEMAIL, LPGEN("Send E-mail"), -IDI_SENDEMAIL }, + { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE }, + { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME }, + { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS }, + { SKINICON_OTHER_SEARCHALL, LPGEN("Search All"), -IDI_SEARCHALL }, + { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK }, + { SKINICON_OTHER_NOTICK, LPGEN("No Tick"), -IDI_NOTICK }, + { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP }, + { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda Website"), -IDI_MIRANDAWEBSITE }, + { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING }, + { SKINICON_OTHER_SMALLDOT, LPGEN("Small Dot"), -IDI_SMALLDOT }, + { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled Blob"), -IDI_FILLEDBLOB }, + { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty Blob"), -IDI_EMPTYBLOB }, + { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE }, + { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI }, + { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED }, + { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED }, + { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO }, + { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW }, + { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS }, + { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR }, + { SKINICON_OTHER_SHOWHIDE, LPGEN("ShowHide"), -IDI_SHOWHIDE }, + { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT }, + { SKINICON_OTHER_MAINMENU, LPGEN("Main Menu"), -IDI_MIRANDA }, + { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE }, + { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT }, + { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT }, + { SKINICON_OTHER_GROUP, LPGEN("Move to Group"), -IDI_MOVETOGROUP }, + { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON }, + { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF }, + { SKINICON_OTHER_LOADEDGRAY, LPGEN("Running core plugin"), -IDI_LOADED_GRAY }, + { SKINICON_OTHER_NOTLOADEDGRAY, LPGEN("Non-loadable plugin"), -IDI_NOTLOADED_GRAY }, + { SKINICON_OTHER_STATUS_LOCKED, LPGEN("Locked status"), -IDI_STATUS_LOCKED, 0, "Status Icons" }, }; HANDLE hMainIcons[SIZEOF(mainIcons)]; -- cgit v1.2.3