From 93467b8c3702be5fc9f9b60c3ff6863cb37ccd8d Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 27 Sep 2014 09:25:36 +0000 Subject: encrypt tox profile (dont't work, crashed on tox_encrypted_load) git-svn-id: http://svn.miranda-ng.org/main/trunk@10612 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_options.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (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 f137c8e738..d811569175 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -15,6 +15,9 @@ INT_PTR CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l ptrW nick(proto->getTStringA("Nick")); SetDlgItemText(hwnd, IDC_NAME, nick); + ptrW 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()); @@ -39,6 +42,14 @@ 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); + } + break; + case IDC_CLIPBOARD: { char toxId[TOX_FRIEND_ADDRESS_SIZE * 2 + 1]; @@ -75,10 +86,13 @@ INT_PTR CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l case WM_NOTIFY: if (reinterpret_cast(lParam)->code == PSN_APPLY) { - TCHAR nick[TOX_MAX_NAME_LENGTH]; + TCHAR nick[TOX_MAX_NAME_LENGTH], pass[MAX_PATH]; GetDlgItemText(hwnd, IDC_NAME, nick, TOX_MAX_NAME_LENGTH); proto->setTString("Nick", nick); + GetDlgItemText(hwnd, IDC_PASSWORD, pass, SIZEOF(pass)); + proto->setTString("Password", pass); + proto->setByte("DisableUDP", (BYTE)IsDlgButtonChecked(hwnd, IDC_DISABLE_UDP)); proto->setByte("DisableIPv6", (BYTE)IsDlgButtonChecked(hwnd, IDC_DISABLE_IPV6)); -- cgit v1.2.3