diff options
author | George Hazan <george.hazan@gmail.com> | 2016-04-15 13:40:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-04-15 13:40:58 +0000 |
commit | 18f7e9261c885e953f220ba6836e8bca43a6fc88 (patch) | |
tree | 67cb94186914b97f1c0e8e815afffea7666b2510 /plugins/Clist_modern/src | |
parent | d2dd1c6dddd3e690ad13d2b355de60d3724e8ec6 (diff) |
contact list groups:
- finally database is not used anymore (only as a settings' storage);
- MGROUP type introduced to replace HANDLE for group ids;
- MS_CLIST_GROUP* services became Clist_Group* functions;
- CLIST_INTERFACE members pfnGetGroupName & pfnRenameGroup also transformed into static Clist_Group* functions
git-svn-id: http://svn.miranda-ng.org/main/trunk@16659 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 17 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_viewmodebar.cpp | 2 |
3 files changed, 11 insertions, 12 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 169089957b..99703afe5f 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -128,9 +128,7 @@ static int clcHookSettingChanged(WPARAM hContact, LPARAM lParam) DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if (hContact == NULL) {
- if (!strcmp(cws->szModule, "CListGroups"))
- pcli->pfnClcBroadcast(INTM_GROUPSCHANGED, hContact, lParam);
- else if (!strcmp(cws->szSetting, "XStatusId") || !strcmp(cws->szSetting, "XStatusName"))
+ if (!strcmp(cws->szSetting, "XStatusId") || !strcmp(cws->szSetting, "XStatusName"))
cliCluiProtocolStatusChanged(0, cws->szModule);
else if (!strcmp(cws->szModule, "CList")) {
if (!strcmp(cws->szSetting, "OnTop"))
@@ -352,13 +350,13 @@ static LRESULT clcOnCommand(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM if (contact->type == CLCIT_GROUP) {
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_USEGROUPS);
- CallService(MS_CLIST_GROUPCREATE, contact->groupId, 0);
+ Clist_GroupCreate(contact->groupId, 0);
}
return 0;
case POPUP_GROUPSHOWOFFLINE:
if (contact->type == CLCIT_GROUP) {
- CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId, MAKELPARAM(CLCItems_IsShowOfflineGroup(contact->group) ? 0 : GROUPF_SHOWOFFLINE, GROUPF_SHOWOFFLINE));
+ Clist_GroupSetFlags(contact->groupId, MAKELPARAM(CLCItems_IsShowOfflineGroup(contact->group) ? 0 : GROUPF_SHOWOFFLINE, GROUPF_SHOWOFFLINE));
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
}
return 0;
@@ -1251,9 +1249,9 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
int i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
if (i != -1 && group->groupId != destgroup->groupId) {
- TCHAR *groupName = mir_tstrdup(pcli->pfnGetGroupName(contact->groupId, 0));
+ TCHAR *groupName = mir_tstrdup(Clist_GroupGetName(contact->groupId, 0));
TCHAR *shortGroup = NULL;
- TCHAR *sourceGrName = mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId, 0));
+ TCHAR *sourceGrName = mir_tstrdup(Clist_GroupGetName(destgroup->groupId, 0));
if (groupName) {
int len = (int)mir_tstrlen(groupName);
do { len--; } while (len >= 0 && groupName[len] != '\\');
@@ -1272,10 +1270,11 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, mir_free(groupName);
mir_free(sourceGrName);
}
- int newIndex = CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact && i != -1) ? destcontact->groupId : 0);
+
+ int newIndex = Clist_GroupMoveBefore(contact->groupId, (destcontact && i != -1) ? destcontact->groupId : 0);
newIndex = newIndex ? newIndex : contact->groupId;
if (NeedRename)
- pcli->pfnRenameGroup(newIndex, newName);
+ Clist_GroupRename(newIndex, newName);
}
break;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index d393cd87dc..14f8632f26 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -262,7 +262,7 @@ bool CLCItems_IsShowOfflineGroup(ClcGroup *group) if (group->hideOffline) return false;
DWORD groupFlags = 0;
- pcli->pfnGetGroupName(group->groupId, &groupFlags);
+ Clist_GroupGetName(group->groupId, &groupFlags);
return (groupFlags & GROUPF_SHOWOFFLINE) != 0;
}
@@ -324,7 +324,7 @@ void cliRebuildEntireList(HWND hwnd, ClcData *dat) for (int i = 1;; i++) {
DWORD groupFlags;
- TCHAR *szGroupName = pcli->pfnGetGroupName(i, &groupFlags); //UNICODE
+ TCHAR *szGroupName = Clist_GroupGetName(i, &groupFlags); //UNICODE
if (szGroupName == NULL)
break;
cli_AddGroup(hwnd, dat, szGroupName, groupFlags, i, 0);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index ecb2d33ab8..130129bb4b 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -246,7 +246,7 @@ static int FillDialog(HWND hwnd) SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
TCHAR *szGroup;
- for (int i = 1; (szGroup = pcli->pfnGetGroupName(i, NULL)) != NULL; i++) {
+ for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++) {
item.pszText = szGroup;
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
}
|