]> granicus.if.org Git - graphviz/commitdiff
if application is opened directly, prompt with open file dialog
authorglenlow <devnull@localhost>
Thu, 26 Feb 2009 12:44:55 +0000 (12:44 +0000)
committerglenlow <devnull@localhost>
Thu, 26 Feb 2009 12:44:55 +0000 (12:44 +0000)
macosx/GVApplicationDelegate.h
macosx/GVApplicationDelegate.m

index 30921b10a659c7ff34a4296d009c1eade86f0e1a..0845920a8b7580773533432d13119a982ebbd38f 100644 (file)
 
 @interface GVApplicationDelegate : NSObject {
        GVAttributeInspectorController *_attributeInspectorController;
+       BOOL _applicationStarted;
 }
 
 - (IBAction)showAttributeInspector:(id)sender;
 
+- (BOOL)applicationOpenUntitledFile:(NSApplication*)theApplication;
+- (void)applicationDidFinishLaunching:(NSNotification*)aNotification;
+
 @end
index dd09eed08ac3e571cfca0dbeec4e2549967c7d38..1369e5e26e0fdad5ebd4f331629a2a10215d9e07 100644 (file)
        [_attributeInspectorController showWindow:sender];
 }
 
+- (BOOL)applicationOpenUntitledFile:(NSApplication*)theApplication
+{
+       if (!_applicationStarted)
+               [[NSDocumentController sharedDocumentController] openDocument:self];
+       return YES;
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification*)aNotification
+{
+       _applicationStarted = YES;
+}
+
 @end