Run the new-folder sheet on the frontmost window.

This commit is contained in:
Brent Simmons 2017-11-15 13:13:40 -08:00
parent 3612469954
commit baaf9c1a02
2 changed files with 14 additions and 3 deletions

View File

@ -54,6 +54,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations {
appDelegate = self
}
// MARK: - API
func logMessage(_ message: String, type: LogItem.ItemType) {
let logItem = LogItem(type: type, message: message)
@ -65,6 +67,12 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations {
logMessage(message, type: .debug)
}
func showAddFolderSheetOnWindow(_ window: NSWindow) {
addFolderWindowController = AddFolderWindowController()
addFolderWindowController!.runSheetOnWindow(window)
}
// MARK: - NSApplicationDelegate
func applicationDidFinishLaunching(_ note: Notification) {
@ -211,9 +219,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations {
@IBAction func showAddFolderWindow(_ sender: AnyObject) {
createAndShowMainWindow()
addFolderWindowController = AddFolderWindowController()
addFolderWindowController!.runSheetOnWindow(mainWindowController!.window!)
showAddFolderSheetOnWindow(mainWindowController!.window!)
}
@IBAction func showFeedList(_ sender: AnyObject) {

View File

@ -111,6 +111,11 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
// MARK: Actions
@IBAction func showAddFolderWindow(_ sender: AnyObject) {
appDelegate.showAddFolderSheetOnWindow(window!)
}
@IBAction func openArticleInBrowser(_ sender: AnyObject?) {
if let link = currentLink {