Revision: 29320
          http://sourceforge.net/p/bibdesk/svn/29320
Author:   hofman
Date:     2025-07-21 22:29:32 +0000 (Mon, 21 Jul 2025)
Log Message:
-----------
Reload items in peerson window when person fields changed. Can simply call 
customFieldsDidChange: on all window controllers.

Modified Paths:
--------------
    trunk/bibdesk/BDSKPersonController.h
    trunk/bibdesk/BDSKPersonController.m
    trunk/bibdesk/BibDocument_UI.m
    trunk/bibdesk/NSWindowController_BDSKExtensions.h
    trunk/bibdesk/NSWindowController_BDSKExtensions.m

Modified: trunk/bibdesk/BDSKPersonController.h
===================================================================
--- trunk/bibdesk/BDSKPersonController.h        2025-07-21 21:51:02 UTC (rev 
29319)
+++ trunk/bibdesk/BDSKPersonController.h        2025-07-21 22:29:32 UTC (rev 
29320)
@@ -102,6 +102,7 @@
 - (void)handleBibItemAddDel:(NSNotification *)note;
 - (void)handleBibItemChanged:(nullable NSNotification *)note;
 - (void)handleGroupWillBeRemoved:(NSNotification *)note;
+- (void)customFieldsDidChange:(NSNotification *)note;
 - (void)openSelectedPub:(id)sender;
 - (void)changeNameToString:(NSString *)newNameString;
 

Modified: trunk/bibdesk/BDSKPersonController.m
===================================================================
--- trunk/bibdesk/BDSKPersonController.m        2025-07-21 21:51:02 UTC (rev 
29319)
+++ trunk/bibdesk/BDSKPersonController.m        2025-07-21 22:29:32 UTC (rev 
29320)
@@ -330,6 +330,14 @@
         [self close];
 }
 
+- (void)customFieldsDidChange:(NSNotification *)note{
+    BDSKFieldTypeMask change = [[[note userInfo] 
objectForKey:BDSKChangedFieldTypesKey] unsignedIntegerValue];
+    if ((change & BDSKFieldTypeMaskPerson)) {
+        fields = [[[BDSKTypeManager sharedManager] personFieldsSet] copy];
+        [self setPublicationItems:nil];
+    }
+}
+
 - (void)openSelectedPub:(id)sender{
     NSInteger row = [publicationTableView selectedRow];
     if (row != -1)

Modified: trunk/bibdesk/BibDocument_UI.m
===================================================================
--- trunk/bibdesk/BibDocument_UI.m      2025-07-21 21:51:02 UTC (rev 29319)
+++ trunk/bibdesk/BibDocument_UI.m      2025-07-21 22:29:32 UTC (rev 29320)
@@ -1597,10 +1597,7 @@
 
 - (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];
-    }
+    [[self windowControllers] 
makeObjectsPerformSelector:@selector(customFieldsDidChange:) 
withObject:notification];
     [tableView updateTableColumnTypes];
     // current group field may have changed its type (string->person)
     [self updateFilteringGroups];

Modified: trunk/bibdesk/NSWindowController_BDSKExtensions.h
===================================================================
--- trunk/bibdesk/NSWindowController_BDSKExtensions.h   2025-07-21 21:51:02 UTC 
(rev 29319)
+++ trunk/bibdesk/NSWindowController_BDSKExtensions.h   2025-07-21 22:29:32 UTC 
(rev 29320)
@@ -56,6 +56,8 @@
 - (BOOL)shouldDismissSheetWithReturnCode:(NSModalResponse)returnCode;
 - (void)didDismissSheet;
 
+- (void)customFieldsDidChange:(NSNotification *)notification;
+
 @end
 
 NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/NSWindowController_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSWindowController_BDSKExtensions.m   2025-07-21 21:51:02 UTC 
(rev 29319)
+++ trunk/bibdesk/NSWindowController_BDSKExtensions.m   2025-07-21 22:29:32 UTC 
(rev 29320)
@@ -122,6 +122,8 @@
     [window endSheet:[self window] returnCode:[sender tag]];
 }
 
+- (void)customFieldsDidChange:(NSNotification *)notification {}
+
 @end
 
 

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