summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-12-16 15:17:34 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-12-16 15:17:34 +0100
commit25a905ed7775ca8ecc12de158ff74d1e7447db17 (patch)
tree33e09ff761962cadde65c91dea5ab7f435b6ac12
parent66f3e3c57e54644c59caab987fd5bda5cae0ee0b (diff)
more fix
-rw-r--r--gui/components/MainView.qml3
-rw-r--r--gui/components/StatusBox.qml11
-rw-r--r--gui/components/Systray.qml7
-rw-r--r--pkg/helper/darwin.go3
4 files changed, 11 insertions, 13 deletions
diff --git a/gui/components/MainView.qml b/gui/components/MainView.qml
index 946e36f..25a388c 100644
--- a/gui/components/MainView.qml
+++ b/gui/components/MainView.qml
@@ -77,6 +77,9 @@ Page {
text: qsTr("Quit")
icon: "../resources/quit.svg"
triggered: function() {
+ if (ctx.status == "on") {
+ backend.switchOff()
+ }
Qt.callLater(backend.quit)
}
}
diff --git a/gui/components/StatusBox.qml b/gui/components/StatusBox.qml
index bfcc175..7715123 100644
--- a/gui/components/StatusBox.qml
+++ b/gui/components/StatusBox.qml
@@ -56,13 +56,6 @@ Item {
}
onClicked: {
settingsDrawer.toggle()
- /*
- if (stackView.depth > 1) {
- stackView.pop()
- } else {
- settingsDrawer.toggle()
- }
- */
}
Icon {
@@ -71,10 +64,6 @@ Item {
height: 16
anchors.centerIn: settingsButton
source: "../resources/gear-fill.svg"
- /*
- source: stackView.depth
- > 1 ? "../resources/arrow-left.svg" : "../resources/gear-fill.svg"
- */
}
}
diff --git a/gui/components/Systray.qml b/gui/components/Systray.qml
index f89bd16..51f3148 100644
--- a/gui/components/Systray.qml
+++ b/gui/components/Systray.qml
@@ -55,7 +55,12 @@ Labs.SystemTrayIcon {
Labs.MenuItem {
//: Part of the systray menu; quits the application
text: qsTr("Quit")
- onTriggered: backend.quit()
+ onTriggered: {
+ if (ctx.status == "on") {
+ backend.switchOff()
+ }
+ backend.quit()
+ }
}
}
diff --git a/pkg/helper/darwin.go b/pkg/helper/darwin.go
index 0cbc1bc..2db92a5 100644
--- a/pkg/helper/darwin.go
+++ b/pkg/helper/darwin.go
@@ -36,6 +36,7 @@ import (
"path/filepath"
"strconv"
"strings"
+ "time"
"github.com/sevlyar/go-daemon"
)
@@ -136,7 +137,7 @@ func firewallStop() error {
/* TODO return error if different from anchor not exists */
/*return errors.New("Error while stopping firewall")*/
}
- for i := range [50]int{} {
+ for _ = range [50]int{} {
if firewallIsUp() {
log.Printf("Firewall still up, waiting...")
time.Sleep(200 * time.Millisecond)