|
|
@ -51,22 +51,6 @@ class OneWindowController: NSWindowController { |
|
|
|
window?.identifier = NSUserInterfaceItemIdentifier("Preferences") |
|
|
|
window?.identifier = NSUserInterfaceItemIdentifier("Preferences") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func openPermissions() { |
|
|
|
|
|
|
|
guard let window = window else { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !window.isMainWindow || !window.isVisible { |
|
|
|
|
|
|
|
showWindow(nil) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
guard let tabViewController = contentViewController as? CenteredTabViewController else { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tabViewController.selectedTabViewItemIndex = 3 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private func setupToolbarImages() { |
|
|
|
private func setupToolbarImages() { |
|
|
|
guard let tabViewController = contentViewController as? CenteredTabViewController else { |
|
|
|
guard let tabViewController = contentViewController as? CenteredTabViewController else { |
|
|
|
return |
|
|
|
return |
|
|
@ -92,4 +76,33 @@ class OneWindowController: NSWindowController { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: Public |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func openPermissionsPane() { |
|
|
|
|
|
|
|
openPreferenceTab(at: 3) |
|
|
|
|
|
|
|
NSApp.activate(ignoringOtherApps: true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Action mapped to the + button in the PanelController. We should always open the General Pane when the + button is clicked. |
|
|
|
|
|
|
|
func openGeneralPane() { |
|
|
|
|
|
|
|
openPreferenceTab(at: 0) |
|
|
|
|
|
|
|
NSApp.activate(ignoringOtherApps: true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private func openPreferenceTab(at index: Int) { |
|
|
|
|
|
|
|
guard let window = window else { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !window.isMainWindow || !window.isVisible { |
|
|
|
|
|
|
|
showWindow(nil) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
guard let tabViewController = contentViewController as? CenteredTabViewController else { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tabViewController.selectedTabViewItemIndex = index |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|