summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2016-06-13 18:48:49 +0000
committerAlexander Lantsev <aunsane@gmail.com>2016-06-13 18:48:49 +0000
commit96e5029af97ae86f2b41499884a46723410a357d (patch)
tree05a68b03f3c0c256447d6c498022ef4d538dff26
parent6ff460c84fa8035de8f24e799f9fba336e4f102c (diff)
Tox: fixed user node adding
git-svn-id: http://svn.miranda-ng.org/main/trunk@16970 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/Tox/src/tox_options.cpp20
1 files changed, 14 insertions, 6 deletions
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);