rename connection state to what it is and expose more self node info
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousDelivery / windows (windows-2022, ) (push) Has been cancelled
ContinuousDelivery / windows (windows-2022, asan) (push) Has been cancelled
ContinuousDelivery / dumpsyms (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
ContinuousIntegration / on ubuntu-24.04-arm (push) Has been cancelled
ContinuousIntegration / asan on ubuntu-24.04-arm (push) Has been cancelled
ContinuousIntegration / on ubuntu-latest (push) Has been cancelled
ContinuousIntegration / asan on ubuntu-latest (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousDelivery / windows (windows-2022, ) (push) Has been cancelled
ContinuousDelivery / windows (windows-2022, asan) (push) Has been cancelled
ContinuousDelivery / dumpsyms (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
ContinuousIntegration / on ubuntu-24.04-arm (push) Has been cancelled
ContinuousIntegration / asan on ubuntu-24.04-arm (push) Has been cancelled
ContinuousIntegration / on ubuntu-latest (push) Has been cancelled
ContinuousIntegration / asan on ubuntu-latest (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
This commit is contained in:
@@ -83,18 +83,44 @@ void ToxUIUtils::render(void) {
|
||||
_show_dht_connect_node = !_show_dht_connect_node;
|
||||
}
|
||||
|
||||
{ // self node info
|
||||
bool either = false;
|
||||
{
|
||||
auto [port_opt, port_err] = _tc.toxSelfGetUDPPort();
|
||||
if (port_opt.has_value()) {
|
||||
either = true;
|
||||
ImGui::TextDisabled("udp online; port: %d", port_opt.value());
|
||||
} else {
|
||||
ImGui::TextDisabled("udp disabled");
|
||||
}
|
||||
}
|
||||
{
|
||||
auto [port_opt, port_err] = _tc.toxSelfGetTCPPort();
|
||||
if (port_opt.has_value()) {
|
||||
either = true;
|
||||
ImGui::TextDisabled("tcp relay server online; port: %d", port_opt.value());
|
||||
} else {
|
||||
ImGui::TextDisabled("tcp relay server disabled");
|
||||
}
|
||||
}
|
||||
|
||||
if (either && ImGui::MenuItem("copy own DHT id/pubkey")) {
|
||||
ImGui::SetClipboardText(bin2hex(_tc.toxSelfGetDHTID()).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
switch (_tc.toxSelfGetConnectionStatus()) {
|
||||
case TOX_CONNECTION_NONE:
|
||||
ImGui::TextColored({1.0,0.5,0.5,0.8}, "Offline");
|
||||
ImGui::TextColored({1.0,0.5,0.5,0.8}, "Disconnected");
|
||||
break;
|
||||
case TOX_CONNECTION_TCP:
|
||||
ImGui::TextColored({0.0,1.0,0.8,0.8}, "Online-TCP");
|
||||
ImGui::TextColored({0.0,1.0,0.8,0.8}, "Connected-TCP");
|
||||
break;
|
||||
case TOX_CONNECTION_UDP:
|
||||
ImGui::TextColored({0.3,1.0,0.0,0.8}, "Online-UDP");
|
||||
ImGui::TextColored({0.3,1.0,0.0,0.8}, "Connected-UDP");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user