fix(settings): disable the unimplemented Tor option and tell its users
The "Use Tor" checkbox was saved but never read: no build routed any traffic (node, RPC, price/update/bootstrap/pool HTTP or Lite gRPC) through Tor, so users who ticked it believed they were anonymous. - The checkbox is disabled and always shown unticked, on the Settings page and in the legacy Settings window. Its tooltip says it is not available and gives the alternatives: for the node, proxy=127.0.0.1:9050 in DRAGONX.conf with Tor running; otherwise a system-wide VPN/Tor (Lite builds get the short version). The "Use Tor" label is kept. - Behaviour change: a stored use_tor=true is cleared once at startup (Settings::consumeLegacyUseTor + a synchronous save before the async writer and any Settings page state), with a 20 s warning in the user's language. The cleared key is the "already told" flag, so the notice never repeats. No settings format change. - 3 new strings (tt_tor_unavailable, tt_tor_unavailable_lite, tor_never_applied_notice) in all 8 languages; the tooltip wraps at tor-tooltip-wrap-width from ui.toml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1250,8 +1250,22 @@ void RenderSettingsPage(App* app) {
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_save_ztx"));
|
||||
CB(TrId("auto_shield", "auto_shld"), &s_settingsState.auto_shield);
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_auto_shield"));
|
||||
CB(TrId("use_tor", "tor"), &s_settingsState.use_tor);
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_tor"));
|
||||
{
|
||||
// Not implemented: disabled and never shown as "on", even for a stored use_tor=true.
|
||||
bool torOff = false;
|
||||
ImGui::BeginDisabled();
|
||||
CB(TrId("use_tor", "tor"), &torOff);
|
||||
ImGui::EndDisabled();
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
|
||||
const float wrapW = S.drawElement("components.settings-page", "tor-tooltip-wrap-width")
|
||||
.sizeOr(420.0f) * Layout::dpiScale();
|
||||
material::BeginTooltip();
|
||||
ImGui::PushTextWrapPos(wrapW);
|
||||
ImGui::TextUnformatted(TR(app->isLiteBuild() ? "tt_tor_unavailable_lite" : "tt_tor_unavailable"));
|
||||
ImGui::PopTextWrapPos();
|
||||
material::EndTooltip();
|
||||
}
|
||||
}
|
||||
if (showDaemonOptions) {
|
||||
if (CB(TrId("keep_daemon", "keep_dmn"), &s_settingsState.keep_daemon_running))
|
||||
saveSettingsPageState(app->settings());
|
||||
|
||||
@@ -369,8 +369,23 @@ void RenderSettingsWindow(App* app, bool* p_open)
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Checkbox(TrId("settings_use_tor_network", "tor_w").c_str(), &s_use_tor);
|
||||
ImGui::TextDisabled(" %s", TR("settings_tor_desc"));
|
||||
{
|
||||
// Not implemented: disabled and never shown as "on", even for a stored use_tor=true.
|
||||
bool torOff = false;
|
||||
ImGui::BeginDisabled();
|
||||
ImGui::Checkbox(TrId("settings_use_tor_network", "tor_w").c_str(), &torOff);
|
||||
ImGui::EndDisabled();
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
|
||||
const float wrapW = S.drawElement("components.settings-page", "tor-tooltip-wrap-width")
|
||||
.sizeOr(420.0f) * Layout::dpiScale();
|
||||
material::BeginTooltip();
|
||||
ImGui::PushTextWrapPos(wrapW);
|
||||
ImGui::TextUnformatted(TR(app && app->isLiteBuild() ? "tt_tor_unavailable_lite"
|
||||
: "tt_tor_unavailable"));
|
||||
ImGui::PopTextWrapPos();
|
||||
material::EndTooltip();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
|
||||
Reference in New Issue
Block a user