From 3f23417a1099f73dc28ec1b7d6ec2a1a7fc2b7a2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2012 20:53:59 +0000 Subject: - PLUGININFO structure removed at all; - Options_AddPage & UserInfo_AddPage replaced MS_OPT_ADDPAGE & MS_USERINFO_ADDPAGE services respectively - total internal redesign of options' translation - code reformatting git-svn-id: http://svn.miranda-ng.org/main/trunk@477 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/userinfo/contactinfo.cpp | 40 +++++++++++----------- src/modules/userinfo/stdinfo.cpp | 52 ++++++++++++++--------------- src/modules/userinfo/userinfo.cpp | 64 +++++++++++++++++------------------- 3 files changed, 77 insertions(+), 79 deletions(-) (limited to 'src/modules/userinfo') diff --git a/src/modules/userinfo/contactinfo.cpp b/src/modules/userinfo/contactinfo.cpp index 42658c8fd1..f83c1c5a5c 100644 --- a/src/modules/userinfo/contactinfo.cpp +++ b/src/modules/userinfo/contactinfo.cpp @@ -88,7 +88,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar GetDlgItemTextA(hwndDlg, IDC_PHONE, szText, 252); if (lstrlenA(szText)<7 || szText[0] != '+') isValid=0; if (isValid) isValid=(lstrlenA(szText+1) == (int)strspn(szText+1, "0123456789 ()-")); - if (!isValid) { + if ( !isValid) { MessageBox(hwndDlg, TranslateT("The phone number should start with a + and consist of numbers, spaces, brackets and hyphens only."), TranslateT("Invalid Phone Number"), MB_OK); break; } @@ -124,21 +124,21 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar if (szText[0] != '+') isValid=0; - if ( isValid ) { - int i, country = strtol( szText+1, &pText, 10 ); - if ( pText - szText > 4 ) + if (isValid) { + int i, country = strtol(szText+1, &pText, 10); + if (pText - szText > 4) isValid = 0; else { - for ( i = SendDlgItemMessage( hwndDlg, IDC_COUNTRY, CB_GETCOUNT, 0, 0 )-1; i >= 0; i-- ) - if ( country == SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, i, 0)) { + for (i = SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETCOUNT, 0, 0)-1; i >= 0; i--) + if (country == SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, i, 0)) { SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETCURSEL, i, 0); break; } - if ( i < 0 ) + if (i < 0) isValid = 0; } } - if ( isValid ) { + if (isValid) { pArea = pText+strcspn(pText, "0123456789"); pText = pArea+strspn(pArea, "0123456789"); if (*pText) { @@ -148,7 +148,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar } SetDlgItemTextA(hwndDlg, IDC_AREA, pArea); } - if ( !isValid ) { + if ( !isValid) { SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_SETCURSEL, -1, 0); SetDlgItemTextA(hwndDlg, IDC_AREA, ""); SetDlgItemTextA(hwndDlg, IDC_NUMBER, ""); @@ -176,10 +176,10 @@ static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail) GetCursorPos(&hti.pt); ScreenToClient(hwndEmails, &hti.pt); GetClientRect(hwndEmails, &rc); - if (!PtInRect(&rc, hti.pt)) return 0; + if ( !PtInRect(&rc, hti.pt)) return 0; if (ListView_SubItemHitTest(hwndEmails, &hti) == -1) return 0; if (hti.iSubItem != 1) return 0; - if (!(hti.flags&LVHT_ONITEMLABEL)) return 0; + if ( !(hti.flags&LVHT_ONITEMLABEL)) return 0; ListView_GetSubItemRect(hwndEmails, hti.iItem, 1, LVIR_LABEL, &rc); szText[0] = 0; ListView_GetItemText(hwndEmails, hti.iItem, 1, szText, SIZEOF(szText)); @@ -260,7 +260,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.pszText=TranslateT("Primary"); } else { - mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i ); + mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i); if (DBGetContactSettingTString(hContact, szProto, idstr, &dbv)) break; lvi.pszText=idstr2; @@ -293,21 +293,21 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.lParam=(LPARAM)(-1); lvi.iSubItem=0; lvi.iItem=0; - if (!DBGetContactSettingTString(hContact, szProto, "Phone", &dbv)) { + if ( !DBGetContactSettingTString(hContact, szProto, "Phone", &dbv)) { lvi.pszText=TranslateT("Primary"); ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi); ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal); DBFreeVariant(&dbv); lvi.iItem++; } - if (!DBGetContactSettingTString(hContact, szProto, "Fax", &dbv)) { + if ( !DBGetContactSettingTString(hContact, szProto, "Fax", &dbv)) { lvi.pszText=TranslateT("Fax"); ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi); ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal); DBFreeVariant(&dbv); lvi.iItem++; } - if (!DBGetContactSettingTString(hContact, szProto, "Cellular", &dbv)) { + if ( !DBGetContactSettingTString(hContact, szProto, "Cellular", &dbv)) { lvi.pszText=TranslateT("Mobile"); ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi); if (lstrlenA(dbv.pszVal)>4 && !lstrcmpA(dbv.pszVal+lstrlenA(dbv.pszVal)-4, " SMS")) { @@ -318,14 +318,14 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DBFreeVariant(&dbv); lvi.iItem++; } - if (!DBGetContactSettingTString(hContact, szProto, "CompanyPhone", &dbv)) { + if ( !DBGetContactSettingTString(hContact, szProto, "CompanyPhone", &dbv)) { lvi.pszText=TranslateT("Work Phone"); ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi); ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal); DBFreeVariant(&dbv); lvi.iItem++; } - if (!DBGetContactSettingTString(hContact, szProto, "CompanyFax", &dbv)) { + if ( !DBGetContactSettingTString(hContact, szProto, "CompanyFax", &dbv)) { lvi.pszText=TranslateT("Work Fax"); ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi); ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal); @@ -392,15 +392,15 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP HICON hIcon = NULL; if (nm->nmcd.lItemlParam == (LPARAM)(-2) && nm->iSubItem-3 == (nm->nmcd.hdr.idFrom == IDC_PHONES)) - hIcon = LoadSkinIcon( SKINICON_OTHER_ADDCONTACT ); + hIcon = LoadSkinIcon(SKINICON_OTHER_ADDCONTACT); else if (nm->iSubItem>1 && nm->nmcd.lItemlParam != (LPARAM)(-1) && nm->nmcd.lItemlParam != (LPARAM)(-2)) { static int iconResources[3]={SKINICON_OTHER_RENAME, SKINICON_OTHER_DELETE}; if (nm->iSubItem == 2 && nm->nmcd.hdr.idFrom == IDC_PHONES) { TCHAR szText[2]; ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, SIZEOF(szText)); - if (szText[0]) hIcon = LoadSkinIcon( SKINICON_OTHER_SMS ); + if (szText[0]) hIcon = LoadSkinIcon(SKINICON_OTHER_SMS); } - else hIcon = LoadSkinIcon( iconResources[nm->iSubItem-3+(nm->nmcd.hdr.idFrom == IDC_EMAILS)] ); + else hIcon = LoadSkinIcon(iconResources[nm->iSubItem-3+(nm->nmcd.hdr.idFrom == IDC_EMAILS)]); } else break; DrawIconEx(nm->nmcd.hdc, (rc.left+rc.right-GetSystemMetrics(SM_CXSMICON))/2, (rc.top+rc.bottom-GetSystemMetrics(SM_CYSMICON))/2, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL); diff --git a/src/modules/userinfo/stdinfo.cpp b/src/modules/userinfo/stdinfo.cpp index 7cc4e348ac..40f749efdf 100644 --- a/src/modules/userinfo/stdinfo.cpp +++ b/src/modules/userinfo/stdinfo.cpp @@ -43,7 +43,7 @@ static int Proto_GetContactInfoSetting(HANDLE hContact, const char *szProto, con static void Proto_FreeInfoVariant(DBVARIANT *dbv) { - switch ( dbv->type ) { + switch (dbv->type) { case DBVT_ASCIIZ: case DBVT_UTF8: case DBVT_WCHAR: @@ -75,7 +75,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule, if (szModule == NULL) unspecified=1; else if (proto_service) unspecified=Proto_GetContactInfoSetting(hContact, szProto, szModule, szSetting, &dbv, 0); else unspecified=DBGetContactSettingW(hContact, szModule, szSetting, &dbv); - if (!unspecified) { + if ( !unspecified) { switch(dbv.type) { case DBVT_BYTE: if (special == SVS_GENDER) { @@ -105,9 +105,9 @@ static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule, case DBVT_WORD: if (special == SVS_COUNTRY) { WORD wSave = dbv.wVal; - if (wSave == ( WORD )-1) { + if (wSave == (WORD)-1) { char szSettingName[100]; - mir_snprintf( szSettingName, SIZEOF(szSettingName), "%sName", szSetting ); + mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sName", szSetting); if ( !DBGetContactSettingTString(hContact, szModule, szSettingName, &dbv)) { ptstr = dbv.ptszVal; unspecified = false; @@ -139,23 +139,23 @@ static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule, break; case DBVT_UTF8: unspecified=(special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0'); - if ( !unspecified ) + if ( !unspecified) { WCHAR* wszStr; - Utf8Decode( dbv.pszVal, &wszStr ); - SetDlgItemTextW( hwndDlg, idCtrl, TranslateTS(wszStr)); - mir_free( wszStr ); + Utf8Decode(dbv.pszVal, &wszStr); + SetDlgItemTextW(hwndDlg, idCtrl, TranslateTS(wszStr)); + mir_free(wszStr); goto LBL_Exit; } pstr=dbv.pszVal; - Utf8Decode( dbv.pszVal, NULL ); + Utf8Decode(dbv.pszVal, NULL); break; default: pstr=str; lstrcpyA(str, "???"); break; } } if (unspecified) SetDlgItemText(hwndDlg, idCtrl, TranslateT("")); - else if ( ptstr != NULL ) + else if (ptstr != NULL) SetDlgItemText(hwndDlg, idCtrl, ptstr); else SetDlgItemTextA(hwndDlg, idCtrl, pstr); @@ -180,7 +180,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_NOTIFY: switch (((LPNMHDR)lParam)->idFrom) { case 0: - if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED ) + if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) { char *szProto; HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam; if (hContact != NULL) { @@ -256,7 +256,7 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_NOTIFY: switch (((LPNMHDR)lParam)->idFrom) { case 0: - if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED ) + if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) { char *szProto; HANDLE hContact=(HANDLE)((LPPSHNOTIFY)lParam)->lParam; if (hContact != NULL) { @@ -395,8 +395,8 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, lvi.iItem=0; for (i=0;;i++) { mir_snprintf(idstr, SIZEOF(idstr), "Past%d", i); - if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) || - (!proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv))) + if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) || + ( !proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv))) break; mir_snprintf(idstr, SIZEOF(idstr), "Past%dText", i); if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText)) @@ -414,8 +414,8 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, for (i=0;;i++) { mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%d", i); - if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) || - (!proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv))) + if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) || + ( !proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv))) break; mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%dText", i); if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText)) @@ -440,8 +440,8 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, lvi.iItem=0; for (i=0;;i++) { mir_snprintf(idstr, SIZEOF(idstr), "Interest%dCat", i); - if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) || - (!proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv))) + if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) || + ( !proto_service && DBGetContactSettingTString(hContact, szProto, idstr, &dbv))) break; mir_snprintf(idstr, SIZEOF(idstr), "Interest%dText", i); if (DBGetContactSettingTString(hContact, szProto, idstr, &dbvText)) @@ -507,7 +507,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR hFont = CreateFontIndirect(&lf); SendDlgItemMessage(hwndDlg, IDC_ABOUT, WM_SETFONT, (WPARAM) hFont, MAKELPARAM(TRUE, 0)); - if (!DBGetContactSettingString((HANDLE)lParam, "UserInfo", "MyNotes", &dbv)) { + if ( !DBGetContactSettingString((HANDLE)lParam, "UserInfo", "MyNotes", &dbv)) { SetDlgItemTextA(hwndDlg, IDC_MYNOTES, dbv.pszVal); DBFreeVariant(&dbv); } @@ -565,7 +565,7 @@ int DetailsInit(WPARAM wParam, LPARAM lParam) if ((HANDLE)lParam == NULL) return 0; - if ( CallService(MS_PROTO_GETCONTACTBASEPROTO, lParam, 0) == 0 ) + if (CallService(MS_PROTO_GETCONTACTBASEPROTO, lParam, 0) == 0) return 0; odp.cbSize = sizeof(odp); @@ -577,36 +577,36 @@ int DetailsInit(WPARAM wParam, LPARAM lParam) odp.position = -2100000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_SUMMARY); odp.pszTitle = LPGEN("Summary"); - CallService(MS_USERINFO_ADDPAGE, wParam, ( LPARAM )&odp); + UserInfo_AddPage(wParam, &odp); odp.pfnDlgProc = ContactDlgProc; odp.position = -1800000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_CONTACT); odp.pszTitle = LPGEN("Contact"); - CallService(MS_USERINFO_ADDPAGE, wParam, ( LPARAM )&odp ); + UserInfo_AddPage(wParam, &odp); odp.pfnDlgProc = LocationDlgProc; odp.position = -1500000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_LOCATION); odp.pszTitle = LPGEN("Location"); - CallService(MS_USERINFO_ADDPAGE, wParam, ( LPARAM )&odp); + UserInfo_AddPage(wParam, &odp); odp.pfnDlgProc = WorkDlgProc; odp.position = -1200000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_WORK); odp.pszTitle = LPGEN("Work"); - CallService(MS_USERINFO_ADDPAGE, wParam, ( LPARAM )&odp); + UserInfo_AddPage(wParam, &odp); odp.pfnDlgProc = BackgroundDlgProc; odp.position = -900000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_BACKGROUND); odp.pszTitle = LPGEN("Background info"); - CallService(MS_USERINFO_ADDPAGE, wParam, ( LPARAM )&odp ); + UserInfo_AddPage(wParam, &odp); odp.pfnDlgProc = NotesDlgProc; odp.position = 0; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_NOTES); odp.pszTitle = LPGEN("Notes"); - CallService(MS_USERINFO_ADDPAGE, wParam, ( LPARAM )&odp); + UserInfo_AddPage(wParam, &odp); return 0; } diff --git a/src/modules/userinfo/userinfo.cpp b/src/modules/userinfo/userinfo.cpp index 7fb79822d5..599902f9ad 100644 --- a/src/modules/userinfo/userinfo.cpp +++ b/src/modules/userinfo/userinfo.cpp @@ -61,12 +61,12 @@ struct DetailsData { static int PageSortProc(OPTIONSDIALOGPAGE *item1, OPTIONSDIALOGPAGE *item2) { int res; - if (!lstrcmp(item1->ptszTitle, TranslateT("Summary"))) return -1; - if (!lstrcmp(item2->ptszTitle, TranslateT("Summary"))) return 1; + if ( !lstrcmp(item1->ptszTitle, TranslateT("Summary"))) return -1; + if ( !lstrcmp(item2->ptszTitle, TranslateT("Summary"))) return 1; if (res = lstrcmp(item1->ptszTitle, item2->ptszTitle)) return res; if (item1->ptszTab && !item2->ptszTab) return -1; - if (!item1->ptszTab && item2->ptszTab) return 1; - if (!item1->ptszTab && !item2->ptszTab) return 0; + if ( !item1->ptszTab && item2->ptszTab) return 1; + if ( !item1->ptszTab && !item2->ptszTab) return 0; if (item1->ptszTab && !lstrcmp(item1->ptszTab, TranslateT("General"))) return -1; if (item2->ptszTab && !lstrcmp(item2->ptszTab, TranslateT("General"))) return 1; return lstrcmp(item1->ptszTab, item2->ptszTab); @@ -117,10 +117,8 @@ static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam) OPTIONSDIALOGPAGE *odp=(OPTIONSDIALOGPAGE*)lParam, *dst; struct DetailsPageInit *opi=(struct DetailsPageInit*)wParam; - if (odp == NULL||opi == NULL) return 1; - if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE) - && odp->cbSize != OPTIONPAGE_OLD_SIZE2 - && odp->cbSize != OPTIONPAGE_OLD_SIZE3) + if (odp == NULL || opi == NULL) return 1; + if (odp->cbSize != sizeof(OPTIONSDIALOGPAGE) && odp->cbSize != OPTIONPAGE_OLD_SIZE) return 1; opi->odp=(OPTIONSDIALOGPAGE*)mir_realloc(opi->odp, sizeof(OPTIONSDIALOGPAGE)*(opi->pageCount+1)); @@ -133,26 +131,26 @@ static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam) else dst->pszTemplate = odp->pszTemplate; - if ( odp->flags & ODPF_UNICODE ) + if (odp->flags & ODPF_UNICODE) { dst->ptszTitle = (odp->ptszTitle == 0) ? NULL : mir_wstrdup(odp->ptszTitle); - dst->ptszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->ptszTab) ? NULL : mir_wstrdup(odp->ptszTab); + dst->ptszTab = ( !(odp->flags & ODPF_USERINFOTAB) || !odp->ptszTab) ? NULL : mir_wstrdup(odp->ptszTab); } else { - if ( odp->flags & ODPF_DONTTRANSLATE ) + if (odp->flags & ODPF_DONTTRANSLATE) dst->ptszTitle = (odp->pszTitle == 0) ? NULL : mir_a2t(odp->pszTitle); else dst->ptszTitle = (odp->pszTitle == 0) ? NULL : LangPackPcharToTchar(odp->pszTitle); - dst->ptszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pszTab) ? NULL : LangPackPcharToTchar(odp->pszTab); + dst->ptszTab = ( !(odp->flags & ODPF_USERINFOTAB) || !odp->pszTab) ? NULL : LangPackPcharToTchar(odp->pszTab); } dst->pszGroup = NULL; dst->groupPosition = odp->groupPosition; dst->hGroupIcon = odp->hGroupIcon; dst->hIcon = odp->hIcon; - if ( odp->cbSize == sizeof(OPTIONSDIALOGPAGE)) + if (odp->cbSize == sizeof(OPTIONSDIALOGPAGE)) dst->dwInitParam = odp->dwInitParam; opi->pageCount++; return 0; @@ -164,7 +162,7 @@ static void ThemeDialogBackground(HWND hwnd) enableThemeDialogTexture(hwnd, ETDT_ENABLETAB); } -static void CreateDetailsTabs( HWND hwndDlg, struct DetailsData* dat, struct DetailsPageData* ppg ) +static void CreateDetailsTabs(HWND hwndDlg, struct DetailsData* dat, struct DetailsPageData* ppg) { HWND hwndTab = GetDlgItem(hwndDlg, IDC_TABS); int i, sel=0, pages=0; @@ -172,13 +170,13 @@ static void CreateDetailsTabs( HWND hwndDlg, struct DetailsData* dat, struct Det tie.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM; tie.iImage = -1; TabCtrl_DeleteAllItems(hwndTab); - for ( i=0; i < dat->pageCount; i++ ) { - if (!dat->opd[i].ptszTab || lstrcmp(dat->opd[i].ptszTitle, ppg->ptszTitle)) continue; + for (i=0; i < dat->pageCount; i++) { + if ( !dat->opd[i].ptszTab || lstrcmp(dat->opd[i].ptszTitle, ppg->ptszTitle)) continue; tie.pszText = TranslateTS(dat->opd[i].ptszTab); tie.lParam = i; TabCtrl_InsertItem(hwndTab, pages, &tie); - if (!lstrcmp(dat->opd[i].ptszTab, ppg->ptszTab)) + if ( !lstrcmp(dat->opd[i].ptszTab, ppg->ptszTab)) sel = pages; pages++; } @@ -188,7 +186,7 @@ static void CreateDetailsTabs( HWND hwndDlg, struct DetailsData* dat, struct Det SetWindowLongPtr(hwndTab, GWL_STYLE, pages > 1 ? style | WS_TABSTOP : style & ~WS_TABSTOP); } -static void CreateDetailsPageWindow( HWND hwndDlg, struct DetailsData* dat, struct DetailsPageData* ppg ) +static void CreateDetailsPageWindow(HWND hwndDlg, struct DetailsData* dat, struct DetailsPageData* ppg) { RECT *rc = ppg->ptszTab ? &dat->rcDisplayTab : &dat->rcDisplay; ppg->hwnd=CreateDialogIndirectParam(ppg->hInst, ppg->pTemplate, hwndDlg, ppg->dlgProc, (LPARAM)dat->hContact); @@ -241,15 +239,15 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (dat->hContact == NULL) name = TranslateT("Owner"); else - name = cli.pfnGetContactDisplayName( dat->hContact, 0 ); + name = cli.pfnGetContactDisplayName(dat->hContact, 0); - GetWindowText( hwndDlg, oldTitle, SIZEOF( oldTitle )); - mir_sntprintf( newTitle, SIZEOF(newTitle), oldTitle, name ); - SetWindowText( hwndDlg, newTitle ); + GetWindowText(hwndDlg, oldTitle, SIZEOF(oldTitle)); + mir_sntprintf(newTitle, SIZEOF(newTitle), oldTitle, name); + SetWindowText(hwndDlg, newTitle); - GetDlgItemText( hwndDlg, IDC_HEADERBAR, oldTitle, SIZEOF( oldTitle )); - mir_sntprintf( newTitle, SIZEOF(newTitle), oldTitle, name ); - SetDlgItemText( hwndDlg, IDC_HEADERBAR, newTitle ); + GetDlgItemText(hwndDlg, IDC_HEADERBAR, oldTitle, SIZEOF(oldTitle)); + mir_sntprintf(newTitle, SIZEOF(newTitle), oldTitle, name); + SetDlgItemText(hwndDlg, IDC_HEADERBAR, newTitle); } { LOGFONT lf; HFONT hNormalFont=(HFONT)SendDlgItemMessage(hwndDlg, IDC_NAME, WM_GETFONT, 0, 0); @@ -266,13 +264,13 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP HWND hwndTree = GetDlgItem(hwndDlg, IDC_PAGETREE); dat->currentPage = 0; - if ( DBGetContactSettingTString( NULL, "UserInfo", "LastTab", &dbv )) + if (DBGetContactSettingTString(NULL, "UserInfo", "LastTab", &dbv)) dbv.type = DBVT_DELETED; dat->pageCount = psh->nPages; dat->opd = (DetailsPageData*)mir_calloc(sizeof(DetailsPageData) * dat->pageCount); odp = (OPTIONSDIALOGPAGE*)psh->ppsp; - for ( i=0; i < dat->pageCount; i++ ) { + for (i=0; i < dat->pageCount; i++) { dat->opd[i].pTemplate = (LPDLGTEMPLATE)LockResource(LoadResource(odp[i].hInstance, FindResourceA(odp[i].hInstance, odp[i].pszTemplate, MAKEINTRESOURCEA(5)))); dat->opd[i].dlgProc = odp[i].pfnDlgProc; @@ -295,7 +293,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP tvis.item.pszText = mir_tstrdup(odp[i].ptszTitle); else tvis.item.pszText = TranslateTS(odp[i].ptszTitle); - if ( dbv.type != DBVT_DELETED && !lstrcmp( tvis.item.pszText, dbv.ptszVal )) + if (dbv.type != DBVT_DELETED && !lstrcmp(tvis.item.pszText, dbv.ptszVal)) dat->currentPage = i; dat->opd[i].hItem = TreeView_InsertItem(hwndTree, &tvis); } @@ -332,7 +330,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->updateAnimFrame = 0; GetDlgItemText(hwndDlg, IDC_UPDATING, dat->szUpdating, SIZEOF(dat->szUpdating)); SendMessage(hwndDlg, M_CHECKONLINE, 0, 0); - if (!CallContactService(dat->hContact, PSS_GETINFO, SGIF_ONOPEN, 0)) { + if ( !CallContactService(dat->hContact, PSS_GETINFO, SGIF_ONOPEN, 0)) { EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE); SetTimer(hwndDlg, 1, 100, NULL); } else @@ -417,7 +415,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (ack->type != ACKTYPE_GETINFO) break; SendMessage(hwndDlg, PSM_FORCECHANGED, 0, 0); /* if they're not gonna send any more ACK's don't let that mean we should crash */ - if (!ack->hProcess && !ack->lParam) { + if ( !ack->hProcess && !ack->lParam) { ShowWindow(GetDlgItem(hwndDlg, IDC_UPDATING), SW_HIDE); KillTimer(hwndDlg, 1); SendMessage(hwndDlg, M_CHECKONLINE, 0, 0); @@ -556,7 +554,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_UPDATE: if (dat->infosUpdated != NULL) {mir_free(dat->infosUpdated); dat->infosUpdated=NULL;} if (dat->hContact != NULL) { - if (!CallContactService(dat->hContact, PSS_GETINFO, 0, 0)) { + if ( !CallContactService(dat->hContact, PSS_GETINFO, 0, 0)) { EnableWindow(GetDlgItem(hwndDlg, IDC_UPDATE), FALSE); ShowWindow(GetDlgItem(hwndDlg, IDC_UPDATING), SW_SHOW); SetTimer(hwndDlg, 1, 100, NULL); @@ -617,12 +615,12 @@ int LoadUserInfoModule(void) HookEvent(ME_USERINFO_INITIALISE, DetailsInit); HookEvent(ME_DB_CONTACT_DELETED, UserInfoContactDelete); HookEvent(ME_SYSTEM_PRESHUTDOWN, ShutdownUserInfo); - CreateServiceFunction(MS_USERINFO_ADDPAGE, AddDetailsPage); + CreateServiceFunction("UserInfo/AddPage", AddDetailsPage); mi.cbSize = sizeof(mi); mi.flags = CMIF_ICONFROMICOLIB; mi.position = 1000050000; - mi.icolibItem = GetSkinIconHandle( SKINICON_OTHER_USERDETAILS ); + mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_USERDETAILS); mi.pszName = LPGEN("User &Details"); mi.pszService = MS_USERINFO_SHOWDIALOG; Menu_AddContactMenuItem(&mi); -- cgit v1.2.3