Improved open-dialog behavior in Cocoa

This commit is contained in:
Lior Halphon 2016-10-02 00:10:09 +03:00
parent 4904277f0d
commit 21b91adf6a
1 changed files with 4 additions and 5 deletions

View File

@ -53,11 +53,10 @@
[_preferencesWindow makeKeyAndOrderFront:self];
}
- (void)applicationDidBecomeActive:(NSNotification *)notification
- (BOOL)applicationOpenUntitledFile:(NSApplication *)sender
{
NSDocumentController *controller = [NSDocumentController sharedDocumentController];
if (![[controller documents] count]) {
[[NSDocumentController sharedDocumentController] openDocument:self];
}
[[NSDocumentController sharedDocumentController] openDocument:self];
return YES;
}
@end