From 26092db4ca2ad9972c5c275d1fcfb262ac7573ac Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Fri, 9 Jul 2021 20:29:45 +0200 Subject: [ui] give feedback about gateway selection -Resolves: #524 --- gui/qml/main.qml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'gui/qml/main.qml') 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 + } } } -- cgit v1.2.3