diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-09-06 21:08:14 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-11-23 21:51:01 +0100 |
commit | 8543125fa656ddc2c114072adfc27e4e7c461695 (patch) | |
tree | 176f90c03f64c2645932dbaf3d87f2ad22b61489 /gui/components/VPNState.qml | |
parent | b8e0fe3b5003d22043042110e8036f4383602545 (diff) |
[ui] transient connecting state
Diffstat (limited to 'gui/components/VPNState.qml')
-rw-r--r-- | gui/components/VPNState.qml | 55 |
1 files changed, 48 insertions, 7 deletions
diff --git a/gui/components/VPNState.qml b/gui/components/VPNState.qml index 9d443ce..5e659a9 100644 --- a/gui/components/VPNState.qml +++ b/gui/components/VPNState.qml @@ -11,17 +11,49 @@ StateGroup { property var stopping: "stopping" property var failed: "failed" - state: ctx ? ctx.status : vpnStates.off + property bool startingUI: false + + state: ctx ? ctx.status : off states: [ State { name: initializing }, State { - name: off + when: ctx && ctx.status == "off" && startingUI == true + PropertyChanges { + target: connectionState + text: qsTr("Connecting") + } + PropertyChanges { + target: statusBoxBackground + border.color: Theme.accentConnecting + } + PropertyChanges { + target: connectionImage + source: "../resources/birds.svg" + anchors.horizontalCenter: parent.horizontalCenter + } + PropertyChanges { + target: toggleVPN + enabled: false + text: ("...") + } + PropertyChanges { + target: systray + tooltip: toHuman("connecting") + icon.source: icons["wait"] + } + PropertyChanges { + target: systray.statusItem + text: toHuman("connecting") + } + }, + State { + name: "off" PropertyChanges { target: connectionState - text: qsTr("Connection\nUnsecured") + text: qsTr("Unsecured\nConnection") } PropertyChanges { target: statusBoxBackground @@ -33,6 +65,7 @@ StateGroup { } PropertyChanges { target: toggleVPN + enabled: true text: qsTr("Turn on") } PropertyChanges { @@ -44,14 +77,16 @@ StateGroup { text: toHuman("off") } StateChangeScript { - script: {} + script: { + console.debug("status off") + } } }, State { name: on PropertyChanges { target: connectionState - text: qsTr("Connection\nSecured") + text: qsTr("Secured\nConnection") } PropertyChanges { target: statusBoxBackground @@ -63,6 +98,7 @@ StateGroup { } PropertyChanges { target: toggleVPN + enabled: true text: qsTr("Turn off") } PropertyChanges { @@ -75,7 +111,9 @@ StateGroup { text: toHuman("on") } StateChangeScript { - script: {} + script: { + vpn.startingUI = false + } } }, State { @@ -95,6 +133,7 @@ StateGroup { } PropertyChanges { target: toggleVPN + enabled: true text: qsTr("Cancel") } PropertyChanges { @@ -107,7 +146,9 @@ StateGroup { text: toHuman("connecting") } StateChangeScript { - script: {} + script: { + vpn.startingUI = false + } } }, State { |