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,20 +79,8 @@ class ShowNetworksViewController: NSViewController, NSTableViewDelegate, NSTable
if network.connected {
cell.connectedCheckbox.state = NSOnState
cell.allowDefault.enabled = true
cell.allowGlobal.enabled = true
cell.allowManaged.enabled = true
}
else {
cell.connectedCheckbox.state = NSOffState
cell.allowDefault.enabled = false
cell.allowGlobal.enabled = false
cell.allowManaged.enabled = false
}
if network.allowDefault {
cell.allowDefault.enabled = true
cell.allowDefault.state = NSOnState
}
else {
@ -106,6 +94,17 @@ class ShowNetworksViewController: NSViewController, NSTableViewDelegate, NSTable
}
}
cell.allowGlobal.enabled = true
cell.allowManaged.enabled = true
}
else {
cell.connectedCheckbox.state = NSOffState
cell.allowDefault.enabled = false
cell.allowGlobal.enabled = false
cell.allowManaged.enabled = false
}
cell.allowGlobal.state = (network.allowGlobal ? NSOnState : NSOffState)
cell.allowManaged.state = (network.allowManaged ? NSOnState : NSOffState)