Revision: 28159
          http://sourceforge.net/p/bibdesk/svn/28159
Author:   hofman
Date:     2023-01-02 15:20:46 +0000 (Mon, 02 Jan 2023)
Log Message:
-----------
create our own save type format popup button for export when we cannot find the 
one cretaed by the system

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

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2023-01-02 07:30:19 UTC (rev 28158)
+++ trunk/bibdesk/BibDocument.m 2023-01-02 15:20:46 UTC (rev 28159)
@@ -1072,9 +1072,22 @@
     
     if(docFlags.isExporting){
         NSPopUpButton *saveFormatPopupButton = popUpButtonSubview([savePanel 
accessoryView]);
-        BDSKASSERT(saveFormatPopupButton != nil);
+        BOOL createPopup = saveFormatPopupButton == nil;
+        if (createPopup) {
+            saveFormatPopupButton = [[NSPopUpButton alloc] init];
+            NSDocumentController *docController = [NSDocumentController 
sharedDocumentController];
+            for (NSString *type in [self 
writableTypesForSaveOperation:NSSaveToOperation]) {
+                [saveFormatPopupButton addItemWithTitle:[docController 
displayNameForType:type]];
+                [[saveFormatPopupButton lastItem] setRepresentedObject:type];
+            }
+            [saveFormatPopupButton selectItemAtIndex:0];
+            [saveFormatPopupButton setAction:@selector(changeSaveType:)];
+            [saveFormatPopupButton setTarget:self];
+        }
         [saveAccessoryController 
addSaveFormatPopUpButton:saveFormatPopupButton];
         [savePanel setAccessoryView:[saveAccessoryController 
exportAccessoryView]];
+        if (createPopup && [NSDocument 
instancesRespondToSelector:@selector(changeSaveType:)])
+            [super changeSaveType:saveFormatPopupButton];
     }else{
         [savePanel setAccessoryView:[saveAccessoryController 
saveAccessoryView]];
     }

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to