From 22b35cdc0d13336366efe44b57d682d5be6bae52 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 27 Sep 2014 10:19:26 +0000 Subject: Tox: - password field temporary disables - some changes git-svn-id: http://svn.miranda-ng.org/main/trunk@10613 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_options.cpp | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) (limited to 'protocols/Tox/src/tox_options.cpp') diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index d811569175..0b24416308 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -12,16 +12,16 @@ INT_PTR CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l proto = (CToxProto*)lParam; SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam); - ptrW nick(proto->getTStringA("Nick")); + ptrT nick(proto->getTStringA("Nick")); SetDlgItemText(hwnd, IDC_NAME, nick); - ptrW pass(proto->getTStringA("Password")); + ptrT pass(proto->getTStringA("Password")); SetDlgItemText(hwnd, IDC_PASSWORD, pass); std::string address = proto->getStringA(NULL, TOX_SETTINGS_ID); SetDlgItemTextA(hwnd, IDC_TOXID, address.c_str()); - ptrW group(proto->getTStringA(TOX_SETTINGS_GROUP)); + ptrT group(proto->getTStringA(TOX_SETTINGS_GROUP)); SetDlgItemText(hwnd, IDC_GROUP, group); SendDlgItemMessage(hwnd, IDC_GROUP, EM_LIMITTEXT, 64, 0); @@ -35,6 +35,8 @@ INT_PTR CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l switch (LOWORD(wParam)) { case IDC_NAME: + case IDC_GROUP: + case IDC_PASSWORD: if ((HWND)lParam == GetFocus()) { if (HIWORD(wParam) != EN_CHANGE) return 0; @@ -42,13 +44,11 @@ INT_PTR CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l } break; - case IDC_PASSWORD: - if ((HWND)lParam == GetFocus()) - { - if (HIWORD(wParam) != EN_CHANGE) return 0; - SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); - } + case IDC_DISABLE_UDP: + case IDC_DISABLE_IPV6: + SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; + } case IDC_CLIPBOARD: { @@ -65,21 +65,6 @@ INT_PTR CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l } } break; - - case IDC_GROUP: - if ((HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) - return 0; - SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); - break; - - case IDC_DISABLE_UDP: - SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); - break; - - case IDC_DISABLE_IPV6: - SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); - break; - } } break; @@ -108,6 +93,8 @@ INT_PTR CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l proto->delSetting(NULL, TOX_SETTINGS_GROUP); } + proto->SaveToxData(); + return TRUE; } break; -- cgit v1.2.3