fix a case where the "Allow Default" checkbox would be enabled when a network wasn't connected.

This commit is contained in:
Grant Limberg 2016-06-30 20:35:32 -07:00
parent 58207b30d1
commit fe725f9995

View File

@ -79,7 +79,21 @@ class ShowNetworksViewController: NSViewController, NSTableViewDelegate, NSTable
if network.connected {
cell.connectedCheckbox.state = NSOnState
cell.allowDefault.enabled = true
if network.allowDefault {
cell.allowDefault.enabled = true
cell.allowDefault.state = NSOnState
}
else {
cell.allowDefault.state = NSOffState
if defaultRouteExists(networkList) {
cell.allowDefault.enabled = false
}
else {
cell.allowDefault.enabled = true
}
}
cell.allowGlobal.enabled = true
cell.allowManaged.enabled = true
}
@ -91,21 +105,6 @@ class ShowNetworksViewController: NSViewController, NSTableViewDelegate, NSTable
cell.allowManaged.enabled = false
}
if network.allowDefault {
cell.allowDefault.state = NSOnState
}
else {
cell.allowDefault.state = NSOffState
if defaultRouteExists(networkList) {
cell.allowDefault.enabled = false
}
else {
cell.allowDefault.enabled = true
}
}
cell.allowGlobal.state = (network.allowGlobal ? NSOnState : NSOffState)
cell.allowManaged.state = (network.allowManaged ? NSOnState : NSOffState)