summaryrefslogtreecommitdiff
path: root/gui/qml/main.qml
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-07-09 20:29:45 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-07-12 19:47:49 +0200
commit26092db4ca2ad9972c5c275d1fcfb262ac7573ac (patch)
treea9b64d3b3c95f024ab27afbceebe1496615d1036 /gui/qml/main.qml
parent0d1d4116eb283a684b93bd432cb1f3b8331b2d4d (diff)
[ui] give feedback about gateway selection
-Resolves: #524
Diffstat (limited to 'gui/qml/main.qml')
-rw-r--r--gui/qml/main.qml40
1 files changed, 40 insertions, 0 deletions
diff --git a/gui/qml/main.qml b/gui/qml/main.qml
index 1d67924..e166d65 100644
--- a/gui/qml/main.qml
+++ b/gui/qml/main.qml
@@ -88,10 +88,12 @@ ApplicationWindow {
if (vpntoggle.checked == true
&& ctx.status == "off") {
backend.switchOn()
+ vpntoggle.checkable = false
}
if (vpntoggle.checked === false
&& ctx.status == "on") {
backend.switchOff()
+ vpntoggle.checkable = false
}
}
}
@@ -114,6 +116,7 @@ ApplicationWindow {
anchors.centerIn: parent
spacing: 10
+ //width: parent.width
RadioButton {
id: autoSelectionButton
@@ -124,12 +127,14 @@ ApplicationWindow {
manualSelectionItem.checked = false
}
}
+
RadioButton {
id: manualSelectionButton
checked: isManualLocation()
text: qsTr("Manual")
onClicked: setGwSelection()
}
+
ComboBox {
id: gwSelector
editable: false
@@ -139,6 +144,12 @@ ApplicationWindow {
model: [qsTr("Recommended")]
onActivated: {
console.debug("Selected gateway:", currentText)
+ if (ctx.status == "off") {
+ gwNextConnectionText.visible = true
+ }
+ if (ctx.status == "on") {
+ gwReconnectText.visible = true
+ }
backend.useLocation(currentText.toString())
manualSelectionItem.checked = true
}
@@ -170,7 +181,31 @@ ApplicationWindow {
color: "#000000"
}
}
+
+ }
+
+ Text {
+ id: gwReconnectText
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 180
+ font.pixelSize: 12
+ color: "green"
+ wrapMode: Text.WordWrap
+ text: qsTr("Reconnecting to the selected gateway…")
+ visible: false
+ }
+
+ Text {
+ id: gwNextConnectionText
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 180
+ font.pixelSize: 12
+ color: "green"
+ wrapMode: Text.WordWrap
+ text: qsTr("This gateway will be used for next connection.")
+ visible: false
}
+
} // end column
} // end item
@@ -214,6 +249,11 @@ ApplicationWindow {
if (ctx.donateURL) {
donateItem.visible = true
}
+
+ if (ctx.status == "on") {
+ gwNextConnectionText.visible = false
+ gwReconnectText.visible = false
+ }
}
}