summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_options.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-03-15 00:19:35 +0300
committeraunsane <aunsane@gmail.com>2017-03-15 00:19:35 +0300
commit5de53491d607c38286b19989ba7182454f24fabc (patch)
treecb0da96d057fd1f85245ca3ff3423ea3300da060 /protocols/Tox/src/tox_options.cpp
parenta76c706113f6d9e1a1a253feab46051fb2e6ce12 (diff)
Tox:
- tox_network.cpp splitted on two logical parts - tox network status checking moved to separated thread - started rejection of toxThread wrapper
Diffstat (limited to 'protocols/Tox/src/tox_options.cpp')
-rw-r--r--protocols/Tox/src/tox_options.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp
index d57f42ebdd..22249057e8 100644
--- a/protocols/Tox/src/tox_options.cpp
+++ b/protocols/Tox/src/tox_options.cpp
@@ -64,7 +64,7 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*)
{
Tox_Options *options = NULL;
tox_options_default(options);
- CToxThread toxThread(options);
+ Tox *tox = tox_new(options, NULL);
tox_options_free(options);
ptrW profilePath(m_proto->GetToxProfilePath());
@@ -79,27 +79,27 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*)
CloseHandle(hProfile);
}
- if (m_proto->InitToxCore(&toxThread))
- {
- ptrW group(m_group.GetText());
- if (mir_wstrlen(group) > 0 && Clist_GroupExists(group))
- Clist_GroupCreate(0, group);
+ m_proto->InitToxCore(tox);
- m_proto->UninitToxCore(&toxThread);
+ ptrW group(m_group.GetText());
+ if (mir_wstrlen(group) > 0 && Clist_GroupExists(group))
+ Clist_GroupCreate(0, group);
- m_toxAddress.Enable();
- m_toxAddress.SetTextA(ptrA(m_proto->getStringA(TOX_SETTINGS_ID)));
+ m_proto->UninitToxCore(tox);
+ tox_kill(tox);
- m_nickname.SetText(ptrW(m_proto->getWStringA("Nick")));
- m_password.SetText(ptrW(m_proto->getWStringA("Password")));
- m_group.SetText(ptrW(m_proto->getWStringA(TOX_SETTINGS_GROUP)));
+ m_toxAddress.Enable();
+ m_toxAddress.SetTextA(ptrA(m_proto->getStringA(TOX_SETTINGS_ID)));
- ShowWindow(m_profileCreate.GetHwnd(), FALSE);
- ShowWindow(m_profileImport.GetHwnd(), FALSE);
+ m_nickname.SetText(ptrW(m_proto->getWStringA("Nick")));
+ m_password.SetText(ptrW(m_proto->getWStringA("Password")));
+ m_group.SetText(ptrW(m_proto->getWStringA(TOX_SETTINGS_GROUP)));
- ShowWindow(m_toxAddressCopy.GetHwnd(), TRUE);
- ShowWindow(m_profileExport.GetHwnd(), TRUE);
- }
+ ShowWindow(m_profileCreate.GetHwnd(), FALSE);
+ ShowWindow(m_profileImport.GetHwnd(), FALSE);
+
+ ShowWindow(m_toxAddressCopy.GetHwnd(), TRUE);
+ ShowWindow(m_profileExport.GetHwnd(), TRUE);
}
void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*)
@@ -199,7 +199,7 @@ void CToxOptionsMain::OnApply()
// todo: add checkbox
m_proto->setWString("Password", pass_ptrT(m_password.GetText()));
- m_proto->SaveToxProfile(m_proto->toxThread);
+ m_proto->SaveToxProfile(m_proto->toxThread->Tox());
}
}