summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/qml/main.qml24
1 files changed, 22 insertions, 2 deletions
diff --git a/gui/qml/main.qml b/gui/qml/main.qml
index cc5b17e..1d67924 100644
--- a/gui/qml/main.qml
+++ b/gui/qml/main.qml
@@ -252,6 +252,16 @@ ApplicationWindow {
return ctx.manualLocation == "true"
}
+ function hasMultipleGateways() {
+ // could also count the gateways
+ let provider = Logic.getSelectedProvider(providers);
+ if (provider == "riseup") {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
function setGwSelection() {
if (!isManualLocation()) {
@@ -341,7 +351,7 @@ ApplicationWindow {
MenuItem {
id: manualSelectionItem
text: {
- if (isManualLocation()) {
+ if (isManualLocation() != "") {
locationStr()
} else {
qsTr("Pick location…")
@@ -350,6 +360,12 @@ ApplicationWindow {
checkable: true
checked: isManualLocation()
onTriggered: setGwSelection()
+ visible: hasMultipleGateways()
+ }
+
+ MenuItem {
+ text: qsTr("Preferences…")
+ visible: !hasMultipleGateways()
}
MenuSeparator {}
@@ -490,7 +506,11 @@ ApplicationWindow {
}
function locationStr() {
- return ctx.currentLocation + ", " + ctx.currentCountry
+ if (ctx.currentLocation && ctx.currentCountry) {
+ return ctx.currentLocation + ", " + ctx.currentCountry
+ } else {
+ return ""
+ }
}
function useBridges(value) {