From cee90240b1301ad373e98fe874a924fcdbb83447 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 9 Jul 2012 17:53:15 +0000 Subject: - fix for button states errors in Clist Modern; - fix for message handling duplicates; - fix for naming toolbar icons; - removed duplicate icon entry in dbeditor++ git-svn-id: http://svn.miranda-ng.org/main/trunk@884 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Svc_dbepp/icons.cpp | 49 +++++++++++---------------------------------- plugins/Svc_dbepp/main.cpp | 2 +- 2 files changed, 13 insertions(+), 38 deletions(-) (limited to 'plugins/Svc_dbepp') diff --git a/plugins/Svc_dbepp/icons.cpp b/plugins/Svc_dbepp/icons.cpp index ae77539ae0..6da3723bfe 100644 --- a/plugins/Svc_dbepp/icons.cpp +++ b/plugins/Svc_dbepp/icons.cpp @@ -79,34 +79,28 @@ HICON LoadSkinnedDBEIcon(int icon) int AddIconToList(HIMAGELIST hil, HICON hIcon) { - - if (!hIcon || !hil) return 0; + if (!hIcon || !hil) + return 0; ImageList_AddIcon(hil, hIcon); - return 1; - } - static PROTOCOLDESCRIPTOR **protocols = NULL; static int protoCount = 0; static int shift = 0; - void AddProtoIconsToList(HIMAGELIST hil, int newshift) { - HICON hIcon; - int i; shift = newshift; CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&protoCount,(LPARAM)&protocols); - for(i = 0 ;i < protoCount; i++) - { + for (int i = 0; i < protoCount; i++) { if (protocols[i]->type != PROTOTYPE_PROTOCOL) continue; + HICON hIcon; if (hIcon=LoadSkinnedProtoIcon(protocols[i]->szName, ID_STATUS_ONLINE)) AddIconToList(hil, hIcon); else @@ -114,49 +108,30 @@ void AddProtoIconsToList(HIMAGELIST hil, int newshift) } } - int GetProtoIcon(char *szProto) { - int result = DEF_ICON; - int i, n = 0; + if ( !protoCount || !protocols || !szProto) + return DEF_ICON; - if (!protoCount || !protocols || !szProto) return result; + int n = 0; - for(i = 0 ;i < protoCount; i++) - { + for (int i = 0; i < protoCount; i++) { if (protocols[i]->type != PROTOTYPE_PROTOCOL) continue; if (!mir_strcmp(protocols[i]->szName, szProto)) - { - result = n + shift; - break; - } + return n + shift; n++; - } - return result; + return DEF_ICON; } - BOOL IsProtocolLoaded(char* pszProtocolName) { -/* - if (pszProtocolName && pszProtocolName[0]) - { - int res = CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)pszProtocolName); - - if (res != CALLSERVICE_NOTFOUND && res) - return TRUE; - } -*/ - int i; - - if (protoCount) - for(i = 0 ;i < protoCount; i++) - { + if (protoCount) + for(int i = 0; i < protoCount; i++) { if (protocols[i]->type != PROTOTYPE_PROTOCOL) continue; diff --git a/plugins/Svc_dbepp/main.cpp b/plugins/Svc_dbepp/main.cpp index 9b0a2bfc8d..b10a7e79fd 100644 --- a/plugins/Svc_dbepp/main.cpp +++ b/plugins/Svc_dbepp/main.cpp @@ -157,7 +157,7 @@ static int OnTTBLoaded(WPARAM wParam,LPARAM lParam) ttbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP; ttbb.pszService = "DBEditorpp/MenuCommand"; ttbb.name = "Database Editor++"; - ttbb.hIconUp = ttbb.hIconDn = ico; + ttbb.hIconUp = ico; ttbb.pszTooltipUp = "Show DataBase Editor"; hTTBButt = TopToolbar_AddButton(&ttbb); return 0; -- cgit v1.2.3