diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-04-30 08:20:16 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-04-30 08:20:16 +0000 |
commit | d373118fad0c3567cfce3817ce363176274a3930 (patch) | |
tree | 850aafb45079b7a6c7468a61a641e49c25db6af7 /protocols/Skype/src | |
parent | 53a415159610fdc005db6c3289bf614d25c3d78e (diff) |
added all own info exept timezone
git-svn-id: http://svn.miranda-ng.org/main/trunk@4571 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src')
-rw-r--r-- | protocols/Skype/src/resource.h | 16 | ||||
-rw-r--r-- | protocols/Skype/src/skype_dialogs.cpp | 182 |
2 files changed, 190 insertions, 8 deletions
diff --git a/protocols/Skype/src/resource.h b/protocols/Skype/src/resource.h index 57d21f5aab..a8425e9e65 100644 --- a/protocols/Skype/src/resource.h +++ b/protocols/Skype/src/resource.h @@ -45,13 +45,27 @@ #define IDC_PASSWORD2 1023
#define IDC_INSTRUCTION3 1024
#define IDC_FULLNAME 1025
+#define IDC_EMAIL1 1025
#define IDC_BIRTH_DAY 1026
+#define IDC_EMAIL2 1026
#define IDC_BIRTH_MONTH 1027
+#define IDC_EMAIL3 1027
#define IDC_BIRTH_YEAR 1028
+#define IDC_MOBPHONE 1028
#define IDC_GENDER 1029
+#define IDC_HOMEPHONE 1029
#define IDC_HOMEPAGE 1030
+#define IDC_HOMEPHONE2 1030
+#define IDC_OFFICEPHONE 1030
#define IDC_LANGUAGE 1031
#define IDC_ABOUT 1034
+#define IDC_ABOUT2 1035
+#define IDC_MOOD 1035
+#define IDC_CITY 1036
+#define IDC_STATE 1037
+#define IDC_COUNTRY 1038
+#define IDC_COUNTRY2 1039
+#define IDC_TIMEZONE 1039
// Next default values for new objects
//
@@ -59,7 +73,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 110
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1025
+#define _APS_NEXT_CONTROL_VALUE 1029
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/protocols/Skype/src/skype_dialogs.cpp b/protocols/Skype/src/skype_dialogs.cpp index db11fcf337..d75aff64ca 100644 --- a/protocols/Skype/src/skype_dialogs.cpp +++ b/protocols/Skype/src/skype_dialogs.cpp @@ -419,7 +419,6 @@ 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);
switch (msg) {
@@ -458,9 +457,9 @@ static INT_PTR CALLBACK PersonalSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar {
const wchar_t* value = it->second.c_str();
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));
+ int ii = it->second.compare(lang);
+ if(it->second.compare(lang) == 0)
+ SetDlgItemText(hwndDlg, IDC_LANGUAGE, TranslateTS(value));
}
DBVARIANT dbv;
if ( !db_get_ts(NULL, ppro->m_szModuleName, "Nick", &dbv)) {
@@ -484,6 +483,13 @@ static INT_PTR CALLBACK PersonalSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar else
SetDlgItemText(hwndDlg, IDC_ABOUT, _T(""));
+ if ( !db_get_ts(NULL, ppro->m_szModuleName, "XStatusMsg", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_MOOD, dbv.ptszVal);
+ db_free(&dbv);
+ }
+ else
+ SetDlgItemText(hwndDlg, IDC_ABOUT, _T(""));
+
BYTE b = db_get_b(NULL, ppro->m_szModuleName, "Gender", 0);
if (b = 'M')
SetDlgItemText(hwndDlg, IDC_GENDER, TranslateT("Male"));
@@ -505,7 +511,9 @@ static INT_PTR CALLBACK PersonalSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar case WM_COMMAND:
if (((HWND)lParam==GetFocus() && HIWORD(wParam)==EN_CHANGE) ||
- ((HWND)lParam==GetDlgItem(hwndDlg, IDC_GENDER) && (HIWORD(wParam)==CBN_EDITCHANGE||HIWORD(wParam)==CBN_SELCHANGE)))
+ (((HWND)lParam==GetDlgItem(hwndDlg, IDC_GENDER) || (HWND)lParam==GetDlgItem(hwndDlg, IDC_BIRTH_DAY) ||
+ (HWND)lParam==GetDlgItem(hwndDlg, IDC_BIRTH_MONTH) || (HWND)lParam==GetDlgItem(hwndDlg, IDC_BIRTH_YEAR) ||
+ (HWND)lParam==GetDlgItem(hwndDlg, IDC_LANGUAGE)) && (HIWORD(wParam)==CBN_EDITCHANGE||HIWORD(wParam)==CBN_SELCHANGE)))
{
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
@@ -515,14 +523,163 @@ static INT_PTR CALLBACK PersonalSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar if (((LPNMHDR)lParam)->idFrom == 0) {
switch (((LPNMHDR)lParam)->code) {
case PSN_PARAMCHANGED:
- SendMessage(hwndDlg, WM_INITDIALOG, 0, ((PSHNOTIFY*)lParam)->lParam);
+ SendMessage(hwndDlg, WM_INITDIALOG, 0, ((PSHNOTIFY *)lParam)->lParam);
+ break;
+ case PSN_APPLY:
+ //ppro->SaveVcardToDB(hwndDlg, iPageId);
+ //if ( !ppro->m_vCardUpdates)
+ // ppro->SetServerVcard(ppro->m_bPhotoChanged, ppro->m_szPhotoFileName);
+ break;
+ }
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static INT_PTR CALLBACK ContactSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ CSkypeProto *ppro = (CSkypeProto *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (msg) {
+ case WM_INITDIALOG:
+ if (lParam) {
+ ppro = (CSkypeProto *)lParam;
+ TranslateDialogDefault(hwndDlg);
+
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+
+ DBVARIANT dbv;
+ if ( !db_get_ts(NULL, ppro->m_szModuleName, "Cellular", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_MOBPHONE, dbv.ptszVal);
+ db_free(&dbv);
+ }
+ else
+ SetDlgItemText(hwndDlg, IDC_MOBPHONE, _T(""));
+
+ if ( !db_get_ts(NULL, ppro->m_szModuleName, "Phone", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_HOMEPHONE, dbv.ptszVal);
+ db_free(&dbv);
+ }
+ else
+ SetDlgItemText(hwndDlg, IDC_HOMEPHONE, _T(""));
+
+ if ( !db_get_ts(NULL, ppro->m_szModuleName, "CompanyPhone", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_OFFICEPHONE, dbv.ptszVal);
+ db_free(&dbv);
+ }
+ else
+ SetDlgItemText(hwndDlg, IDC_OFFICEPHONE, _T(""));
+
+ if ( !db_get_ts(NULL, ppro->m_szModuleName, "e-mail0", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_EMAIL1, dbv.ptszVal);
+ db_free(&dbv);
+ }
+ else
+ SetDlgItemText(hwndDlg, IDC_EMAIL1, _T(""));
+
+ if ( !db_get_ts(NULL, ppro->m_szModuleName, "e-mail1", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_EMAIL2, dbv.ptszVal);
+ db_free(&dbv);
+ }
+ else
+ SetDlgItemText(hwndDlg, IDC_EMAIL2, _T(""));
+
+ if ( !db_get_ts(NULL, ppro->m_szModuleName, "e-mail2", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_EMAIL3, dbv.ptszVal);
+ db_free(&dbv);
+ }
+ else
+ SetDlgItemText(hwndDlg, IDC_EMAIL3, _T(""));
+ }
+ break;
+
+ case WM_COMMAND:
+ if ((HWND)lParam == GetFocus() && HIWORD(wParam) == EN_CHANGE)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->idFrom == 0) {
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_PARAMCHANGED:
+ SendMessage(hwndDlg, WM_INITDIALOG, 0, ((PSHNOTIFY *)lParam)->lParam);
+ break;
+ case PSN_APPLY:
+ //ppro->SaveVcardToDB(hwndDlg, iPageId);
+ //if ( !ppro->m_vCardUpdates)
+ // ppro->SetServerVcard(ppro->m_bPhotoChanged, ppro->m_szPhotoFileName);
+ break;
+ }
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static INT_PTR CALLBACK HomeSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ CSkypeProto *ppro = (CSkypeProto *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (msg) {
+ case WM_INITDIALOG:
+ if (lParam) {
+ ppro = (CSkypeProto *)lParam;
+ TranslateDialogDefault(hwndDlg);
+
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+
+ DBVARIANT dbv;
+ if ( !db_get_ts(NULL, ppro->m_szModuleName, "City", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_CITY, dbv.ptszVal);
+ db_free(&dbv);
+ }
+ else
+ SetDlgItemText(hwndDlg, IDC_MOBPHONE, _T(""));
+
+ if ( !db_get_ts(NULL, ppro->m_szModuleName, "State", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_STATE, dbv.ptszVal);
+ db_free(&dbv);
+ }
+ else
+ SetDlgItemText(hwndDlg, IDC_STATE, _T(""));
+
+ int g_cbCountries;
+ struct CountryListEntry* g_countries;
+ CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&g_cbCountries, (LPARAM)&g_countries);
+ wchar_t *countr = ::db_get_wsa(NULL, ppro->m_szModuleName, "Country");
+ for (int i = 0; i < g_cbCountries; i++) {
+ if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) {
+ TCHAR *country = mir_a2t(g_countries[i].szName);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COUNTRY), CB_ADDSTRING, 0, (LPARAM)TranslateTS(country));
+ if (_tcscmp(country, countr) == 0)
+ SetDlgItemText(hwndDlg, IDC_COUNTRY, TranslateTS(country));
+ mir_free(country);
+ }
+ }
+
+ tmi.prepareList((HANDLE)lParam, GetDlgItem(hwndDlg, IDC_TIMEZONE), TZF_PLF_CB);
+ }
+ break;
+
+ case WM_COMMAND:
+ if ((HWND)lParam == GetFocus() && HIWORD(wParam) == EN_CHANGE)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->idFrom == 0) {
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_PARAMCHANGED:
+ SendMessage(hwndDlg, WM_INITDIALOG, 0, ((PSHNOTIFY *)lParam)->lParam);
break;
case PSN_APPLY:
//ppro->SaveVcardToDB(hwndDlg, iPageId);
//if ( !ppro->m_vCardUpdates)
// ppro->SetServerVcard(ppro->m_bPhotoChanged, ppro->m_szPhotoFileName);
break;
- } }
+ }
+ }
break;
}
return FALSE;
@@ -550,8 +707,19 @@ int __cdecl CSkypeProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) UserInfo_AddPage(wParam, &odp);
}
} else {
+ odp.pfnDlgProc = ContactSkypeDlgProc;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OWNINFO_CONTACT);
+ odp.ptszTab = LPGENT("Contacts");
+ UserInfo_AddPage(wParam, &odp);
+
+ odp.pfnDlgProc = HomeSkypeDlgProc;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OWNINFO_HOME);
+ odp.ptszTab = LPGENT("Home");
+ UserInfo_AddPage(wParam, &odp);
+
odp.pfnDlgProc = PersonalSkypeDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OWNINFO_PERSONAL);
+ odp.ptszTab = LPGENT("General");
UserInfo_AddPage(wParam, &odp);
}
|