From 96e5029af97ae86f2b41499884a46723410a357d Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 13 Jun 2016 18:48:49 +0000 Subject: Tox: fixed user node adding git-svn-id: http://svn.miranda-ng.org/main/trunk@16970 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_options.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'protocols') diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 651cecf377..b6cad21929 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -331,18 +331,27 @@ void CToxNodeEditor::OnInitDialog() void CToxNodeEditor::OnOk(CCtrlBase*) { - if (!m_ipv4.GetInt()) + ptrT ipv4(m_ipv4.GetText()); + if (!ipv4) { MessageBox(m_hwnd, TranslateT("Enter IPv4"), TranslateT("Error"), MB_OK); return; } - if (!m_pkey.GetInt()) + + ptrT port(m_port.GetText()); + if (!port) + { + MessageBox(m_hwnd, TranslateT("Enter port"), TranslateT("Error"), MB_OK); + return; + } + + ptrT pubKey(m_pkey.GetText()); + if (!pubKey) { MessageBox(m_hwnd, TranslateT("Enter public key"), TranslateT("Error"), MB_OK); return; } - ptrT ipv4(m_ipv4.GetText()); if (m_iItem == -1) { m_iItem = m_list->AddItem(ipv4, -1, NULL, 1); @@ -351,9 +360,8 @@ void CToxNodeEditor::OnOk(CCtrlBase*) } else m_list->SetItem(m_iItem, 0, ipv4); - m_list->SetItem(m_iItem, 1, ptrT(m_ipv6.GetText())); - m_list->SetItem(m_iItem, 2, ptrT(m_port.GetText())); - m_list->SetItem(m_iItem, 3, ptrT(m_pkey.GetText())); + m_list->SetItem(m_iItem, 2, port); + m_list->SetItem(m_iItem, 3, pubKey); m_list->SetItem(m_iItem, 4, _T(""), 0); m_list->SetItem(m_iItem, 5, _T(""), 1); -- cgit v1.2.3