summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-03 18:51:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-03 18:51:25 +0000
commit31582b9e959b65cb9e29c4197a42e1a7e9ca804e (patch)
tree23ed81355fc68a8b9812be0c30f20467b4c52cf4 /plugins/Clist_nicer
parentc8a4c6574f3e0894d97c67cdd45e311a42eda59f (diff)
tray icons code standardization
git-svn-id: http://svn.miranda-ng.org/main/trunk@5569 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer')
-rw-r--r--plugins/Clist_nicer/src/clistmod.cpp1
-rw-r--r--plugins/Clist_nicer/src/clisttray.cpp26
-rw-r--r--plugins/Clist_nicer/src/init.cpp6
3 files changed, 7 insertions, 26 deletions
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp
index ae022a4a7f..bfb01329b5 100644
--- a/plugins/Clist_nicer/src/clistmod.cpp
+++ b/plugins/Clist_nicer/src/clistmod.cpp
@@ -40,7 +40,6 @@ extern int RemoveEvent(WPARAM wParam, LPARAM lParam);
int InitCustomMenus(void);
void UninitCustomMenus(void);
INT_PTR GetContactStatusMessage(WPARAM wParam, LPARAM lParam);
-void TrayIconUpdateBase(const char *szChangedProto);
int EventsProcessContactDoubleClick(HANDLE hContact);
int SetHideOffline(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Clist_nicer/src/clisttray.cpp b/plugins/Clist_nicer/src/clisttray.cpp
index 9430ed1f56..bad9535193 100644
--- a/plugins/Clist_nicer/src/clisttray.cpp
+++ b/plugins/Clist_nicer/src/clisttray.cpp
@@ -35,29 +35,11 @@ extern HIMAGELIST hCListImages;
#define NIF_STATE 0x00000008
#define NIF_INFO 0x00000010
-void TrayIconUpdateBase(const char *szChangedProto)
+int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount)
{
- int i,count,netProtoCount,changed = -1;
- PROTOACCOUNT **accs;
- int averageMode = 0;
+ int changed = -1;
HWND hwnd = pcli->hwndContactList;
- if (pcli->cycleTimerId)
- KillTimer(NULL, pcli->cycleTimerId); pcli->cycleTimerId = 0;
-
- ProtoEnumAccounts( &count, &accs );
- for (i = 0,netProtoCount = 0; i < count; i++) {
- if ( !pcli->pfnGetProtocolVisibility( accs[i]->szModuleName ))
- continue;
- netProtoCount++;
- if ( !lstrcmpA(szChangedProto, accs[i]->szModuleName ))
- pcli->cycleStep = i;
- if (averageMode == 0)
- averageMode = CallProtoService( accs[i]->szModuleName, PS_GETSTATUS, 0, 0);
- else if (averageMode != CallProtoService( accs[i]->szModuleName, PS_GETSTATUS, 0, 0)) {
- averageMode = -1; break;
- }
- }
if (netProtoCount > 1) {
if (averageMode > 0) {
if (cfg::getByte("CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI) {
@@ -150,8 +132,8 @@ void TrayIconUpdateBase(const char *szChangedProto)
else
changed = pcli->pfnTrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL), NULL);
}
- if (changed != -1 && pcli->trayIcon[changed].isBase)
- pcli->pfnTrayIconUpdate( pcli->trayIcon[changed].hBaseIcon, NULL, pcli->trayIcon[changed].szProto, 1);
+
+ return changed;
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp
index 7b8b31de25..f7ac4a02ba 100644
--- a/plugins/Clist_nicer/src/init.cpp
+++ b/plugins/Clist_nicer/src/init.cpp
@@ -51,9 +51,9 @@ TIME_API tmi;
HMENU BuildGroupPopupMenu( ClcGroup* group );
ClcContact* CreateClcContact( void );
-struct CListEvent* fnCreateEvent( void );
+CListEvent* fnCreateEvent( void );
void ReloadThemedOptions();
-void TrayIconUpdateBase(const char *szChangedProto);
+int TrayCalcChanged(const char *szChangedProto, int averageMode, int iProtoCount);
void RegisterCLUIFrameClasses();
void LoadButtonModule();
@@ -299,7 +299,7 @@ extern "C" int __declspec(dllexport) CListInitialise()
pcli->pfnRebuildEntireList = RebuildEntireList;
pcli->pfnRowHitTest = RowHeight::hitTest;
pcli->pfnScrollTo = ScrollTo;
- pcli->pfnTrayIconUpdateBase = TrayIconUpdateBase;
+ pcli->pfnTrayCalcChanged = TrayCalcChanged;
pcli->pfnSetHideOffline = SetHideOffline;
pcli->pfnShowHide = ShowHide;