summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_options.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-07 12:31:01 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-07 12:31:01 +0000
commitfc4ca4545540ba1f35e4e7ad01646edf11199b4e (patch)
treef5725c89e6674b73bed183af7530350ad25ddf65 /protocols/VKontakte/src/vk_options.cpp
parent2e1ccca56dcd321148ac0e233dc88e553a951d0b (diff)
ability to set the alternative VK domain
git-svn-id: http://svn.miranda-ng.org/main/trunk@7531 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_options.cpp')
-rw-r--r--protocols/VKontakte/src/vk_options.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp
index 6228cb3fae..b644e1e34d 100644
--- a/protocols/VKontakte/src/vk_options.cpp
+++ b/protocols/VKontakte/src/vk_options.cpp
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
INT_PTR CALLBACK VKAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- CVkProto* ppro = (CVkProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ CVkProto *ppro = (CVkProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (uMsg) {
case WM_INITDIALOG:
@@ -117,6 +117,7 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
SetDlgItemText(hwndDlg, IDC_PASSWORD, tszPassw);
SetDlgItemText(hwndDlg, IDC_GROUPNAME, ppro->getGroup());
+ SetDlgItemTextA(hwndDlg, IDC_VKDOMAIN, ppro->getDomain());
}
CheckDlgButton(hwndDlg, IDC_DELIVERY, ppro->m_bServerDelivery);
return TRUE;
@@ -130,6 +131,7 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
case IDC_LOGIN:
case IDC_PASSWORD:
case IDC_GROUPNAME:
+ case IDC_VKDOMAIN:
if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -143,7 +145,10 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- TCHAR str[128];
+ union {
+ TCHAR str[128];
+ char stra[256];
+ };
GetDlgItemText(hwndDlg, IDC_LOGIN, str, SIZEOF(str));
ppro->setTString("Login", str);
@@ -153,6 +158,12 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
ppro->setTString("ProtoGroup", str);
}
+ GetDlgItemTextA(hwndDlg, IDC_VKDOMAIN, stra, SIZEOF(stra));
+ if (strcmp(ppro->getDomain(), stra)) {
+ ppro->setDomain(stra);
+ ppro->setString("BaseDomain", stra);
+ }
+
GetDlgItemText(hwndDlg, IDC_PASSWORD, str, SIZEOF(str));
ptrA szRawPasswd(mir_utf8encodeT(str));
if (szRawPasswd != NULL)