From 58b15c89c7d4504730278e22b1a77684c2e9e83b Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Tue, 30 Nov 2021 23:09:50 +0100 Subject: [bug] avoid inconsistent states --- gui/components/Preferences.qml | 7 ++++--- gui/main.qml | 13 +++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/gui/components/Preferences.qml b/gui/components/Preferences.qml index 23aae05..546ff8b 100644 --- a/gui/components/Preferences.qml +++ b/gui/components/Preferences.qml @@ -248,15 +248,16 @@ ThemedPage { } Component.onCompleted: { - if (ctx && ctx.transport == "obfs4") { - useBridgesCheckBox.checked = true - } if (ctx && ctx.offersUdp == "false") { useUDP.enabled = false } if (ctx && ctx.offersUdp && ctx.udp == "true") { useUDP.checked = true } + if (ctx && ctx.transport == "obfs4") { + useBridgesCheckBox.checked = true + useUDP.enabled = false + } // disabled for now, will be on next release /* if (ctx && ctx.hasTor == "true") { diff --git a/gui/main.qml b/gui/main.qml index 116aba3..1424cc6 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -111,6 +111,9 @@ ApplicationWindow { if (ctx.donateDialog == 'true') { showDonationReminder = true } + if (isAutoLocation()) { + root.selectedGateway = "auto" + } // TODO check donation //if (needsDonate && !shownDonate) { @@ -149,6 +152,16 @@ ApplicationWindow { return Array.from(arr, (k,_) => k.key); } + function isAutoLocation() { + // FIXME there's something weird going on with newyork location... + // it gets marked as auto, which from europe is a bug. + let best = ctx.locationLabels[ctx.bestLocation] + if (best == undefined) { + return false + } + return (best[0] == ctx.currentLocation) + } + function bringToFront() { // FIXME does not work properly, at least on linux if (visibility == 3) { -- cgit v1.2.3