summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_options.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-12-18 15:17:26 +0300
committeraunsane <aunsane@gmail.com>2017-12-18 20:37:16 +0300
commit215c3b0f8ba4a6b754936b0ebcbd5cb9a30c7e46 (patch)
tree9c56d4160a2a6e6d09e38eecc6740e15df0ffbc4 /protocols/Tox/src/tox_options.cpp
parent97254a71ba33edf4c829e4c4b0c4961c6348045f (diff)
Tox: added 2 new options
- UDP hole-punching - local network peer discovery
Diffstat (limited to 'protocols/Tox/src/tox_options.cpp')
-rw-r--r--protocols/Tox/src/tox_options.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp
index bf4aeea940..cdd12f7089 100644
--- a/protocols/Tox/src/tox_options.cpp
+++ b/protocols/Tox/src/tox_options.cpp
@@ -6,7 +6,8 @@ CToxOptionsMain::CToxOptionsMain(CToxProto *proto, int idDialog)
m_profileCreate(this, IDC_PROFILE_NEW), m_profileImport(this, IDC_PROFILE_IMPORT),
m_profileExport(this, IDC_PROFILE_EXPORT), m_nickname(this, IDC_NAME),
m_password(this, IDC_PASSWORD), m_group(this, IDC_GROUP),
- m_enableUdp(this, IDC_ENABLE_UDP), m_enableIPv6(this, IDC_ENABLE_IPV6),
+ m_enableUdp(this, IDC_ENABLE_UDP), m_enableUdpHolePunching(this, IDC_ENABLE_HOLEPUNCHING),
+ m_enableIPv6(this, IDC_ENABLE_IPV6), m_enableLocalDiscovery(this, IDC_ENABLE_LOCALDISCOVERY),
m_maxConnectRetries(this, IDC_MAXCONNECTRETRIES), m_maxConnectRetriesSpin(this, IDC_MAXCONNECTRETRIESSPIN),
m_maxReconnectRetries(this, IDC_MAXRECONNECTRETRIES), m_maxReconnectRetriesSpin(this, IDC_MAXRECONNECTRETRIESSPIN)
{
@@ -15,13 +16,18 @@ CToxOptionsMain::CToxOptionsMain(CToxProto *proto, int idDialog)
CreateLink(m_password, "Password", L"");
CreateLink(m_group, TOX_SETTINGS_GROUP, L"Tox");
CreateLink(m_enableUdp, "EnableUDP", DBVT_BYTE, TRUE);
+ CreateLink(m_enableUdpHolePunching, "EnableUDPHolePunching", DBVT_BYTE, TRUE);
CreateLink(m_enableIPv6, "EnableIPv6", DBVT_BYTE, FALSE);
+ CreateLink(m_enableLocalDiscovery, "EnableLocalDiscovery", DBVT_BYTE, FALSE);
if (idDialog == IDD_OPTIONS_MAIN) {
CreateLink(m_maxConnectRetries, "MaxConnectRetries", DBVT_BYTE, TOX_MAX_CONNECT_RETRIES);
CreateLink(m_maxReconnectRetries, "MaxReconnectRetries", DBVT_BYTE, TOX_MAX_RECONNECT_RETRIES);
}
+ m_enableUdp.OnChange = Callback(this, &CToxOptionsMain::EnableUdp_OnClick);
+ m_enableUdpHolePunching.Enable(m_enableUdp.GetState());
+
m_toxAddressCopy.OnClick = Callback(this, &CToxOptionsMain::ToxAddressCopy_OnClick);
m_profileCreate.OnClick = Callback(this, &CToxOptionsMain::ProfileCreate_OnClick);
m_profileImport.OnClick = Callback(this, &CToxOptionsMain::ProfileImport_OnClick);
@@ -54,6 +60,11 @@ void CToxOptionsMain::OnInitDialog()
m_maxReconnectRetriesSpin.SetPosition(m_proto->getByte("MaxReconnectRetries", TOX_MAX_RECONNECT_RETRIES));
}
+void CToxOptionsMain::EnableUdp_OnClick(CCtrlBase*)
+{
+ m_enableUdpHolePunching.Enable(m_enableUdp.GetState());
+}
+
void CToxOptionsMain::ToxAddressCopy_OnClick(CCtrlButton*)
{
char *toxAddress = m_toxAddress.GetTextA();