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 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! @IBOutlet var mainTableView: PanelTableView!
@ -625,7 +628,7 @@ class ParentPanelController: NSWindowController {
} }
private func openPreferences() { private func openPreferences() {
oneWindow.showWindow(nil) oneWindow?.showWindow(nil)
NSApp.activate(ignoringOtherApps: true) NSApp.activate(ignoringOtherApps: true)
} }
@ -653,7 +656,7 @@ class ParentPanelController: NSWindowController {
} }
private func showPermissionsWindow() { private func showPermissionsWindow() {
oneWindow.openPermissions() oneWindow?.openPermissions()
NSApp.activate(ignoringOtherApps: true) NSApp.activate(ignoringOtherApps: true)
} }

3
Clocker/Preferences/Calendar/CalendarViewController.swift

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

Loading…
Cancel
Save