From e58823d961a630eb62e60d2ccb443761ba5f1704 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Jun 2012 15:51:34 +0000 Subject: - all MS_CLIST_ADD*ITEM services replaced with Menu_Add*Item stubs. - massive cleanup of the menu-related code git-svn-id: http://svn.miranda-ng.org/main/trunk@410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/addcontact/addcontact.cpp | 74 +++++++++++++++++------------------ 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'src/modules/addcontact') diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp index 5a72b7b6e9..b9c3fbb683 100644 --- a/src/modules/addcontact/addcontact.cpp +++ b/src/modules/addcontact/addcontact.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-2009 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "..\..\core\commonheaders.h" -INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) +INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) { ADDCONTACTSTRUCT *acs; @@ -31,7 +31,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara { char szUin[10]; acs=(ADDCONTACTSTRUCT *)lparam; - SetWindowLongPtr(hdlg,GWLP_USERDATA,(LONG_PTR)acs); + SetWindowLongPtr(hdlg, GWLP_USERDATA, (LONG_PTR)acs); TranslateDialogDefault(hdlg); Window_SetIcon_IcoLib(hdlg, SKINICON_OTHER_ADDCONTACT); @@ -41,8 +41,8 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara dbei.cbSize=sizeof(dbei); dbei.cbBlob=sizeof(DWORD); dbei.pBlob=(PBYTE)&dwUin; - CallService(MS_DB_EVENT_GET,(WPARAM)acs->handle,(LPARAM)&dbei); - _ltoa(dwUin,szUin,10); + CallService(MS_DB_EVENT_GET, (WPARAM)acs->handle, (LPARAM)&dbei); + _ltoa(dwUin, szUin, 10); acs->szProto = dbei.szModule; } { @@ -56,11 +56,11 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara DBEVENTINFO dbei; HANDLE hcontact; - ZeroMemory(&dbei,sizeof(dbei)); + ZeroMemory(&dbei, sizeof(dbei)); dbei.cbSize=sizeof(dbei); - dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE,(WPARAM)acs->handle,0); + dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)acs->handle, 0); dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob); - CallService(MS_DB_EVENT_GET,(WPARAM)acs->handle,(LPARAM)&dbei); + CallService(MS_DB_EVENT_GET, (WPARAM)acs->handle, (LPARAM)&dbei); hcontact=*((PHANDLE)(dbei.pBlob+sizeof(DWORD))); mir_free(dbei.pBlob); if (hcontact != INVALID_HANDLE_VALUE) { @@ -84,7 +84,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara if ( acs->handleType == HANDLE_CONTACT && acs->handle ) if ( acs->szProto == NULL || (acs->szProto != NULL && *acs->szProto == 0 )) - acs->szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)acs->handle,0); + acs->szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)acs->handle, 0); { int groupId; @@ -92,36 +92,36 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara DBVARIANT dbv; char idstr[4]; int id; - _itoa(groupId,idstr,10); - if (DBGetContactSettingTString(NULL,"CListGroups",idstr,&dbv)) break; - id = SendDlgItemMessage(hdlg,IDC_GROUP,CB_ADDSTRING,0,(LPARAM)(dbv.ptszVal+1)); - SendDlgItemMessage(hdlg,IDC_GROUP,CB_SETITEMDATA ,id,groupId+1); + _itoa(groupId, idstr, 10); + if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv)) break; + id = SendDlgItemMessage(hdlg, IDC_GROUP, CB_ADDSTRING, 0, (LPARAM)(dbv.ptszVal+1)); + SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETITEMDATA , id, groupId+1); DBFreeVariant(&dbv); } } - SendDlgItemMessage(hdlg,IDC_GROUP,CB_INSERTSTRING,0,(LPARAM)TranslateT("None")); - SendDlgItemMessage(hdlg,IDC_GROUP,CB_SETCURSEL,0,0); + SendDlgItemMessage(hdlg, IDC_GROUP, CB_INSERTSTRING, 0, (LPARAM)TranslateT("None")); + SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETCURSEL, 0, 0); /* acs->szProto may be NULL don't expect it */ { // By default check both checkboxes - CheckDlgButton(hdlg,IDC_ADDED,BST_CHECKED); - CheckDlgButton(hdlg,IDC_AUTH,BST_CHECKED); + CheckDlgButton(hdlg, IDC_ADDED, BST_CHECKED); + CheckDlgButton(hdlg, IDC_AUTH, BST_CHECKED); - DWORD flags = (acs->szProto) ? CallProtoService(acs->szProto,PS_GETCAPS,PFLAGNUM_4,0) : 0; + DWORD flags = (acs->szProto) ? CallProtoService(acs->szProto, PS_GETCAPS, PFLAGNUM_4, 0) : 0; if (flags&PF4_FORCEADDED) { // force you were added requests for this protocol - EnableWindow(GetDlgItem(hdlg,IDC_ADDED),FALSE); + EnableWindow(GetDlgItem(hdlg, IDC_ADDED), FALSE); } if (flags&PF4_FORCEAUTH) { // force auth requests for this protocol - EnableWindow(GetDlgItem(hdlg,IDC_AUTH),FALSE); + EnableWindow(GetDlgItem(hdlg, IDC_AUTH), FALSE); } if (flags&PF4_NOCUSTOMAUTH) { - EnableWindow(GetDlgItem(hdlg,IDC_AUTHREQ),FALSE); - EnableWindow(GetDlgItem(hdlg,IDC_AUTHGB),FALSE); + EnableWindow(GetDlgItem(hdlg, IDC_AUTHREQ), FALSE); + EnableWindow(GetDlgItem(hdlg, IDC_AUTHGB), FALSE); } else { - EnableWindow(GetDlgItem(hdlg,IDC_AUTHREQ),IsDlgButtonChecked(hdlg,IDC_AUTH)); - EnableWindow(GetDlgItem(hdlg,IDC_AUTHGB),IsDlgButtonChecked(hdlg,IDC_AUTH)); - SetDlgItemText(hdlg,IDC_AUTHREQ,TranslateT("Please authorize my request and add me to your contact list.")); + EnableWindow(GetDlgItem(hdlg, IDC_AUTHREQ), IsDlgButtonChecked(hdlg, IDC_AUTH)); + EnableWindow(GetDlgItem(hdlg, IDC_AUTHGB), IsDlgButtonChecked(hdlg, IDC_AUTH)); + SetDlgItemText(hdlg, IDC_AUTHREQ, TranslateT("Please authorize my request and add me to your contact list.")); } } break; @@ -133,14 +133,14 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara { case IDC_AUTH: { - DWORD flags = CallProtoService(acs->szProto,PS_GETCAPS,PFLAGNUM_4,0); + DWORD flags = CallProtoService(acs->szProto, PS_GETCAPS, PFLAGNUM_4, 0); if (flags & PF4_NOCUSTOMAUTH) { - EnableWindow(GetDlgItem(hdlg,IDC_AUTHREQ),FALSE); - EnableWindow(GetDlgItem(hdlg,IDC_AUTHGB),FALSE); + EnableWindow(GetDlgItem(hdlg, IDC_AUTHREQ), FALSE); + EnableWindow(GetDlgItem(hdlg, IDC_AUTHGB), FALSE); } else { - EnableWindow(GetDlgItem(hdlg,IDC_AUTHREQ),IsDlgButtonChecked(hdlg,IDC_AUTH)); - EnableWindow(GetDlgItem(hdlg,IDC_AUTHGB),IsDlgButtonChecked(hdlg,IDC_AUTH)); + EnableWindow(GetDlgItem(hdlg, IDC_AUTHREQ), IsDlgButtonChecked(hdlg, IDC_AUTH)); + EnableWindow(GetDlgItem(hdlg, IDC_AUTHGB), IsDlgButtonChecked(hdlg, IDC_AUTH)); } } break; @@ -219,7 +219,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara case WM_DESTROY: Window_FreeIcon_IcoLib(hdlg); - acs = ( ADDCONTACTSTRUCT* )GetWindowLongPtr(hdlg,GWLP_USERDATA); + acs = ( ADDCONTACTSTRUCT* )GetWindowLongPtr(hdlg, GWLP_USERDATA); if (acs) { if (acs->psr) { mir_free(acs->psr->nick); @@ -236,7 +236,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara return FALSE; } -INT_PTR AddContactDialog(WPARAM wParam,LPARAM lParam) +INT_PTR AddContactDialog(WPARAM wParam, LPARAM lParam) { if (lParam) { ADDCONTACTSTRUCT* acs = ( ADDCONTACTSTRUCT* )mir_alloc(sizeof(ADDCONTACTSTRUCT)); @@ -245,7 +245,7 @@ INT_PTR AddContactDialog(WPARAM wParam,LPARAM lParam) PROTOSEARCHRESULT *psr; /* bad! structures that are bigger than psr will cause crashes if they define pointers within unreachable structural space */ psr = (PROTOSEARCHRESULT *)mir_alloc(acs->psr->cbSize); - memmove(psr,acs->psr,acs->psr->cbSize); + memmove(psr, acs->psr, acs->psr->cbSize); psr->nick = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)psr->nick) : mir_a2t((char*)psr->nick); psr->firstName = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)psr->firstName) : mir_a2t((char*)psr->firstName); psr->lastName = psr->flags & PSR_UNICODE ? mir_u2t((wchar_t*)psr->lastName) : mir_a2t((char*)psr->lastName); @@ -256,9 +256,9 @@ INT_PTR AddContactDialog(WPARAM wParam,LPARAM lParam) } if ( wParam ) - DialogBoxParam(hMirandaInst,MAKEINTRESOURCE(IDD_ADDCONTACT),(HWND)wParam,AddContactDlgProc,(LPARAM)acs); + DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_ADDCONTACT), (HWND)wParam, AddContactDlgProc, (LPARAM)acs); else - CreateDialogParam(hMirandaInst,MAKEINTRESOURCE(IDD_ADDCONTACT),(HWND)wParam,AddContactDlgProc,(LPARAM)acs); + CreateDialogParam(hMirandaInst, MAKEINTRESOURCE(IDD_ADDCONTACT), (HWND)wParam, AddContactDlgProc, (LPARAM)acs); return 0; } return 1; @@ -266,6 +266,6 @@ INT_PTR AddContactDialog(WPARAM wParam,LPARAM lParam) int LoadAddContactModule(void) { - CreateServiceFunction(MS_ADDCONTACT_SHOW,AddContactDialog); + CreateServiceFunction(MS_ADDCONTACT_SHOW, AddContactDialog); return 0; } -- cgit v1.2.3