From a88aaaf491053ccd9f5bfb68f78c46c886d37844 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Fri, 7 Mar 2014 17:32:28 +0000 Subject: Minor bugfixes: - #607 (Capitalization inconsistency) - #609 (Unnecessary messagebox in Plugin Updater) - #613 (UserInfoEx writes wrong popup color settings to db) - #614 (NewAwaySys translation issue) git-svn-id: http://svn.miranda-ng.org/main/trunk@8454 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_blind/src/clcopts.cpp | 2 +- plugins/Clist_blind/src/clcpaint.cpp | 38 +++++++++++++--------------------- plugins/Clist_blind/src/clistmenus.cpp | 4 ++-- plugins/Clist_blind/src/clistopts.cpp | 30 ++++++++++----------------- plugins/Clist_blind/src/cluiopts.cpp | 2 +- 5 files changed, 29 insertions(+), 47 deletions(-) (limited to 'plugins/Clist_blind') diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index 49f4f32ff8..b42bf1894a 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -263,7 +263,7 @@ int ClcOptInit(WPARAM wParam, LPARAM lParam) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; odp.hInstance = g_hInst; - odp.pszGroup = LPGEN("Contact List"); + odp.pszGroup = LPGEN("Contact list"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLC); odp.pszTitle = LPGEN("List"); odp.pfnDlgProc = DlgProcClcMainOpts; diff --git a/plugins/Clist_blind/src/clcpaint.cpp b/plugins/Clist_blind/src/clcpaint.cpp index ba2d069264..7192f7a6ec 100644 --- a/plugins/Clist_blind/src/clcpaint.cpp +++ b/plugins/Clist_blind/src/clcpaint.cpp @@ -127,11 +127,10 @@ static int GetGeneralisedStatus(void) static int GetRealStatus(struct ClcContact *contact, int status) { - int i; char *szProto = contact->proto; if (!szProto) return status; - for (i = 0; i < pcli->hClcProtoCount; i++) { + for (int i = 0; i < pcli->hClcProtoCount; i++) { if (!lstrcmpA(pcli->clcProto[i].szProto, szProto)) { return pcli->clcProto[i].dwStatus; } @@ -141,7 +140,6 @@ static int GetRealStatus(struct ClcContact *contact, int status) void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) { - HDC hdcMem; RECT clRect; int y, indent, index, fontHeight; struct ClcGroup *group; @@ -163,7 +161,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) if (IsRectEmpty(rcPaint)) return; y = -dat->yScroll; - hdcMem = CreateCompatibleDC(hdc); + HDC hdcMem = CreateCompatibleDC(hdc); HBITMAP hBmpOsb = CreateBitmap(clRect.right, clRect.bottom, 1, GetDeviceCaps(hdc, BITSPIXEL), NULL); HBITMAP hOldBitmap = (HBITMAP)SelectObject(hdcMem, hBmpOsb); { @@ -182,27 +180,23 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight); SetBkMode(hdcMem, TRANSPARENT); { - HBRUSH hBrush; - - hBrush = CreateSolidBrush(tmpbkcolour); + HBRUSH hBrush = CreateSolidBrush(tmpbkcolour); FillRect(hdcMem, rcPaint, hBrush); DeleteObject(hBrush); if (dat->hBmpBackground) { - BITMAP bmp; - HDC hdcBmp; int x, y; - int maxx, maxy; int destw, desth; // XXX: Halftone isnt supported on 9x, however the scretch problems dont happen on 98. SetStretchBltMode(hdcMem, HALFTONE); + BITMAP bmp; GetObject(dat->hBmpBackground, sizeof(bmp), &bmp); - hdcBmp = CreateCompatibleDC(hdcMem); + HDC hdcBmp = CreateCompatibleDC(hdcMem); SelectObject(hdcBmp, dat->hBmpBackground); y = dat->backgroundBmpUse & CLBF_SCROLL ? -dat->yScroll : 0; - maxx = dat->backgroundBmpUse & CLBF_TILEH ? clRect.right : 1; - maxy = dat->backgroundBmpUse & CLBF_TILEV ? maxy = rcPaint->bottom : y + 1; + int maxx = dat->backgroundBmpUse & CLBF_TILEH ? clRect.right : 1; + int maxy = dat->backgroundBmpUse & CLBF_TILEV ? maxy = rcPaint->bottom : y + 1; switch (dat->backgroundBmpUse & CLBM_TYPE) { case CLB_STRETCH: if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) { @@ -524,28 +518,24 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) if (hBrushAlternateGrey) DeleteObject(hBrushAlternateGrey); if (grey) { - PBYTE bits; BITMAPINFOHEADER bmih = { 0 }; - int i; - int greyRed, greyGreen, greyBlue; - COLORREF greyColour; bmih.biBitCount = 32; bmih.biSize = sizeof(bmih); bmih.biCompression = BI_RGB; bmih.biHeight = -clRect.bottom; bmih.biPlanes = 1; bmih.biWidth = clRect.right; - bits = (PBYTE) malloc(4 * bmih.biWidth * -bmih.biHeight); + PBYTE bits = (PBYTE) malloc(4 * bmih.biWidth * -bmih.biHeight); GetDIBits(hdc, hBmpOsb, 0, clRect.bottom, bits, (BITMAPINFO *) & bmih, DIB_RGB_COLORS); - greyColour = GetSysColor(COLOR_3DFACE); - greyRed = GetRValue(greyColour) * 2; - greyGreen = GetGValue(greyColour) * 2; - greyBlue = GetBValue(greyColour) * 2; + COLORREF greyColour = GetSysColor(COLOR_3DFACE); + int greyRed = GetRValue(greyColour) * 2; + int greyGreen = GetGValue(greyColour) * 2; + int greyBlue = GetBValue(greyColour) * 2; if (divide3[0] == 255) { - for (i = 0; i < SIZEOF(divide3); i++) + for (int i = 0; i < SIZEOF(divide3); i++) divide3[i] = (i + 1) / 3; } - for (i = 4 * clRect.right * clRect.bottom - 4; i >= 0; i -= 4) { + for (int i = 4 * clRect.right * clRect.bottom - 4; i >= 0; i -= 4) { bits[i] = divide3[bits[i] + greyBlue]; bits[i + 1] = divide3[bits[i + 1] + greyGreen]; bits[i + 2] = divide3[bits[i + 2] + greyRed]; diff --git a/plugins/Clist_blind/src/clistmenus.cpp b/plugins/Clist_blind/src/clistmenus.cpp index 76e8d86bc8..74438b7c4c 100644 --- a/plugins/Clist_blind/src/clistmenus.cpp +++ b/plugins/Clist_blind/src/clistmenus.cpp @@ -23,12 +23,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "commonheaders.h" -INT_PTR CloseAction(WPARAM wParam,LPARAM lParam) +INT_PTR CloseAction(WPARAM,LPARAM) { if (CallService(MS_SYSTEM_OKTOEXIT,0,0)) DestroyWindow(pcli->hwndContactList); - return(0); + return 0; } void InitCustomMenus() diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index bc06a27efa..2f4c3417dd 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -45,22 +45,14 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP TranslateDialogDefault(hwndDlg); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED, hwndDlg, WM_USER + 1)); CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, - db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, - db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, - db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED); - CheckDlgButton(hwndDlg, IDC_SORTBYNAME, !db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) - && !db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SORTBYSTATUS, - db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SORTBYPROTO, - db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, - db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_AUTOHIDE, - db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_SORTBYNAME, !db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) && !db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SORTBYSTATUS, db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SORTBYPROTO, db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_AUTOHIDE, db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); { @@ -119,7 +111,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT), 0)); { - int i, count, item; + int count, item; PROTOACCOUNT **accs; char szName[64]; DBVARIANT dbv = { DBVT_DELETED }; @@ -127,7 +119,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP CallService(MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accs); item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Global")); SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM) 0); - for (i = 0; i < count; i++) { + for (int i = 0; i < count; i++) { if (!IsAccountEnabled(accs[i]) || CallProtoService( accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0) continue; CallProtoService(accs[i]->szModuleName, PS_GETNAME, SIZEOF(szName), (LPARAM) szName); @@ -241,7 +233,7 @@ int CListOptInit(WPARAM wParam, LPARAM lParam) odp.position = -1000000000; odp.hInstance = g_hInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLIST); - odp.pszTitle = LPGEN("Contact List"); + odp.pszTitle = LPGEN("Contact list"); odp.pfnDlgProc = DlgProcGenOpts; odp.flags = ODPF_BOLDGROUPS; Options_AddPage(wParam, &odp); diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index 64f53a1f57..7bd6aeaccb 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -311,7 +311,7 @@ int CluiOptInit(WPARAM wParam, LPARAM lParam) odp.hInstance = g_hInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLUI); odp.pszTitle = LPGEN("Window"); - odp.pszGroup = LPGEN("Contact List"); + odp.pszGroup = LPGEN("Contact list"); odp.pfnDlgProc = DlgProcCluiOpts; odp.flags = ODPF_BOLDGROUPS; Options_AddPage(wParam, &odp); -- cgit v1.2.3