From: glenlow Date: Thu, 26 Feb 2009 12:44:55 +0000 (+0000) Subject: if application is opened directly, prompt with open file dialog X-Git-Tag: LAST_LIBGRAPH~32^2~2405 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e1246bd95a144d0c3f85ee4db5d156a8ab72b9c;p=graphviz if application is opened directly, prompt with open file dialog --- diff --git a/macosx/GVApplicationDelegate.h b/macosx/GVApplicationDelegate.h index 30921b10a..0845920a8 100644 --- a/macosx/GVApplicationDelegate.h +++ b/macosx/GVApplicationDelegate.h @@ -20,8 +20,12 @@ @interface GVApplicationDelegate : NSObject { GVAttributeInspectorController *_attributeInspectorController; + BOOL _applicationStarted; } - (IBAction)showAttributeInspector:(id)sender; +- (BOOL)applicationOpenUntitledFile:(NSApplication*)theApplication; +- (void)applicationDidFinishLaunching:(NSNotification*)aNotification; + @end diff --git a/macosx/GVApplicationDelegate.m b/macosx/GVApplicationDelegate.m index dd09eed08..1369e5e26 100644 --- a/macosx/GVApplicationDelegate.m +++ b/macosx/GVApplicationDelegate.m @@ -26,4 +26,16 @@ [_attributeInspectorController showWindow:sender]; } +- (BOOL)applicationOpenUntitledFile:(NSApplication*)theApplication +{ + if (!_applicationStarted) + [[NSDocumentController sharedDocumentController] openDocument:self]; + return YES; +} + +- (void)applicationDidFinishLaunching:(NSNotification*)aNotification +{ + _applicationStarted = YES; +} + @end