diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-01-03 08:12:27 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-01-03 08:12:27 +0000 |
commit | f1f8a71bd4df7f239e28a9625b82ee02428c3f3f (patch) | |
tree | 9bfbccff9826c0cb530805eec4373a1365122201 /protocols/Tox/src/tox_options.cpp | |
parent | c42d4e21629ebefaf5a720c5270e77187edfc720 (diff) |
Tox: work commit
- removed *.lib and lib generator
- disabled profile encryption and import
- loading tox profile on connection
- project reordering
- http proxy support
git-svn-id: http://svn.miranda-ng.org/main/trunk@11730 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_options.cpp')
-rw-r--r-- | protocols/Tox/src/tox_options.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 8b6331a8a7..02748633ea 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -30,6 +30,11 @@ INT_PTR CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l CheckDlgButton(hwnd, IDC_DISABLE_UDP, proto->getBool("DisableUDP", 0)); CheckDlgButton(hwnd, IDC_DISABLE_IPV6, proto->getBool("DisableIPv6", 0)); + + EnableWindow(GetDlgItem(hwnd, IDC_TOXID), proto->IsOnline()); + EnableWindow(GetDlgItem(hwnd, IDC_CLIPBOARD), proto->IsOnline()); + EnableWindow(GetDlgItem(hwnd, IDC_NAME), proto->IsOnline()); + EnableWindow(GetDlgItem(hwnd, IDC_PASSWORD), proto->IsOnline()); } return TRUE; @@ -74,16 +79,6 @@ 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], 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)); - TCHAR group[64]; GetDlgItemText(hwnd, IDC_GROUP, group, SIZEOF(group)); if (_tcslen(group) > 0) @@ -96,7 +91,20 @@ INT_PTR CToxProto::MainOptionsProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l proto->delSetting(NULL, TOX_SETTINGS_GROUP); } - proto->SaveToxProfile(); + proto->setByte("DisableUDP", (BYTE)IsDlgButtonChecked(hwnd, IDC_DISABLE_UDP)); + proto->setByte("DisableIPv6", (BYTE)IsDlgButtonChecked(hwnd, IDC_DISABLE_IPV6)); + + if (proto->IsOnline()) + { + 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->SaveToxProfile(); + } return TRUE; } |