diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-09-27 09:25:36 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-09-27 09:25:36 +0000 |
commit | 93467b8c3702be5fc9f9b60c3ff6863cb37ccd8d (patch) | |
tree | 23659d34af33a062ba60bd7cc5dcd176f3f23b3a /protocols/Tox/src/tox_options.cpp | |
parent | e02a45507e91d072b86f26f36dbebf655ad9d79f (diff) |
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
Diffstat (limited to 'protocols/Tox/src/tox_options.cpp')
-rw-r--r-- | protocols/Tox/src/tox_options.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
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<NMHDR*>(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));
|