Revision: 29313
          http://sourceforge.net/p/bibdesk/svn/29313
Author:   hofman
Date:     2025-07-21 16:33:01 +0000 (Mon, 21 Jul 2025)
Log Message:
-----------
let documwnt forward customFieldDidChange: notification handler to editor, so 
it is guaranteed to be executed after the publication

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditor.h
    trunk/bibdesk/BDSKEditor.m
    trunk/bibdesk/BibDocument_UI.m

Modified: trunk/bibdesk/BDSKEditor.h
===================================================================
--- trunk/bibdesk/BDSKEditor.h  2025-07-21 16:00:13 UTC (rev 29312)
+++ trunk/bibdesk/BDSKEditor.h  2025-07-21 16:33:01 UTC (rev 29313)
@@ -211,6 +211,8 @@
 - (void)previewURLs:(nullable NSArray *)theURLs;
 - (void)stopPreviewing;
 
+- (void)customFieldsDidChange:(NSNotification *)notification;
+
 #pragma mark Person controller
 
 - (IBAction)showPersonDetail:(nullable id)sender;

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2025-07-21 16:00:13 UTC (rev 29312)
+++ trunk/bibdesk/BDSKEditor.m  2025-07-21 16:33:01 UTC (rev 29313)
@@ -119,7 +119,6 @@
 - (void)bibWasAddedOrRemoved:(NSNotification *)notification;
 - (void)bibDidChange:(NSNotification *)notification;
 - (void)typeInfoDidChange:(NSNotification *)aNotification;
-- (void)customFieldsDidChange:(NSNotification *)aNotification;
 - (void)macrosDidChange:(NSNotification *)aNotification;
 - (void)fileURLDidChange:(NSNotification *)notification;
 - (void)needsToBeFiledDidChange:(NSNotification *)notification;
@@ -2503,11 +2502,8 @@
     }
     if ((change & BDSKFieldTypeMaskInteger))
         [self setupCollectionView];
-    if ((change & BDSKFieldTypeMaskPerson)) {
-        // the publication will do this itself, but it needs to be done first
-        [publication resetGroupsAndPeople];
+    if ((change & BDSKFieldTypeMaskPerson))
         [authorTableView reloadData];
-    }
 }
 
 - (void)macrosDidChange:(NSNotification *)notification{
@@ -3495,10 +3491,6 @@
                name:BDSKBibTypeInfoChangedNotification
              object:[BDSKTypeManager sharedManager]];
     [nc addObserver:self
-           selector:@selector(customFieldsDidChange:)
-               name:BDSKCustomFieldsChangedNotification
-             object:[BDSKTypeManager sharedManager]];
-    [nc addObserver:self
            selector:@selector(macrosDidChange:)
                name:BDSKMacroDefinitionChangedNotification
              object:nil];

Modified: trunk/bibdesk/BibDocument_UI.m
===================================================================
--- trunk/bibdesk/BibDocument_UI.m      2025-07-21 16:00:13 UTC (rev 29312)
+++ trunk/bibdesk/BibDocument_UI.m      2025-07-21 16:33:01 UTC (rev 29313)
@@ -89,6 +89,7 @@
 #import "BDSKGroupCellView.h"
 #import "BDSKZoomablePDFView.h"
 #import "BDSKStatusBar.h"
+#import "BDSKEditor.h"
 
 static char BDSKDocumentFileViewObservationContext;
 static char BDSKDocumentOutlineViewObservationContext;
@@ -1596,6 +1597,10 @@
 
 - (void)handleCustomFieldsDidChangeNotification:(NSNotification *)notification{
     [publications makeObjectsPerformSelector:@selector(customFieldsDidChange:) 
withObject:notification];
+    for (NSWindowController *wc in [self windowControllers]) {
+        if ([wc isKindOfClass:[BDSKEditor class]])
+            [(BDSKEditor *)wc customFieldsDidChange:notification];
+    }
     [tableView updateTableColumnTypes];
     // current group field may have changed its type (string->person)
     [self updateFilteringGroups];

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