mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 07:16:38 +00:00
[client, gui] fix exit nodes menu on reconnect, remove tooltips (#5167)
* [client, gui] fix exit nodes menu on reconnect clean s.exitNodeStates when disconnecting * disable tooltip for exit nodes and settings
This commit is contained in:
@@ -1033,7 +1033,7 @@ func (s *serviceClient) onTrayReady() {
|
|||||||
s.mDown.Disable()
|
s.mDown.Disable()
|
||||||
systray.AddSeparator()
|
systray.AddSeparator()
|
||||||
|
|
||||||
s.mSettings = systray.AddMenuItem("Settings", settingsMenuDescr)
|
s.mSettings = systray.AddMenuItem("Settings", disabledMenuDescr)
|
||||||
s.mAllowSSH = s.mSettings.AddSubMenuItemCheckbox("Allow SSH", allowSSHMenuDescr, false)
|
s.mAllowSSH = s.mSettings.AddSubMenuItemCheckbox("Allow SSH", allowSSHMenuDescr, false)
|
||||||
s.mAutoConnect = s.mSettings.AddSubMenuItemCheckbox("Connect on Startup", autoConnectMenuDescr, false)
|
s.mAutoConnect = s.mSettings.AddSubMenuItemCheckbox("Connect on Startup", autoConnectMenuDescr, false)
|
||||||
s.mEnableRosenpass = s.mSettings.AddSubMenuItemCheckbox("Enable Quantum-Resistance", quantumResistanceMenuDescr, false)
|
s.mEnableRosenpass = s.mSettings.AddSubMenuItemCheckbox("Enable Quantum-Resistance", quantumResistanceMenuDescr, false)
|
||||||
@@ -1060,7 +1060,7 @@ func (s *serviceClient) onTrayReady() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s.exitNodeMu.Lock()
|
s.exitNodeMu.Lock()
|
||||||
s.mExitNode = systray.AddMenuItem("Exit Node", exitNodeMenuDescr)
|
s.mExitNode = systray.AddMenuItem("Exit Node", disabledMenuDescr)
|
||||||
s.mExitNode.Disable()
|
s.mExitNode.Disable()
|
||||||
s.exitNodeMu.Unlock()
|
s.exitNodeMu.Unlock()
|
||||||
|
|
||||||
@@ -1261,7 +1261,6 @@ func (s *serviceClient) setSettingsEnabled(enabled bool) {
|
|||||||
if s.mSettings != nil {
|
if s.mSettings != nil {
|
||||||
if enabled {
|
if enabled {
|
||||||
s.mSettings.Enable()
|
s.mSettings.Enable()
|
||||||
s.mSettings.SetTooltip(settingsMenuDescr)
|
|
||||||
} else {
|
} else {
|
||||||
s.mSettings.Hide()
|
s.mSettings.Hide()
|
||||||
s.mSettings.SetTooltip("Settings are disabled by daemon")
|
s.mSettings.SetTooltip("Settings are disabled by daemon")
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
const (
|
const (
|
||||||
settingsMenuDescr = "Settings of the application"
|
|
||||||
profilesMenuDescr = "Manage your profiles"
|
|
||||||
allowSSHMenuDescr = "Allow SSH connections"
|
allowSSHMenuDescr = "Allow SSH connections"
|
||||||
autoConnectMenuDescr = "Connect automatically when the service starts"
|
autoConnectMenuDescr = "Connect automatically when the service starts"
|
||||||
quantumResistanceMenuDescr = "Enable post-quantum security via Rosenpass"
|
quantumResistanceMenuDescr = "Enable post-quantum security via Rosenpass"
|
||||||
@@ -11,7 +9,7 @@ const (
|
|||||||
notificationsMenuDescr = "Enable notifications"
|
notificationsMenuDescr = "Enable notifications"
|
||||||
advancedSettingsMenuDescr = "Advanced settings of the application"
|
advancedSettingsMenuDescr = "Advanced settings of the application"
|
||||||
debugBundleMenuDescr = "Create and open debug information bundle"
|
debugBundleMenuDescr = "Create and open debug information bundle"
|
||||||
exitNodeMenuDescr = "Select exit node for routing traffic"
|
disabledMenuDescr = ""
|
||||||
networksMenuDescr = "Open the networks management window"
|
networksMenuDescr = "Open the networks management window"
|
||||||
latestVersionMenuDescr = "Download latest version"
|
latestVersionMenuDescr = "Download latest version"
|
||||||
quitMenuDescr = "Quit the client app"
|
quitMenuDescr = "Quit the client app"
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ func (h *eventHandler) handleConnectClick() {
|
|||||||
func (h *eventHandler) handleDisconnectClick() {
|
func (h *eventHandler) handleDisconnectClick() {
|
||||||
h.client.mDown.Disable()
|
h.client.mDown.Disable()
|
||||||
|
|
||||||
|
h.client.exitNodeStates = []exitNodeState{}
|
||||||
|
|
||||||
if h.client.connectCancel != nil {
|
if h.client.connectCancel != nil {
|
||||||
log.Debugf("cancelling ongoing connect operation")
|
log.Debugf("cancelling ongoing connect operation")
|
||||||
h.client.connectCancel()
|
h.client.connectCancel()
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ func (s *serviceClient) recreateExitNodeMenu(exitNodes []*proto.Network) {
|
|||||||
|
|
||||||
if runtime.GOOS == "linux" || runtime.GOOS == "freebsd" {
|
if runtime.GOOS == "linux" || runtime.GOOS == "freebsd" {
|
||||||
s.mExitNode.Remove()
|
s.mExitNode.Remove()
|
||||||
s.mExitNode = systray.AddMenuItem("Exit Node", exitNodeMenuDescr)
|
s.mExitNode = systray.AddMenuItem("Exit Node", disabledMenuDescr)
|
||||||
}
|
}
|
||||||
|
|
||||||
var showDeselectAll bool
|
var showDeselectAll bool
|
||||||
|
|||||||
Reference in New Issue
Block a user