From b6e4c8209bd69a3b5c0822697b64e81c3cda4771 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 4 Aug 2019 21:34:30 -0400 Subject: [PATCH] Switches to showing 'File -> Open...' at launch. As per the prevailing wind. --- OSBindings/Mac/Clock Signal/AppDelegate.swift | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/AppDelegate.swift b/OSBindings/Mac/Clock Signal/AppDelegate.swift index 26aa5fb2f..c8e4b750b 100644 --- a/OSBindings/Mac/Clock Signal/AppDelegate.swift +++ b/OSBindings/Mac/Clock Signal/AppDelegate.swift @@ -12,15 +12,21 @@ import Cocoa class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { - // Insert code here to initialize your application + // Insert code here to initialize your application. } func applicationWillTerminate(_ aNotification: Notification) { - // Insert code here to tear down your application + // Insert code here to tear down your application. } - // decline to open a new file unless the user explicitly requests it func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool { + // Decline to show the 'New...' selector by default, preferring to offer + // an 'Open...' dialogue. + // + // Obiter: I dislike it when other applications do this for me, but it + // seems to be the new norm, and I've had user feedback that showing + // nothing is confusing. So here it is. + NSDocumentController.shared.openDocument(self) return false } }