Revision: 29273
          http://sourceforge.net/p/bibdesk/svn/29273
Author:   hofman
Date:     2025-06-26 09:15:32 +0000 (Thu, 26 Jun 2025)
Log Message:
-----------
pass option to openFilesAtStartup

Modified Paths:
--------------
    trunk/bibdesk/BDSKAppController.m

Modified: trunk/bibdesk/BDSKAppController.m
===================================================================
--- trunk/bibdesk/BDSKAppController.m   2025-06-25 22:28:57 UTC (rev 29272)
+++ trunk/bibdesk/BDSKAppController.m   2025-06-26 09:15:32 UTC (rev 29273)
@@ -300,7 +300,7 @@
     }
 }
 
-- (void)openFilesAtStartup {
+- (void)openFilesAtStartup:(BOOL)atStartup {
     switch ([[NSUserDefaults standardUserDefaults] 
integerForKey:BDSKStartupBehaviorKey]) {
         case BDSKStartupOpenUntitledFile:
             [[NSDocumentController sharedDocumentController] 
openUntitledDocumentAndDisplay:YES error:NULL];
@@ -308,13 +308,15 @@
         case BDSKStartupDoNothing:
             break;
         case BDSKStartupOpenDialog:
-            [[NSDocumentController sharedDocumentController] openDocument:nil];
+            if (atStartup)
+                [[NSDocumentController sharedDocumentController] 
openDocument:nil];
             break;
         case BDSKStartupOpenDefaultFile:
             [self openDefaultFile];
             break;
         case BDSKStartupOpenLastOpenFiles:
-            [self openLastOpenFiles];
+            if (atStartup)
+                [self openLastOpenFiles];
             break;
         default:
             break;
@@ -371,7 +373,7 @@
         [sud removeObjectForKey:BDSKIsRelaunchKey];
         [self openLastOpenFiles];
     } else if ([[[aNotification userInfo] 
objectForKey:NSApplicationLaunchIsDefaultLaunchKey] boolValue]) {
-        [self openFilesAtStartup];
+        [self openFilesAtStartup:YES];
     }
     
     // register our help book, so it's available for methods that don't 
register this, e.g. the web group
@@ -479,9 +481,7 @@
 - (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication 
hasVisibleWindows:(BOOL)flag {
     if (flag)
         return YES;
-    NSInteger startupOption = [[NSUserDefaults standardUserDefaults] 
integerForKey:BDSKStartupBehaviorKey];
-    if (startupOption == BDSKStartupOpenUntitledFile || startupOption == 
BDSKStartupOpenDefaultFile)
-        [self openFilesAtStartup];
+    [self openFilesAtStartup:NO];
     return NO;
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to