From 995af9f867a98c81701e5b2c5ee42cf665b21bc5 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sat, 22 Mar 2014 23:04:42 +0000 Subject: Sametime: translation fixes and fixes for disabled people git-svn-id: http://svn.miranda-ng.org/main/trunk@8698 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Sametime/src/options.cpp | 28 +++++++++++++--------------- protocols/Sametime/src/sametime.cpp | 18 +++++++++--------- 2 files changed, 22 insertions(+), 24 deletions(-) (limited to 'protocols/Sametime/src') diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index d882233f48..0b73c398d3 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -5,6 +5,7 @@ #define DEFAULT_ID (0x1800) #define NUM_IDS 20 + TCHAR* client_names[NUM_IDS] = { _T("Official Binary Library"), _T("Official Java Applet"), @@ -63,24 +64,21 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); proto = (CSametimeProto*)lParam; - { + WORD client_ver = proto->GetClientVersion(); + if (client_ver) { TCHAR verbuf[100]; - WORD client_ver = proto->GetClientVersion(); - WORD server_ver = proto->GetServerVersion(); - if (client_ver) - mir_sntprintf(verbuf, SIZEOF(verbuf), _T("Client proto version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF); - else - mir_sntprintf(verbuf, SIZEOF(verbuf), _T("Disconnected")); + mir_sntprintf(verbuf, SIZEOF(verbuf), TranslateT("Client proto version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF); SetDlgItemText(hwndDlg, IDC_ST_CLIENTVER, verbuf); - if (server_ver) - mir_sntprintf(verbuf, SIZEOF(verbuf), _T("Server proto version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF); - else - mir_sntprintf(verbuf, SIZEOF(verbuf), _T("Disconnected")); + } + + WORD server_ver = proto->GetServerVersion(); + if (server_ver) { + TCHAR verbuf[100]; + mir_sntprintf(verbuf, SIZEOF(verbuf), TranslateT("Server proto version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF); SetDlgItemText(hwndDlg, IDC_ST_SERVERVER, verbuf); } - TCHAR* s; - s = mir_utf8decodeT(proto->options.server_name); SetDlgItemText(hwndDlg, IDC_ED_SNAME, s); mir_free(s); + TCHAR *s = mir_utf8decodeT(proto->options.server_name); SetDlgItemText(hwndDlg, IDC_ED_SNAME, s); mir_free(s); s = mir_utf8decodeT(proto->options.id); SetDlgItemText(hwndDlg, IDC_ED_NAME, s); mir_free(s); s = mir_utf8decodeT(proto->options.pword); SetDlgItemText(hwndDlg, IDC_ED_PWORD, s); mir_free(s); @@ -291,10 +289,10 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA return FALSE; } -int CSametimeProto::OptInit(WPARAM wParam, LPARAM lParam) +int CSametimeProto::OptInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; + odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; odp.hInstance = hInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTNET); odp.ptszTitle = m_tszUserName; diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 87bf29c5d9..133d173ffa 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -76,10 +76,10 @@ INT_PTR CSametimeProto::SametimeLoadIcon(WPARAM wParam, LPARAM lParam) id = IDI_ICON_PROTO; break; default: - return (int) (HICON) NULL; + return NULL; } - return (int) LoadImage(hInst, MAKEINTRESOURCE(id), IMAGE_ICON, + return (INT_PTR) LoadImage(hInst, MAKEINTRESOURCE(id), IMAGE_ICON, GetSystemMetrics(wParam & PLIF_SMALL ? SM_CXSMICON : SM_CXICON), GetSystemMetrics(wParam & PLIF_SMALL ? SM_CYSMICON : SM_CYICON), 0); return 0; @@ -126,7 +126,7 @@ void ReleaseIconEx(const char* name, BOOL big) // Copied from MSN plugin - sent acks need to be from different thread -void __cdecl sttFakeAckInfoSuccessThread(void* param) +void __cdecl sttFakeAckInfoSuccessThread(void *param) { TFakeAckParams* tParam = (TFakeAckParams*)param; CSametimeProto* proto = tParam->proto; @@ -140,7 +140,7 @@ void __cdecl sttFakeAckInfoSuccessThread(void* param) return; } -void __cdecl sttFakeAckMessageSuccessThread(void* param) +void __cdecl sttFakeAckMessageSuccessThread(void *param) { TFakeAckParams* tParam = (TFakeAckParams*)param; CSametimeProto* proto = tParam->proto; @@ -154,7 +154,7 @@ void __cdecl sttFakeAckMessageSuccessThread(void* param) return; } -void __cdecl sttFakeAckMessageFailedThread(void* param) +void __cdecl sttFakeAckMessageFailedThread(void *param) { TFakeAckParams* tParam = (TFakeAckParams*)param; CSametimeProto* proto = tParam->proto; @@ -168,7 +168,7 @@ void __cdecl sttFakeAckMessageFailedThread(void* param) return; } -void __cdecl sttRecvAwayThread(void* param) +void __cdecl sttRecvAwayThread(void *param) { TFakeAckParams* tParam = (TFakeAckParams*)param; CSametimeProto* proto = tParam->proto; @@ -183,7 +183,7 @@ void __cdecl sttRecvAwayThread(void* param) } -int CSametimeProto::OnWindowEvent(WPARAM wParam, LPARAM lParam) +int CSametimeProto::OnWindowEvent(WPARAM, LPARAM lParam) { MessageWindowEventData* mwed = (MessageWindowEventData*)lParam; @@ -196,7 +196,7 @@ int CSametimeProto::OnWindowEvent(WPARAM wParam, LPARAM lParam) return 0; } -int CSametimeProto::OnIdleChanged(WPARAM wParam, LPARAM lParam) +int CSametimeProto::OnIdleChanged(WPARAM, LPARAM lParam) { if (!(lParam & IDF_PRIVACY)) { is_idle = lParam & IDF_ISIDLE ? true : false; @@ -217,7 +217,7 @@ int CSametimeProto::OnPreShutdown(WPARAM wParam, LPARAM lParam) } -int CSametimeProto::OnSametimeContactDeleted(WPARAM wParam, LPARAM lParam) +int CSametimeProto::OnSametimeContactDeleted(WPARAM wParam, LPARAM) { MCONTACT hContact = wParam; ContactDeleted(hContact); -- cgit v1.2.3