diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-04 18:51:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-04 18:51:53 +0000 |
commit | ecb177cadbcff850a16c4b9e306beb15f61ac6f9 (patch) | |
tree | da36e3107747a5f37dbd078197d584054057609f /plugins/UserInfoEx/src/svc_gender.cpp | |
parent | 808f3b5e0fefeb560ce5393bf8311927d0927411 (diff) |
kernel extraicons, part II
git-svn-id: http://svn.miranda-ng.org/main/trunk@2188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/svc_gender.cpp')
-rw-r--r-- | plugins/UserInfoEx/src/svc_gender.cpp | 73 |
1 files changed, 33 insertions, 40 deletions
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp index d8f542b374..6ac632e6af 100644 --- a/plugins/UserInfoEx/src/svc_gender.cpp +++ b/plugins/UserInfoEx/src/svc_gender.cpp @@ -2,7 +2,7 @@ UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -144,49 +144,42 @@ VOID SvcGenderApplyCListIcons() VOID SvcGenderEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB)
{
bool bEnable = (bColumn!=((BYTE)-1));
- if (myGlobals.HaveCListExtraIcons)
- {
- if (bUpdateDB)
- DB::Setting::WriteByte(SET_CLIST_EXTRAICON_GENDER2, bColumn);
- if (bEnable) // Gender checkt or dropdown select
- {
- if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "gender"; //must be the same as the group name in extraicon
- ico.description="Gender (uinfoex)";
- ico.descIcon = ICO_COMMON_MALE;
- ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- }
-
- // hook events
- if (hChangedHook == NULL)
- hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
-
- if (hApplyIconHook == NULL)
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
+ if (bUpdateDB)
+ DB::Setting::WriteByte(SET_CLIST_EXTRAICON_GENDER2, bColumn);
+
+ if (bEnable) { // Gender checkt or dropdown select
+ if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
+ EXTRAICON_INFO ico = { sizeof(ico) };
+ ico.type = EXTRAICON_TYPE_ICOLIB;
+ ico.name = "gender"; //must be the same as the group name in extraicon
+ ico.description="Gender (uinfoex)";
+ ico.descIcon = ICO_COMMON_MALE;
+ ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
}
- else
- {
- if (hChangedHook)
- {
- UnhookEvent(hChangedHook);
- hChangedHook = NULL;
- }
- if (hApplyIconHook)
- {
- UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
- }
- if (hRebuildIconsHook)
- {
- UnhookEvent(hRebuildIconsHook);
- hRebuildIconsHook = NULL;
- }
+
+ // hook events
+ if (hChangedHook == NULL)
+ hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
+
+ if (hApplyIconHook == NULL)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
+ }
+ else {
+ if (hChangedHook) {
+ UnhookEvent(hChangedHook);
+ hChangedHook = NULL;
+ }
+ if (hApplyIconHook) {
+ UnhookEvent(hApplyIconHook);
+ hApplyIconHook = NULL;
+ }
+ if (hRebuildIconsHook) {
+ UnhookEvent(hRebuildIconsHook);
+ hRebuildIconsHook = NULL;
}
- SvcGenderApplyCListIcons();
}
+ SvcGenderApplyCListIcons();
}
/**
|