From 343ed18d264ae1b90eda3c64ffb066035997489f Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 10 Jul 2013 18:51:18 +0000 Subject: options page for privacy settings git-svn-id: http://svn.miranda-ng.org/main/trunk@5312 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/resource.h | 14 +++++- protocols/Skype/src/skype_dialogs.cpp | 81 +++++++++++++++++++++++++++++++++++ protocols/Skype/src/skype_events.cpp | 10 +++++ protocols/Skype/src/skype_proto.h | 4 +- 4 files changed, 107 insertions(+), 2 deletions(-) (limited to 'protocols/Skype/src') diff --git a/protocols/Skype/src/resource.h b/protocols/Skype/src/resource.h index fb2e2359e4..508353d960 100644 --- a/protocols/Skype/src/resource.h +++ b/protocols/Skype/src/resource.h @@ -16,6 +16,8 @@ #define IDD_OPT_BLOCKED 20 #define IDD_IGNORE_LIST 21 #define IDD_BLOCK 22 +#define IDD_OWNINFO_ACCOUNT 23 +#define IDD_OPT_PRIVACY 24 #define IDI_SKYPE 101 #define IDR_RUNTIME 102 #define IDR_KEY 107 @@ -92,6 +94,16 @@ #define IDC_HEADERBAR 1063 #define IDC_BM_LIST 1064 #define IDC_LIST 1065 +#define IDC_PRIVACY_IM_ANYONE 1066 +#define IDC_PRIVACY_IM_CONTACTLIST 1067 +#define IDC_PRIVACY_CALL_ANYONE 1068 +#define IDC_PRIVACY_CALL_CONTACTLIST 1069 +#define IDC_PRIVACY_SHARE_ANYONE 1070 +#define IDC_PRIVACY_SHARE_CONTACTLIST 1071 +#define IDC_PRIVACY_SHARE_NOONE 1072 +#define IDC_PRIVACY_WEB 1073 +#define IDC_CREDITVALUE 1074 +#define IDC_CREDITCURRENCY 1075 // Next default values for new objects // @@ -99,7 +111,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 118 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1066 +#define _APS_NEXT_CONTROL_VALUE 1076 #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 427c924c7f..010e599ec4 100644 --- a/protocols/Skype/src/skype_dialogs.cpp +++ b/protocols/Skype/src/skype_dialogs.cpp @@ -187,6 +187,45 @@ INT_PTR CALLBACK CSkypeProto::SkypeMainOptionsProc(HWND hwnd, UINT message, WPAR return FALSE; } +INT_PTR CALLBACK CSkypeProto::SkypePrivacyOptionsProc(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; + ::SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); + + ::TranslateDialogDefault(hwndDlg); + } + break; + + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + } + } + break; + + case WM_NOTIFY: + if (reinterpret_cast(lParam)->code == PSN_APPLY && !ppro->IsOnline()) + { + return TRUE; + } + break; + + switch(LOWORD(wParam)) + { + } + break; + } + return FALSE; +} + INT_PTR CALLBACK CSkypeProto::SkypePasswordRequestProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { PasswordRequestBoxParam *param = reinterpret_cast(::GetWindowLongPtr(hwndDlg, GWLP_USERDATA)); @@ -764,6 +803,48 @@ INT_PTR CALLBACK CSkypeProto::HomeSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wP } 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: + if (ppro->IsOnline() && ppro->NeedUpdate) + ppro->SaveOwnInfoToServer(hwndDlg, iPageId); + else if ( !ppro->IsOnline()) + ppro->ShowNotification(::TranslateT("You are not currently connected to the Skype network. You must be online in order to update your information on the server.")); + break; + } + } + break; + } + return FALSE; +} + +INT_PTR CALLBACK CSkypeProto::AccountSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + const unsigned long iPageId = 3; + CSkypeProto *ppro = (CSkypeProto *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + + switch (msg) { + case WM_INITDIALOG: + if (lParam) { + ppro = (CSkypeProto *)lParam; + ::TranslateDialogDefault(hwndDlg); + + ::SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); + } + break; + + case WM_COMMAND: + if (((HWND)lParam == GetFocus() && HIWORD(wParam) == EN_CHANGE)) + { + ppro->NeedUpdate = 1; + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + } + break; + case WM_NOTIFY: if (((LPNMHDR)lParam)->idFrom == 0) { switch (((LPNMHDR)lParam)->code) { diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp index 3a9f8a3a99..59848a66aa 100644 --- a/protocols/Skype/src/skype_events.cpp +++ b/protocols/Skype/src/skype_events.cpp @@ -119,6 +119,11 @@ int __cdecl CSkypeProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) odp.pfnDlgProc = CSkypeProto::SkypeBlockedOptionsProc; ::Options_AddPage(wParam, &odp); + odp.pszTab = LPGEN("Privacy"); + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_PRIVACY); + odp.pfnDlgProc = CSkypeProto::SkypePrivacyOptionsProc; + ::Options_AddPage(wParam, &odp); + ::mir_free(title); return 0; } @@ -164,6 +169,11 @@ int __cdecl CSkypeProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OWNINFO_PERSONAL); odp.ptszTab = LPGENT("General"); UserInfo_AddPage(wParam, &odp); + + odp.pfnDlgProc = AccountSkypeDlgProc; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OWNINFO_ACCOUNT); + odp.ptszTab = LPGENT("Skype account"); + UserInfo_AddPage(wParam, &odp); } return 0; diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index c576d68bbe..97ae2c8143 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -502,11 +502,13 @@ protected: static INT_PTR CALLBACK SkypePasswordRequestProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); static INT_PTR CALLBACK SkypePasswordChangeProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); static INT_PTR CALLBACK ChatRoomProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK SkypePrivacyOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); static INT_PTR CALLBACK SkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); static INT_PTR CALLBACK PersonalSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); static INT_PTR CALLBACK ContactSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); - static INT_PTR CALLBACK HomeSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK HomeSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK AccountSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); // skype runtime char *LoadKeyPair(); -- cgit v1.2.3