From eb7b026241099ac8c5d6e3b295df8cb88c1cf276 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 18 Nov 2012 14:06:20 +0000 Subject: some code for own info git-svn-id: http://svn.miranda-ng.org/main/trunk@2353 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_dialogs.cpp | 34 ++++++++++++++++++++++++++++++++++ protocols/Skype/src/skype_profile.cpp | 19 +++++++++++++++++-- protocols/Skype/src/skype_proto.h | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 2 deletions(-) (limited to 'protocols') diff --git a/protocols/Skype/src/skype_dialogs.cpp b/protocols/Skype/src/skype_dialogs.cpp index 4e57273320..092a17f927 100644 --- a/protocols/Skype/src/skype_dialogs.cpp +++ b/protocols/Skype/src/skype_dialogs.cpp @@ -321,6 +321,40 @@ INT_PTR CALLBACK CSkypeProto::SkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam INT_PTR CALLBACK CSkypeProto::OwnSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { + switch(msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST); + ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT); + /*LOGFONT lf; + GetObject((HFONT)SendMessage(hwndList, WM_GETFONT, 0, 0), sizeof(lf), &lf); + lf.lfHeight -= 5; + HFONT hFont = CreateFontIndirect(&lf); + SendMessage(hwndList, WM_SETFONT, (WPARAM)hFont, 0);*/ + // Prepare ListView Columns + LV_COLUMN lvc = {0}; + RECT rc; + GetClientRect(hwndList, &rc); + rc.right -= GetSystemMetrics(SM_CXVSCROLL); + lvc.mask = LVCF_WIDTH; + lvc.cx = rc.right / 3; + ListView_InsertColumn(hwndList, 0, &lvc); + lvc.cx = rc.right - lvc.cx; + ListView_InsertColumn(hwndList, 1, &lvc); + // Prepare Setting Items + LV_ITEM lvi = {0}; + lvi.mask = LVIF_PARAM | LVIF_TEXT; + + for (lvi.iItem = 0; lvi.iItem < SIZEOF(setting); lvi.iItem++) + { + lvi.lParam = lvi.iItem; + lvi.pszText = (LPTSTR)setting[lvi.iItem].szDescription; + ListView_InsertItem(hwndList, &lvi); + } + + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + return TRUE; + } return FALSE; } diff --git a/protocols/Skype/src/skype_profile.cpp b/protocols/Skype/src/skype_profile.cpp index a0e72d1f37..1554c47114 100644 --- a/protocols/Skype/src/skype_profile.cpp +++ b/protocols/Skype/src/skype_profile.cpp @@ -2,7 +2,7 @@ void CSkypeProto::UpdateOwnAvatar() { - uint newTS = 0; + /*uint newTS = 0; this->account->GetPropAvatarTimestamp(newTS); DWORD oldTS = this->GetSettingDword("AvatarTS"); if (newTS > oldTS) @@ -31,7 +31,7 @@ void CSkypeProto::UpdateOwnAvatar() } delete path; } - } + }*/ } void CSkypeProto::UpdateOwnBirthday() @@ -278,6 +278,17 @@ void CSkypeProto::UpdateOwnTimezone() this->DeleteSetting("TimeZone"); } +void CSkypeProto::UpdateOwnAbout() +{ + SEString data; + this->account->GetPropAbout(data); + wchar_t* about = ::mir_utf8decodeW((const char*)data); + if (wcscmp(about, L"") == 0) + this->DeleteSetting("About"); + else + this->SetSettingString("About", about); + ::mir_free(about); +} void CSkypeProto::UpdateOwnProfile() { uint newTS = 0; @@ -300,6 +311,7 @@ void CSkypeProto::UpdateOwnProfile() this->UpdateOwnState(); this->UpdateOwnStatusMessage(); this->UpdateOwnTimezone(); + this->UpdateOwnAbout(); this->SetSettingDword("ProfileTS", newTS); } @@ -359,6 +371,9 @@ void CSkypeProto::OnAccountChanged(int prop) case CAccount::P_FULLNAME: this->UpdateOwnNickName(); break; + case CAccount::P_ABOUT: + this->UpdateOwnAbout(); + break; } } diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index 9df51105cf..19f8d35657 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -24,6 +24,37 @@ struct LanguagesListEntry { char ISOcode[3]; }; +struct SettingItem +{ + const TCHAR *szDescription; + const char *szDbSetting; +}; + +const SettingItem setting[]={ + {LPGENT("Full name"), "Nick"}, + {LPGENT("Mood"), "XStatusMsg"}, + + {LPGENT("Mobile phone"), "Cellular"}, + {LPGENT("Home phone"), "Phone"}, + {LPGENT("Office phone"), "CompanyPhone"}, + {LPGENT("E-mail 1"), "e-mail0"}, + {LPGENT("E-mail 2"), "e-mail1"}, + {LPGENT("E-mail 3"), "e-mail2"}, + + {LPGENT("Country"), "Country"}, + {LPGENT("State"), "State"}, + {LPGENT("City"), "City"}, + {LPGENT("Time zone"), "Timezone"}, + {LPGENT("Homepage"), "Homepage"}, + {LPGENT("Gender"), "Gender"}, + {LPGENT("Birth day"), "BirthDay"}, + {LPGENT("Birth month"), "BirthMonth"}, + {LPGENT("Birth year"), "BirthYear"}, + {LPGENT("Language"), "Language1"}, + + {LPGENT("About"), "About"} +}; + struct CSkypeProto : public PROTO_INTERFACE, public MZeroedObject { public: @@ -193,6 +224,7 @@ protected: void UpdateOwnStatusMessage(); void UpdateOwnTimezone(); void UpdateOwnProfile(); + void UpdateOwnAbout(); void OnAccountChanged(int prop); -- cgit v1.2.3