diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-23 19:19:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-23 19:19:16 +0000 |
commit | 45c2ed059fdbfb2f5e9a9281f2e0538704f17017 (patch) | |
tree | e622fab1c14080e348bcb5a577d2bc10228c2c84 /plugins | |
parent | 4535f8706bbb0844fdddd73e7911606d58b7502d (diff) |
direct access to META_PROTO removed from clist_modern
git-svn-id: http://svn.miranda-ng.org/main/trunk@9928 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 28 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcpaint.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcutils.cpp | 4 |
3 files changed, 19 insertions, 15 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 7416691b35..5e4eaa6224 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -184,6 +184,18 @@ static int clcHookIconsChanged(WPARAM wParam, LPARAM lParam) return 0;
}
+static int clcMetaModeChanged(WPARAM, LPARAM)
+{
+ pcli->pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0);
+ return 0;
+}
+
+static int clcMetacontactChanged(WPARAM hMeta, LPARAM)
+{
+ pcli->pfnClcBroadcast(INTM_NAMEORDERCHANGED, 0, 0);
+ return 0;
+}
+
static int clcHookSettingChanged(WPARAM hContact, LPARAM lParam)
{
if (MirandaExiting())
@@ -191,11 +203,7 @@ static int clcHookSettingChanged(WPARAM hContact, LPARAM lParam) DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if (hContact == NULL) {
- if (!mir_strcmp(cws->szModule, META_PROTO)) {
- if (!mir_strcmp(cws->szSetting, "Enabled"))
- pcli->pfnClcBroadcast(INTM_RELOADOPTIONS, hContact, lParam);
- }
- else if (!mir_strcmp(cws->szModule, "CListGroups"))
+ if (!mir_strcmp(cws->szModule, "CListGroups"))
pcli->pfnClcBroadcast(INTM_GROUPSCHANGED, hContact, lParam);
else if (!strcmp(cws->szSetting, "XStatusId") || !strcmp(cws->szSetting, "XStatusName"))
cliCluiProtocolStatusChanged(0, cws->szModule);
@@ -204,12 +212,6 @@ static int clcHookSettingChanged(WPARAM hContact, LPARAM lParam) {
if (!strcmp(cws->szSetting, "TickTS"))
pcli->pfnClcBroadcast(INTM_STATUSCHANGED, hContact, 0);
- else if (!strcmp(cws->szModule, META_PROTO)) {
- if (!strcmp(cws->szSetting, "ParentMeta"))
- pcli->pfnClcBroadcast(INTM_NAMEORDERCHANGED, 0, 0);
- else if (!strcmp(cws->szSetting, "Default"))
- pcli->pfnClcBroadcast(INTM_NAMEORDERCHANGED, 0, 0);
- }
else if (!strcmp(cws->szModule, "UserInfo")) {
if (!strcmp(cws->szSetting, "Timezone"))
pcli->pfnClcBroadcast(INTM_TIMEZONECHANGED, hContact, 0);
@@ -389,7 +391,7 @@ static LRESULT clcOnCreate(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPA dat->needsResort = 1;
dat->MetaIgnoreEmptyExtra = db_get_b(NULL, "CLC", "MetaIgnoreEmptyExtra", SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
- dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd, GWL_STYLE)&CLS_MANUALUPDATE)) && db_get_b(NULL, META_PROTO, "Enabled", 1);
+ dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_MANUALUPDATE)) && db_mc_isEnabled();
dat->expandMeta = db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
dat->useMetaIcon = db_get_b(NULL, "CLC", "Meta", SETTING_USEMETAICON_DEFAULT);
@@ -1698,6 +1700,8 @@ HRESULT ClcLoadModule() {
g_himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ HookEvent(ME_MC_SUBCONTACTSCHANGED, clcMetacontactChanged);
+ HookEvent(ME_MC_ENABLED, clcMetaModeChanged);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, clcHookSettingChanged);
HookEvent(ME_OPT_INITIALISE, ClcOptInit);
hAckHook = (HANDLE)HookEvent(ME_PROTO_ACK, clcHookProtoAck);
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index 3d20e0e738..14c565bb3e 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -571,7 +571,7 @@ MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask( ClcGroup *group, ClcConta case CLCIT_CONTACT:
{
ClcContact *mCont = Drawing;
- if ( Drawing->isSubcontact )
+ if (Drawing->isSubcontact)
{
_AddParamShort( mpModernMask, hi_Type, hi_SubContact );
if ( Drawing->isSubcontact == 1 && Drawing->subcontacts->SubAllocated == 1 )
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 4ff3243fd6..b016074032 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -453,9 +453,9 @@ int GetDropTargetInformation(HWND hwnd,ClcData *dat,POINT pt) }
dat->selection = hit;
- if (!mir_strcmp(contact->proto, META_PROTO) && ServiceExists(MS_MC_ADDTOMETA))
+ if (!mir_strcmp(contact->proto, META_PROTO))
return DROPTARGET_ONMETACONTACT;
- if (contact->isSubcontact && ServiceExists(MS_MC_ADDTOMETA))
+ if (contact->isSubcontact)
return DROPTARGET_ONSUBCONTACT;
return DROPTARGET_ONCONTACT;
}
|