diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-06-17 09:20:49 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-06-17 09:20:49 +0000 |
commit | 5b81eaa46fd18c6b3b0bf4a102b0f863232b6866 (patch) | |
tree | 0b10473f0092711b0bae86be0ad69e4d4d93ccae /protocols | |
parent | 5338cdcb3caa60be15a0c989fe3c453c521421e6 (diff) |
Skype: Password change dialog improvements. Fixed options button in Accounts dialog.
git-svn-id: http://svn.miranda-ng.org/main/trunk@4996 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Skype/Skype_10.vcxproj | 9 | ||||
-rw-r--r-- | protocols/Skype/Skype_10.vcxproj.filters | 3 | ||||
-rw-r--r-- | protocols/Skype/res/Resource.rc | 14 | ||||
-rw-r--r-- | protocols/Skype/src/skype_dialogs.cpp | 39 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.cpp | 3 |
5 files changed, 46 insertions, 22 deletions
diff --git a/protocols/Skype/Skype_10.vcxproj b/protocols/Skype/Skype_10.vcxproj index 34ba2d3066..7d1f72e2e3 100644 --- a/protocols/Skype/Skype_10.vcxproj +++ b/protocols/Skype/Skype_10.vcxproj @@ -216,35 +216,27 @@ <ClCompile Include="src\skype.cpp" />
<ClCompile Include="src\skypekit\account.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\contact.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\conversation.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\group.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\message.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\participant.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\search.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skypekit\transfer.cpp">
<PrecompiledHeaderFile>..\skype.h</PrecompiledHeaderFile>
-
</ClCompile>
<ClCompile Include="src\skype_account.cpp" />
<ClCompile Include="src\skype_avatars.cpp" />
@@ -288,6 +280,7 @@ <None Include="res\conf_invite.ico" />
<None Include="res\conf_spawn.ico" />
<None Include="res\main.ico" />
+ <None Include="res\send_contacts.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/protocols/Skype/Skype_10.vcxproj.filters b/protocols/Skype/Skype_10.vcxproj.filters index 89bd5c501e..35857ae69e 100644 --- a/protocols/Skype/Skype_10.vcxproj.filters +++ b/protocols/Skype/Skype_10.vcxproj.filters @@ -207,5 +207,8 @@ <None Include="res\conf_spawn.ico">
<Filter>Resource Files\Icons</Filter>
</None>
+ <None Include="res\send_contacts.ico">
+ <Filter>Resource Files\Icons</Filter>
+ </None>
</ItemGroup>
</Project>
\ No newline at end of file diff --git a/protocols/Skype/res/Resource.rc b/protocols/Skype/res/Resource.rc index 25c4585c6f..1ab8bdbb5a 100644 --- a/protocols/Skype/res/Resource.rc +++ b/protocols/Skype/res/Resource.rc @@ -17,7 +17,7 @@ #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-#pragma code_page(1251)
+#pragma code_page(1250)
/////////////////////////////////////////////////////////////////////////////
//
@@ -141,7 +141,7 @@ END #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD)
LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
-#pragma code_page(1251)
+#pragma code_page(1250)
/////////////////////////////////////////////////////////////////////////////
//
@@ -239,14 +239,14 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | CAPTION "Change password"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Old password",IDC_INSTRUCTION,7,9,75,8
+ LTEXT "Old password:",IDC_INSTRUCTION,7,9,75,8,0,WS_EX_RIGHT
EDITTEXT IDC_PASSWORD,88,7,105,14,ES_PASSWORD | ES_AUTOHSCROLL
- DEFPUSHBUTTON "OK",IDOK,88,69,50,14
- PUSHBUTTON "Cancel",IDCANCEL,142,69,51,14
- LTEXT "New password",IDC_INSTRUCTION2,7,27,75,8
+ LTEXT "New password:",IDC_INSTRUCTION2,7,27,75,8,0,WS_EX_RIGHT
EDITTEXT IDC_PASSWORD2,88,24,105,14,ES_PASSWORD | ES_AUTOHSCROLL
- LTEXT "Confirmation",IDC_INSTRUCTION3,7,44,75,8
+ LTEXT "Confirmation:",IDC_INSTRUCTION3,7,44,75,8,0,WS_EX_RIGHT
EDITTEXT IDC_PASSWORD3,88,41,105,14,ES_PASSWORD | ES_AUTOHSCROLL
+ DEFPUSHBUTTON "OK",IDOK,88,69,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,142,69,51,14
END
diff --git a/protocols/Skype/src/skype_dialogs.cpp b/protocols/Skype/src/skype_dialogs.cpp index 3ce20c4e3e..d26868284b 100644 --- a/protocols/Skype/src/skype_dialogs.cpp +++ b/protocols/Skype/src/skype_dialogs.cpp @@ -134,6 +134,8 @@ INT_PTR CALLBACK CSkypeProto::SkypeMainOptionsProc(HWND hwnd, UINT message, WPAR GetDlgItemTextA(hwnd, IDC_PW, pwd, SIZEOF(pwd));
PasswordChangeBoxParam param;
+ param.password = ::mir_strdup(pwd);
+
if (proto->ChangePassword(param))
{
proto->account->ChangePassword(param.password, param.password2);
@@ -266,6 +268,10 @@ INT_PTR CALLBACK CSkypeProto::SkypePasswordChangeProc(HWND hwndDlg, UINT msg, WP case WM_INITDIALOG:
::TranslateDialogDefault(hwndDlg);
+ SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_LIMITTEXT, SKYPE_PASSWORD_LIMIT, 0);
+ SendDlgItemMessage(hwndDlg, IDC_PASSWORD2, EM_LIMITTEXT, SKYPE_PASSWORD_LIMIT, 0);
+ SendDlgItemMessage(hwndDlg, IDC_PASSWORD3, EM_LIMITTEXT, SKYPE_PASSWORD_LIMIT, 0);
+
param = (PasswordChangeBoxParam *)lParam;
::SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
{
@@ -285,16 +291,35 @@ INT_PTR CALLBACK CSkypeProto::SkypePasswordChangeProc(HWND hwndDlg, UINT msg, WP case IDOK:
{
char oldPwd[SKYPE_PASSWORD_LIMIT];
- ::GetDlgItemTextA(hwndDlg, IDC_PASSWORD, oldPwd, SIZEOF(oldPwd));
- param->password = ::mir_strdup(oldPwd);
-
char pwd1[SKYPE_PASSWORD_LIMIT];
- ::GetDlgItemTextA(hwndDlg, IDC_PASSWORD2, pwd1, SIZEOF(pwd1));
- param->password2 = ::mir_strdup(pwd1);
-
char pwd2[SKYPE_PASSWORD_LIMIT];
+
+ ::GetDlgItemTextA(hwndDlg, IDC_PASSWORD, oldPwd, SIZEOF(oldPwd));
+ ::GetDlgItemTextA(hwndDlg, IDC_PASSWORD2, pwd1, SIZEOF(pwd1));
::GetDlgItemTextA(hwndDlg, IDC_PASSWORD3, pwd2, SIZEOF(pwd2));
+ if (!::strlen(oldPwd) || !::strlen(pwd1)) {
+ ::MessageBox(NULL, TranslateT("Password can't be empty."), TranslateT("Change password"), MB_OK | MB_ICONERROR);
+ break;
+ }
+
+ if (::strcmp(param->password, oldPwd)) {
+ ::MessageBox(NULL, TranslateT("Old password is not correct."), TranslateT("Change password"), MB_OK | MB_ICONERROR);
+ break;
+ }
+
+ if (!::strcmp(oldPwd, pwd1)) {
+ ::MessageBox(NULL, TranslateT("New password is same as old password."), TranslateT("Change password"), MB_OK | MB_ICONERROR);
+ break;
+ }
+
+ if (::strcmp(pwd1, pwd2)) {
+ ::MessageBox(NULL, TranslateT("New password and confirmation must be same."), TranslateT("Change password"), MB_OK | MB_ICONERROR);
+ break;
+ }
+
+ param->password2 = ::mir_strdup(pwd1);
+
::EndDialog(hwndDlg, IDOK);
}
break;
@@ -318,7 +343,7 @@ bool CSkypeProto::ChangePassword(PasswordChangeBoxParam ¶m) NULL,
CSkypeProto::SkypePasswordChangeProc,
(LPARAM)¶m);
- return value == 1;
+ return value == IDOK;
}
INT_PTR CALLBACK CSkypeProto::SkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index b74811ddbc..68f55adb90 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -533,6 +533,9 @@ int __cdecl CSkypeProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM case EV_PROTO_ONEXIT:
return this->OnPreShutdown(wParam, lParam);
+ case EV_PROTO_ONOPTIONS:
+ return this->OnOptionsInit(wParam,lParam);
+
case EV_PROTO_ONCONTACTDELETED:
return this->OnContactDeleted(wParam, lParam);
|