From 53a415159610fdc005db6c3289bf614d25c3d78e Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 29 Apr 2013 21:26:28 +0000 Subject: language only one current version doesn't working git-svn-id: http://svn.miranda-ng.org/main/trunk@4570 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/res/Resource.rc | 8 ++------ protocols/Skype/src/resource.h | 5 +---- protocols/Skype/src/skype_dialogs.cpp | 12 +++++++----- 3 files changed, 10 insertions(+), 15 deletions(-) (limited to 'protocols') diff --git a/protocols/Skype/res/Resource.rc b/protocols/Skype/res/Resource.rc index 7bcb2392a1..4c5eb2b759 100644 --- a/protocols/Skype/res/Resource.rc +++ b/protocols/Skype/res/Resource.rc @@ -116,12 +116,8 @@ BEGIN COMBOBOX IDC_GENDER,58,32,62,52,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP LTEXT "Homepage:",IDC_STATIC,6,119,51,8 EDITTEXT IDC_HOMEPAGE,58,117,159,12,ES_AUTOHSCROLL - LTEXT "Language 1:",IDC_STATIC,6,47,51,8 - COMBOBOX IDC_LANGUAGE1,58,46,86,52,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "Language 2:",IDC_STATIC,5,62,51,8 - COMBOBOX IDC_LANGUAGE2,58,60,85,52,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - LTEXT "Language 3:",IDC_STATIC,5,76,51,8 - COMBOBOX IDC_LANGUAGE3,58,74,85,52,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + LTEXT "Language:",IDC_STATIC,6,47,51,8 + COMBOBOX IDC_LANGUAGE,58,46,86,52,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP LTEXT "About:",IDC_STATIC,5,90,51,8 EDITTEXT IDC_ABOUT,57,88,159,24,ES_MULTILINE | WS_VSCROLL END diff --git a/protocols/Skype/src/resource.h b/protocols/Skype/src/resource.h index 683064baaf..57d21f5aab 100644 --- a/protocols/Skype/src/resource.h +++ b/protocols/Skype/src/resource.h @@ -50,10 +50,7 @@ #define IDC_BIRTH_YEAR 1028 #define IDC_GENDER 1029 #define IDC_HOMEPAGE 1030 -#define IDC_LANGUAGE1 1031 -#define IDC_LANGUAGE2 1032 -#define IDC_LANGUAGE3 1033 -#define IDC_HOMEPAGE2 1034 +#define IDC_LANGUAGE 1031 #define IDC_ABOUT 1034 // Next default values for new objects diff --git a/protocols/Skype/src/skype_dialogs.cpp b/protocols/Skype/src/skype_dialogs.cpp index 1b7542f0bf..db11fcf337 100644 --- a/protocols/Skype/src/skype_dialogs.cpp +++ b/protocols/Skype/src/skype_dialogs.cpp @@ -420,12 +420,12 @@ INT_PTR CALLBACK CSkypeProto::SkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam static INT_PTR CALLBACK PersonalSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { const unsigned long iPageId = 0; - CSkypeProto* ppro = (CSkypeProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + CSkypeProto *ppro = (CSkypeProto *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: if (lParam) { - ppro = (CSkypeProto*)lParam; + ppro = (CSkypeProto *)lParam; TranslateDialogDefault(hwndDlg); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); @@ -453,12 +453,14 @@ static INT_PTR CALLBACK PersonalSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar } + wchar_t *lang = ::db_get_wsa(NULL, ppro->m_szModuleName, "Language1"); for (std::map::iterator it = CSkypeProto::languages.begin(); it != CSkypeProto::languages.end(); ++it) { const wchar_t* value = it->second.c_str(); - SendMessage(GetDlgItem(hwndDlg, IDC_LANGUAGE1), CB_ADDSTRING, 0, (LPARAM)value); - SendMessage(GetDlgItem(hwndDlg, IDC_LANGUAGE2), CB_ADDSTRING, 0, (LPARAM)value); - SendMessage(GetDlgItem(hwndDlg, IDC_LANGUAGE3), CB_ADDSTRING, 0, (LPARAM)value); + SendMessage(GetDlgItem(hwndDlg, IDC_LANGUAGE), CB_ADDSTRING, 0, (LPARAM)TranslateTS(value)); + if ( !lang || !::wcslen(lang)) + if ( !lstrcmp(lang, value)) + SetDlgItemText(hwndDlg, IDC_LANGUAGE, TranslateTS(value)); } DBVARIANT dbv; if ( !db_get_ts(NULL, ppro->m_szModuleName, "Nick", &dbv)) { -- cgit v1.2.3