From 81fe4a0a34e8e07305381e18e449246fef822673 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2012 11:47:05 +0000 Subject: sync git-svn-id: http://svn.miranda-ng.org/main/trunk@469 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/clc.cpp | 2 +- src/modules/clist/clisttray.cpp | 2 +- src/modules/clist/clui.cpp | 80 +++++++++++++++++------------------ src/modules/findadd/searchresults.cpp | 42 +++++++++--------- src/modules/icolib/skin2icons.cpp | 2 +- src/modules/srurl/urldialogs.cpp | 2 +- 6 files changed, 64 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index e438e4d7b3..087cc34e30 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -58,7 +58,7 @@ HMENU fnBuildGroupPopupMenu( struct ClcGroup* group ) HMENU hGroupMenu = GetSubMenu(hMenu, 2); RemoveMenu(hMenu, 2, MF_BYPOSITION); DestroyMenu(hMenu); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hGroupMenu, 0); + TranslateMenu(hGroupMenu); CheckMenuItem(hGroupMenu, POPUP_GROUPHIDEOFFLINE, group->hideOffline ? MF_CHECKED : MF_UNCHECKED); return hGroupMenu; diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 50707c5de7..8480c6026b 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -788,7 +788,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) POINT pt; HMENU hMainMenu = LoadMenu(cli.hInst, MAKEINTRESOURCE(IDR_CONTEXT)); HMENU hMenu = GetSubMenu(hMainMenu, 0); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hMenu, 0); + TranslateMenu(hMenu); ZeroMemory(&mi, sizeof(mi)); mi.cbSize = MENUITEMINFO_V4_SIZE; diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index d5bceade30..8f128e7c25 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* - Copyright 2000-2010 Miranda ICQ/IM project, + Copyright 2000-2010 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ 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. @@ -179,8 +179,8 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) { //see notes about deleting contacts on PF1_SERVERCLIST servers in m_protosvc.h UINT_PTR action; - - if (DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) && + + if (DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) && !(GetKeyState(VK_SHIFT)&0x8000) ) // Ask user for confirmation, and if the contact should be archived (hidden, not deleted) action = DialogBoxParam(hMirandaInst, MAKEINTRESOURCE(IDD_DELETECONTACT), (HWND) lParam, AskForConfirmationDlgProc, wParam); @@ -205,8 +205,8 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) if (status == ID_STATUS_OFFLINE || (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) { // Set a flag so we remember to delete the contact when the protocol goes online the next time DBWriteContactSettingByte((HANDLE) wParam, "CList", "Delete", 1); - MessageBox( NULL, - TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."), + MessageBox( NULL, + TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."), TranslateT("Delete Contact"), MB_OK); return 0; } } } @@ -292,7 +292,7 @@ int LoadCLUIModule(void) wndclass.hIconSm = NULL; RegisterClassEx(&wndclass); - wndclass.style = CS_HREDRAW | CS_VREDRAW | ((IsWinVerXPPlus() && + wndclass.style = CS_HREDRAW | CS_VREDRAW | ((IsWinVerXPPlus() && DBGetContactSettingByte(NULL, "CList", "WindowShadow", 0) == 1) ? CS_DROPSHADOW : 0); wndclass.lpfnWndProc = ContactListWndProc; wndclass.cbClsExtra = 0; @@ -304,7 +304,7 @@ int LoadCLUIModule(void) wndclass.lpszMenuName = MAKEINTRESOURCE(IDR_CLISTMENU); wndclass.lpszClassName = _T(MIRANDACLASS); wndclass.hIconSm = LoadSkinIcon(SKINICON_OTHER_MIRANDA); - RegisterClassEx(&wndclass); + RegisterClassEx(&wndclass); if (DBGetContactSettingTString(NULL, "CList", "TitleText", &dbv)) lstrcpyn(titleText, _T(MIRANDANAME), SIZEOF( titleText )); @@ -322,13 +322,13 @@ int LoadCLUIModule(void) Utils_AssertInsideScreen(&pos); cli.hwndContactList = CreateWindowEx( - (DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW), - _T(MIRANDACLASS), - titleText, + (DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW), + _T(MIRANDACLASS), + titleText, WS_POPUPWINDOW | WS_THICKFRAME | WS_CLIPCHILDREN | - (DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? WS_CAPTION | WS_SYSMENU | - (DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0), - pos.left, pos.top, pos.right - pos.left, pos.bottom - pos.top, + (DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? WS_CAPTION | WS_SYSMENU | + (DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0), + pos.left, pos.top, pos.right - pos.left, pos.bottom - pos.top, NULL, NULL, cli.hInst, NULL); if (DBGetContactSettingByte(NULL, "CList", "OnDesktop", 0)) { @@ -350,8 +350,8 @@ int LoadCLUIModule(void) ShowWindow(cli.hwndContactList, SW_SHOW); else if (state == SETTING_STATE_MINIMIZED) ShowWindow(cli.hwndContactList, SW_SHOWMINIMIZED); - SetWindowPos(cli.hwndContactList, - DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, + SetWindowPos(cli.hwndContactList, + DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); } { @@ -455,12 +455,12 @@ void fnDrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, HICON eventIcon) #define M_CREATECLC (WM_USER+1) LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - if (msg == uMsgProcessProfile) + if (msg == uMsgProcessProfile) { TCHAR profile[MAX_PATH]; int rc; // wParam = (ATOM)hProfileAtom, lParam = 0 - if (GlobalGetAtomName((ATOM) wParam, profile, SIZEOF(profile))) + if (GlobalGetAtomName((ATOM) wParam, profile, SIZEOF(profile))) { TCHAR *pfd = Utils_ReplaceVarsT(_T("%miranda_userdata%\\%miranda_profilename%.dat")); rc = lstrcmpi(profile, pfd) == 0; @@ -503,7 +503,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return DefWindowProc(hwnd, msg, wParam, lParam); } case WM_CREATE: - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) GetMenu(hwnd), 0); + TranslateMenu(GetMenu(hwnd)); DrawMenuBar(hwnd); //create the status wnd @@ -527,7 +527,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return FALSE; case M_CREATECLC: - cli.hwndContactTree = CreateWindow( CLISTCONTROL_CLASS, _T(""), + cli.hwndContactTree = CreateWindow( CLISTCONTROL_CLASS, _T(""), WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | CLS_CONTACTLIST | (DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0) @@ -584,17 +584,17 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM rcStatus.top = rcStatus.bottom = 0; SetWindowPos(cli.hwndContactTree, NULL, 0, 0, rect.right, rect.bottom - (rcStatus.bottom - rcStatus.top), SWP_NOZORDER); } - if (wParam == SIZE_MINIMIZED) + if (wParam == SIZE_MINIMIZED) { - if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || - DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) + if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || + DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) { ShowWindow(hwnd, SW_HIDE); DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN); } else DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_MINIMIZED); - + if (MySetProcessWorkingSetSize != NULL && DBGetContactSettingByte(NULL, "CList", "DisableWorkingSet", 1)) MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1); } @@ -711,7 +711,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM thisTick = GetTickCount(); if (thisTick >= startTick + 200) break; - setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), + setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) (sourceAlpha + (destAlpha - sourceAlpha) * (int) (thisTick - startTick) / 200), LWA_ALPHA); } setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) destAlpha, LWA_ALPHA); @@ -741,15 +741,15 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case SC_MINIMIZE: case SC_CLOSE: - if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || - DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) + if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || + DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) { ShowWindow(hwnd, SW_HIDE); DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN); if (MySetProcessWorkingSetSize != NULL && DBGetContactSettingByte(NULL, "CList", "DisableWorkingSet", 1)) MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1); - + return 0; } else if (wParam == SC_CLOSE) @@ -813,7 +813,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (wParam == SPI_SETWORKAREA && (GetWindowLongPtr(hwnd, GWL_STYLE) & (WS_VISIBLE | WS_MINIMIZE)) == WS_VISIBLE && !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { - RECT rc; + RECT rc; GetWindowRect(hwnd, &rc); if (Utils_AssertInsideScreen(&rc) == 1) MoveWindow(hwnd, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE); @@ -882,7 +882,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM maxHeight = DBGetContactSettingByte(NULL, "CLUI", "MaxSizeHeight", 75); GetWindowRect(hwnd, &rcWindow); GetWindowRect(cli.hwndContactTree, &rcTree); - + SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE); if (MyMonitorFromWindow) { @@ -906,7 +906,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (rcWindow.bottom > rcWorkArea.bottom) rcWindow.bottom = rcWorkArea.bottom; } - SetWindowPos(hwnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, + SetWindowPos(hwnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, SWP_NOZORDER | SWP_NOACTIVATE); break; } @@ -953,9 +953,9 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int mcnt = GetMenuItemCount(hMenu); for (int i=0; ircItem.left; if (showOpts & 1) { HICON hIcon = LoadSkinProtoIcon(szProto, status); - DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon, + DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon, g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL); IconLib_ReleaseIcon(hIcon, 0); if ( Proto_IsAccountLocked( Proto_GetAccount( szProto ))) { hIcon = LoadSkinnedIcon(SKINICON_OTHER_STATUS_LOCKED); if (hIcon != NULL) { - DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon, + DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon, g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL); IconLib_ReleaseIcon(hIcon, 0); } diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index ab5fd3fdf8..81ca1d661a 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-2009 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -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. @@ -24,12 +24,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "findadd.h" enum { - COLUMNID_PROTO, - COLUMNID_HANDLE, - COLUMNID_NICK, - COLUMNID_FIRST, - COLUMNID_LAST, - COLUMNID_EMAIL, + COLUMNID_PROTO, + COLUMNID_HANDLE, + COLUMNID_NICK, + COLUMNID_FIRST, + COLUMNID_LAST, + COLUMNID_EMAIL, NUM_COLUMNID }; @@ -73,16 +73,16 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) columnCount = NUM_COLUMNID; colOrdersValid = true; - for (i=0; i < NUM_COLUMNID; i++) + for (i=0; i < NUM_COLUMNID; i++) { LVCOLUMN lvc; - if ( i < columnCount ) + if ( i < columnCount ) { int bNeedsFree = FALSE; lvc.mask = LVCF_TEXT | LVCF_WIDTH; if ( szColumnNames[i] != NULL ) lvc.pszText = TranslateTS( szColumnNames[i] ); - else if ( i == COLUMNID_HANDLE ) + else if ( i == COLUMNID_HANDLE ) { if (szProto) { @@ -96,7 +96,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) mir_snprintf(szSetting, SIZEOF(szSetting), "ColWidth%d", i); lvc.cx = DBGetContactSettingWord(NULL, "FindAdd", szSetting, defaultColumnSizes[i]); ListView_InsertColumn(hwndResults, i, (LPARAM)&lvc); - + if (bNeedsFree) mir_free(lvc.pszText); } @@ -105,7 +105,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) if (columnOrder[i] == -1 || columnOrder[i] >= NUM_COLUMNID) colOrdersValid = false; } - if (colOrdersValid) + if (colOrdersValid) ListView_SetColumnOrderArray(hwndResults, columnCount, columnOrder); dat->iLastColumnSortIndex = DBGetContactSettingByte(NULL, "FindAdd", "SortColumn", COLUMNID_NICK); @@ -159,7 +159,7 @@ int CALLBACK SearchResultsCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lPa return lstrcmpi(lsr1->psr.email, lsr2->psr.email)*sortMultiplier; } } - else + else { TCHAR szText1[100]; TCHAR szText2[100]; @@ -196,8 +196,8 @@ static void BeginSearchFailed(void * arg) TCHAR buf[128]; if ( arg != NULL ) { const TCHAR* protoName = (TCHAR*)arg; - mir_sntprintf(buf, SIZEOF(buf), - TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"), + mir_sntprintf(buf, SIZEOF(buf), + TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"), protoName, protoName); mir_free((char*)arg); } @@ -267,9 +267,9 @@ void SetStatusBarSearchInfo(HWND hwndStatus, struct FindAddDlgData *dat) lstrcat(str, pa->tszAccountName ); } } else lstrcpy(str, TranslateT("Idle")); - + SendMessage( hwndStatus, SB_SETTEXT, 0, (LPARAM)str ); -} +} struct ProtoResultsSummary { const char *szProto; @@ -360,7 +360,7 @@ void ShowMoreOptionsMenu(HWND hwndDlg, int x, int y) hMenu=LoadMenu(hMirandaInst, MAKEINTRESOURCE(IDR_CONTEXT)); hPopupMenu=GetSubMenu(hMenu, 4); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hPopupMenu, 0); + TranslateMenu(hPopupMenu); commandId=TrackPopupMenu(hPopupMenu, TPM_RIGHTBUTTON|TPM_RETURNCMD, x, y, 0, hwndDlg, NULL); switch(commandId) { case IDC_ADD: @@ -389,5 +389,3 @@ void ShowMoreOptionsMenu(HWND hwndDlg, int x, int y) DestroyMenu(hPopupMenu); DestroyMenu(hMenu); } - - diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp index 2e328bbb89..2c2776d523 100644 --- a/src/modules/icolib/skin2icons.cpp +++ b/src/modules/icolib/skin2icons.cpp @@ -1031,7 +1031,7 @@ static int OpenPopupMenu(HWND hwndDlg) GetCursorPos(&pt); hMenu = LoadMenu( hMirandaInst, MAKEINTRESOURCE( IDR_ICOLIB_CONTEXT )); hPopup = GetSubMenu( hMenu, 0 ); - CallService( MS_LANGPACK_TRANSLATEMENU, ( WPARAM )hPopup, 0 ); + TranslateMenu(hPopup); cmd = TrackPopupMenu( hPopup, TPM_RIGHTBUTTON|TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL ); DestroyMenu( hMenu ); return cmd; diff --git a/src/modules/srurl/urldialogs.cpp b/src/modules/srurl/urldialogs.cpp index 54ef22c5cc..8e6be8347a 100644 --- a/src/modules/srurl/urldialogs.cpp +++ b/src/modules/srurl/urldialogs.cpp @@ -168,7 +168,7 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP hMenu=LoadMenu(hMirandaInst, MAKEINTRESOURCE(IDR_CONTEXT)); hSubMenu=GetSubMenu(hMenu, 6); - CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hSubMenu, 0); + TranslateMenu(hSubMenu); GetWindowRect((HWND)lParam, &rc); GetDlgItemTextA(hwndDlg, IDC_URL, url, SIZEOF(url)); switch(TrackPopupMenu(hSubMenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL)) { -- cgit v1.2.3