summaryrefslogtreecommitdiff
path: root/gui/qml
diff options
context:
space:
mode:
Diffstat (limited to 'gui/qml')
-rw-r--r--gui/qml/VPNSwitch.qml17
-rw-r--r--gui/qml/VpnState.qml17
-rw-r--r--gui/qml/main.qml40
3 files changed, 57 insertions, 17 deletions
diff --git a/gui/qml/VPNSwitch.qml b/gui/qml/VPNSwitch.qml
index 14b3734..89c455f 100644
--- a/gui/qml/VPNSwitch.qml
+++ b/gui/qml/VPNSwitch.qml
@@ -5,27 +5,10 @@ import QtQuick.Controls 2.4
SwitchDelegate {
- //id: vpntoggle
-
text: qsTr("")
checked: false
anchors.horizontalCenter: parent.horizontalCenter
- /*
- Connections {
- function onCheckedChanged() {
- if (vpntoggle.checked == true
- && ctx.status == "off") {
- backend.switchOn()
- }
- if (vpntoggle.checked === false
- && ctx.status == "on") {
- backend.switchOff()
- }
- }
- }
- */
-
contentItem: Text {
rightPadding: vpntoggle.indicator.width + vpntoggle.spacing
text: vpntoggle.text
diff --git a/gui/qml/VpnState.qml b/gui/qml/VpnState.qml
index 86239e4..a4bb779 100644
--- a/gui/qml/VpnState.qml
+++ b/gui/qml/VpnState.qml
@@ -24,6 +24,7 @@ StateGroup {
PropertyChanges {
target: vpntoggle
checked: false
+ checkable: true
}
PropertyChanges {
target: statusItem
@@ -65,6 +66,7 @@ StateGroup {
PropertyChanges {
target: vpntoggle
checked: true
+ checkable: true
}
PropertyChanges {
target: statusItem
@@ -122,6 +124,11 @@ StateGroup {
target: mainCurrentGateway
text: ""
}
+ PropertyChanges {
+ target: vpntoggle
+ checked: true
+ checkable: false
+ }
},
State {
name: "stopping"
@@ -147,6 +154,11 @@ StateGroup {
target: mainCurrentGateway
text: ""
}
+ PropertyChanges {
+ target: vpntoggle
+ checked: false
+ checkable: false
+ }
},
State {
name: "failed"
@@ -172,6 +184,11 @@ StateGroup {
target: mainCurrentGateway
text: ""
}
+ PropertyChanges {
+ target: vpntoggle
+ checked: false
+ checkable: true
+ }
}
]
}
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
+ }
}
}