Browse Source

Minor windowing changes.

pull/92/head
Abhishek 5 years ago
parent
commit
bb37012f78
  1. 9
      Clocker/Panel/ParentPanelController.swift
  2. 3
      Clocker/Preferences/Calendar/CalendarViewController.swift

9
Clocker/Panel/ParentPanelController.swift

@ -38,7 +38,10 @@ class ParentPanelController: NSWindowController {
private var note: NotesPopover?
private lazy var oneWindow = OneWindowController.shared()
private lazy var oneWindow: OneWindowController? = {
let preferencesStoryboard = NSStoryboard(name: "Preferences", bundle: nil)
return preferencesStoryboard.instantiateInitialController() as? OneWindowController
}()
@IBOutlet var mainTableView: PanelTableView!
@ -625,7 +628,7 @@ class ParentPanelController: NSWindowController {
}
private func openPreferences() {
oneWindow.showWindow(nil)
oneWindow?.showWindow(nil)
NSApp.activate(ignoringOtherApps: true)
}
@ -653,7 +656,7 @@ class ParentPanelController: NSWindowController {
}
private func showPermissionsWindow() {
oneWindow.openPermissions()
oneWindow?.openPermissions()
NSApp.activate(ignoringOtherApps: true)
}

3
Clocker/Preferences/Calendar/CalendarViewController.swift

@ -136,8 +136,7 @@ class CalendarViewController: ParentViewController {
@IBAction func grantAccess(_: Any) {
if grantAccessButton.title == "Grant Access".localized() {
OneWindowController.shared().openPermissions()
NSApp.activate(ignoringOtherApps: true)
(parent as? CenteredTabViewController)?.selectedTabViewItemIndex = 3 // 3 is the Permissions View
} else if grantAccessButton.title == "Launch Preferences" {
NSWorkspace.shared.launchApplication("System Preferences")
}

Loading…
Cancel
Save