summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2012-09-26 19:32:36 +0000
committerAlexander Lantsev <aunsane@gmail.com>2012-09-26 19:32:36 +0000
commitc797252e7c2829291a43301bf8d1c9485c95f888 (patch)
tree13414c16ce225f7580ef43f8062cc7a78cf544a8
parentc3f5a3edb0b04ead2e16a68e3c2bd8a1721667df (diff)
- moved SkypeAccountProc DLGPROC callback to skype_dialogs.cpp
git-svn-id: http://svn.miranda-ng.org/main/trunk@1672 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/Skype/Skype.vcxproj2
-rw-r--r--protocols/Skype/Skype.vcxproj.filters5
-rw-r--r--protocols/Skype/skype_dialogs.cpp72
-rw-r--r--protocols/Skype/src/skype_proto.cpp73
-rw-r--r--protocols/Skype/src/skype_proto.h2
5 files changed, 80 insertions, 74 deletions
diff --git a/protocols/Skype/Skype.vcxproj b/protocols/Skype/Skype.vcxproj
index 2740909280..60c68ca29e 100644
--- a/protocols/Skype/Skype.vcxproj
+++ b/protocols/Skype/Skype.vcxproj
@@ -90,7 +90,6 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
<AdditionalDependencies>$(SolutionDir)..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\build\skypekit-cyassl_lib.lib;$(SolutionDir)..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\build\skypekit-cppwrapper_2_lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
</Link>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -104,6 +103,7 @@
<ClInclude Include="src\resource.h" />
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="skype_dialogs.cpp" />
<ClCompile Include="src\skype.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
diff --git a/protocols/Skype/Skype.vcxproj.filters b/protocols/Skype/Skype.vcxproj.filters
index 607da3c71b..138978ca58 100644
--- a/protocols/Skype/Skype.vcxproj.filters
+++ b/protocols/Skype/Skype.vcxproj.filters
@@ -7,6 +7,9 @@
<ClCompile Include="src\skype_proto.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="skype_dialogs.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\resource.h">
@@ -19,7 +22,7 @@
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\skype_proto.h">
- <Filter>Source Files</Filter>
+ <Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
diff --git a/protocols/Skype/skype_dialogs.cpp b/protocols/Skype/skype_dialogs.cpp
new file mode 100644
index 0000000000..dc8daf2b1b
--- /dev/null
+++ b/protocols/Skype/skype_dialogs.cpp
@@ -0,0 +1,72 @@
+#include "src\skype_proto.h"
+
+INT_PTR CALLBACK CSkypeProto::SkypeAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
+{
+ CSkypeProto *proto;
+
+ switch ( message )
+ {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwnd);
+
+ proto = reinterpret_cast<CSkypeProto*>(lparam);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
+
+ DBVARIANT dbv;
+ if ( !DBGetContactSettingString(0, proto->ModuleName(), "SkypeName", &dbv))
+ {
+ SetDlgItemText(hwnd, IDC_SN, dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ }
+
+ if ( !DBGetContactSettingString(0, proto->ModuleName(), "Password", &dbv))
+ {
+ CallService(
+ MS_DB_CRYPT_DECODESTRING,
+ wcslen(dbv.ptszVal) + 1,
+ reinterpret_cast<LPARAM>(dbv.ptszVal));
+ SetDlgItemText(hwnd, IDC_PW, dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ }
+
+ if ( !proto->IsOffline())
+ {
+ SendMessage(GetDlgItem(hwnd, IDC_SN), EM_SETREADONLY, 1, 0);
+ SendMessage(GetDlgItem(hwnd, IDC_PW), EM_SETREADONLY, 1, 0);
+ }
+
+ return TRUE;
+
+ case WM_COMMAND:
+ if (HIWORD(wparam) == EN_CHANGE && reinterpret_cast<HWND>(lparam) == GetFocus())
+ {
+ switch(LOWORD(wparam))
+ {
+ case IDC_SN:
+ case IDC_PW:
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+
+ case WM_NOTIFY:
+ if (reinterpret_cast<NMHDR*>(lparam)->code == PSN_APPLY)
+ {
+ proto = reinterpret_cast<CSkypeProto*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
+ TCHAR str[128];
+
+ GetDlgItemText(hwnd, IDC_SN, str, sizeof(str));
+ DBWriteContactSettingTString(0, proto->ModuleName(), "SkypeName", str);
+
+ GetDlgItemText(hwnd, IDC_PW, str, sizeof(str));
+ CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(str), reinterpret_cast<LPARAM>(str));
+ DBWriteContactSettingTString(0, proto->ModuleName(), "Password", str);
+
+ return TRUE;
+ }
+ break;
+
+ }
+
+ return FALSE;
+} \ No newline at end of file
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp
index 1f78e2dd57..d4f19e4aa8 100644
--- a/protocols/Skype/src/skype_proto.cpp
+++ b/protocols/Skype/src/skype_proto.cpp
@@ -36,84 +36,13 @@ CSkypeProto::~CSkypeProto()
mir_free(this->m_tszUserName);
}
-INT_PTR CALLBACK SkypeAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
-{
- CSkypeProto *proto;
-
- switch ( message )
- {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwnd);
-
- proto = reinterpret_cast<CSkypeProto*>(lparam);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
-
- DBVARIANT dbv;
- if ( !DBGetContactSettingString(0, proto->ModuleName(), "SkypeName", &dbv))
- {
- SetDlgItemText(hwnd, IDC_SN, dbv.ptszVal);
- DBFreeVariant(&dbv);
- }
-
- if ( !DBGetContactSettingString(0, proto->ModuleName(), "Password", &dbv))
- {
- CallService(
- MS_DB_CRYPT_DECODESTRING,
- wcslen(dbv.ptszVal) + 1,
- reinterpret_cast<LPARAM>(dbv.ptszVal));
- SetDlgItemText(hwnd, IDC_PW, dbv.ptszVal);
- DBFreeVariant(&dbv);
- }
-
- if ( !proto->IsOffline())
- {
- SendMessage(GetDlgItem(hwnd, IDC_SN), EM_SETREADONLY, 1, 0);
- SendMessage(GetDlgItem(hwnd, IDC_PW), EM_SETREADONLY, 1, 0);
- }
-
- return TRUE;
-
- case WM_COMMAND:
- if (HIWORD(wparam) == EN_CHANGE && reinterpret_cast<HWND>(lparam) == GetFocus())
- {
- switch(LOWORD(wparam))
- {
- case IDC_SN:
- case IDC_PW:
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- }
- }
- break;
-
- case WM_NOTIFY:
- if (reinterpret_cast<NMHDR*>(lparam)->code == PSN_APPLY)
- {
- proto = reinterpret_cast<CSkypeProto*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
- TCHAR str[128];
-
- GetDlgItemText(hwnd, IDC_SN, str, sizeof(str));
- DBWriteContactSettingTString(0, proto->ModuleName(), "SkypeName", str);
-
- GetDlgItemText(hwnd, IDC_PW, str, sizeof(str));
- CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(str), reinterpret_cast<LPARAM>(str));
- DBWriteContactSettingTString(0, proto->ModuleName(), "Password", str);
-
- return TRUE;
- }
- break;
-
- }
-
- return FALSE;
-}
-
INT_PTR __cdecl CSkypeProto::SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam)
{
return (int)CreateDialogParam(
g_hInstance,
MAKEINTRESOURCE(IDD_SKYPEACCOUNT),
(HWND)lParam,
- ::SkypeAccountProc, (LPARAM)this);
+ &CSkypeProto::SkypeAccountProc, (LPARAM)this);
}
HANDLE __cdecl CSkypeProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) { return 0; }
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h
index 6967c918a9..414f104d3c 100644
--- a/protocols/Skype/src/skype_proto.h
+++ b/protocols/Skype/src/skype_proto.h
@@ -72,4 +72,6 @@ protected:
INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam);
void CreateProtoService(const char* szService, SkypeServiceFunc serviceProc);
+
+ static INT_PTR CALLBACK SkypeAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
}; \ No newline at end of file