From 66f3e3c57e54644c59caab987fd5bda5cae0ee0b Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Thu, 16 Dec 2021 13:54:03 +0100 Subject: osx fw stop --- gui/components/MainView.qml | 12 ++++++------ gui/components/Systray.qml | 2 +- pkg/helper/darwin.go | 11 +++++++++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/gui/components/MainView.qml b/gui/components/MainView.qml index 886e896..946e36f 100644 --- a/gui/components/MainView.qml +++ b/gui/components/MainView.qml @@ -48,36 +48,36 @@ Page { ListElement { text: qsTr("Preferences") icon: "../resources/tools.svg" - triggered: function () { + triggered: function() { stackView.push("Preferences.qml") } } ListElement { text: qsTr("Donate") icon: "../resources/donate.svg" - triggered: function () { + triggered: function() { Qt.openUrlExternally(ctx.donateURL) } } ListElement { text: qsTr("Help") icon: "../resources/help.svg" - triggered: function () { + triggered: function() { stackView.push("Help.qml") } } // -> can link to another dialog with report bug / support / contribute / FAQ ListElement { text: qsTr("About") icon: "../resources/about.svg" - triggered: function () { + triggered: function() { stackView.push("About.qml") } } ListElement { text: qsTr("Quit") icon: "../resources/quit.svg" - triggered: function () { - backend.quit() + triggered: function() { + Qt.callLater(backend.quit) } } } // end listmodel diff --git a/gui/components/Systray.qml b/gui/components/Systray.qml index f25860c..f89bd16 100644 --- a/gui/components/Systray.qml +++ b/gui/components/Systray.qml @@ -53,7 +53,7 @@ Labs.SystemTrayIcon { } Labs.MenuItem { - //: Part of the systray menu; quits que application + //: Part of the systray menu; quits the application text: qsTr("Quit") onTriggered: backend.quit() } diff --git a/pkg/helper/darwin.go b/pkg/helper/darwin.go index a9f8e00..0cbc1bc 100644 --- a/pkg/helper/darwin.go +++ b/pkg/helper/darwin.go @@ -135,9 +135,16 @@ func firewallStop() error { log.Printf("An error ocurred stopping the firewall: %v", out) /* TODO return error if different from anchor not exists */ /*return errors.New("Error while stopping firewall")*/ - return nil } - return nil + for i := range [50]int{} { + if firewallIsUp() { + log.Printf("Firewall still up, waiting...") + time.Sleep(200 * time.Millisecond) + } else { + return nil + } + } + return errors.New("Could not stop firewall") } func firewallIsUp() bool { -- cgit v1.2.3