diff --git a/Evergreen/AppDelegate.swift b/Evergreen/AppDelegate.swift index 888a727fc..fa8c115b0 100644 --- a/Evergreen/AppDelegate.swift +++ b/Evergreen/AppDelegate.swift @@ -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) { diff --git a/Evergreen/MainWindow/MainWindowController.swift b/Evergreen/MainWindow/MainWindowController.swift index ceea280a7..a5e9e8ec6 100644 --- a/Evergreen/MainWindow/MainWindowController.swift +++ b/Evergreen/MainWindow/MainWindowController.swift @@ -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 {