Revision: 28866
          http://sourceforge.net/p/bibdesk/svn/28866
Author:   hofman
Date:     2024-04-26 14:35:51 +0000 (Fri, 26 Apr 2024)
Log Message:
-----------
Auto-complete limited set of fields rather then excluding various sets.

Modified Paths:
--------------
    trunk/bibdesk/BDSKCompletionManager.m
    trunk/bibdesk/BDSKStringConstants.h
    trunk/bibdesk/BDSKStringConstants.m
    trunk/bibdesk/BDSKTypeManager.m

Modified: trunk/bibdesk/BDSKCompletionManager.m
===================================================================
--- trunk/bibdesk/BDSKCompletionManager.m       2024-04-25 22:42:39 UTC (rev 
28865)
+++ trunk/bibdesk/BDSKCompletionManager.m       2024-04-26 14:35:51 UTC (rev 
28866)
@@ -49,6 +49,13 @@
 
 static id sharedManager = nil;
 
+static NSSet *completedFields = nil;
+
++ (void)initialize {
+    BDSKINITIALIZE;
+    completedFields = [[NSSet alloc] initWithObjects:BDSKBooktitleString, 
BDSKJournalString, BDSKInstitutionString, BDSKPublisherString, 
BDSKSchoolString, BDSKOrganizationString, BDSKAddressString, 
BDSKKeywordsString, BDSKCrossrefString, nil];
+}
+
 + (id)sharedManager {
     if (sharedManager == nil)
         sharedManager = [[self alloc] init];
@@ -77,7 +84,7 @@
     
     if ([entry isEqualToString:BDSKTitleString])
         entry = BDSKBooktitleString;
-    else if ([NSString isEmptyString:entry] || [entry isInvalidGroupField] || 
[entry isPersonField] || [entry isCitationField] || [entry 
isEqualToString:BDSKYearString] || [entry hasPrefix:@"Bdsk-"])
+    else if ([completedFields containsObject:entry] == NO)
                return;
        
     NSMutableSet *completionSet = [self setForCompletionEntry:entry];
@@ -104,7 +111,7 @@
     
     if ([entry isEqualToString:BDSKTitleString])
         entry = BDSKBooktitleString;
-    else if ([NSString isEmptyString:entry] || [entry isInvalidGroupField] || 
[entry isPersonField] || [entry isCitationField] || [entry 
isEqualToString:BDSKYearString] || [entry hasPrefix:@"Bdsk-"])
+    else if ([completedFields containsObject:entry] == NO)
         return;
     
     NSMutableSet *completionSet = [autoCompletionDict objectForKey:entry];

Modified: trunk/bibdesk/BDSKStringConstants.h
===================================================================
--- trunk/bibdesk/BDSKStringConstants.h 2024-04-25 22:42:39 UTC (rev 28865)
+++ trunk/bibdesk/BDSKStringConstants.h 2024-04-26 14:35:51 UTC (rev 28866)
@@ -223,8 +223,6 @@
 extern NSString *BDSKCommentedString;
 extern NSString *BDSKConferenceString;
 extern NSString *BDSKMiscString;
-extern NSString *BDSKInstitutionString;
-extern NSString *BDSKSchoolString;
 extern NSString *BDSKUnpublishedString;
 extern NSString *BDSKMastersThesisString;
 extern NSString *BDSKPhDThesisString;
@@ -258,6 +256,9 @@
 extern NSString *BDSKUrlString;
 extern NSString *BDSKTypeString;
 extern NSString *BDSKAddressString;
+extern NSString *BDSKInstitutionString;
+extern NSString *BDSKSchoolString;
+extern NSString *BDSKOrganizationString;
 extern NSString *BDSKDoiString;
 extern NSString *BDSKCiteseerUrlString;
 extern NSString *BDSKColorString;

Modified: trunk/bibdesk/BDSKStringConstants.m
===================================================================
--- trunk/bibdesk/BDSKStringConstants.m 2024-04-25 22:42:39 UTC (rev 28865)
+++ trunk/bibdesk/BDSKStringConstants.m 2024-04-26 14:35:51 UTC (rev 28866)
@@ -256,10 +256,11 @@
 NSString *BDSKReadString = @"Read";
 NSString *BDSKTypeString = @"Type";
 NSString *BDSKAddressString = @"Address";
+NSString *BDSKInstitutionString = @"Institution";
+NSString *BDSKSchoolString = @"School";
+NSString *BDSKOrganizationString = @"Organization";
 NSString *BDSKDoiString = @"Doi";
 NSString *BDSKCiteseerUrlString = @"Citeseerurl";
-NSString *BDSKInstitutionString = @"Institution";
-NSString *BDSKSchoolString = @"School";
 
 NSString *BDSKBibtexString = @"BibTeX";
 NSString *BDSKFirstAuthorString = @"1st Author";

Modified: trunk/bibdesk/BDSKTypeManager.m
===================================================================
--- trunk/bibdesk/BDSKTypeManager.m     2024-04-25 22:42:39 UTC (rev 28865)
+++ trunk/bibdesk/BDSKTypeManager.m     2024-04-26 14:35:51 UTC (rev 28866)
@@ -254,7 +254,7 @@
                BDSKAbstractString, BDSKAnnoteString, BDSKRssDescriptionString, 
nil];
        [invalidFields unionSet:allURLFields];
     
-    NSMutableSet *singleValuedFields = [NSMutableSet 
setWithObjects:BDSKPubTypeString, BDSKTypeString, BDSKCrossrefString, 
BDSKJournalString, BDSKBooktitleString, BDSKVolumetitleString, BDSKYearString, 
BDSKMonthString, BDSKPublisherString, BDSKAddressString, BDSKColorString, nil];
+    NSMutableSet *singleValuedFields = [NSMutableSet 
setWithObjects:BDSKPubTypeString, BDSKTypeString, BDSKCrossrefString, 
BDSKJournalString, BDSKBooktitleString, BDSKVolumetitleString, BDSKYearString, 
BDSKMonthString, BDSKPublisherString, BDSKAddressString, BDSKInstitutionString, 
BDSKSchoolString, BDSKOrganizationString, BDSKColorString, nil];
        [singleValuedFields unionSet:ratingFields];
        [singleValuedFields unionSet:booleanFields];
        [singleValuedFields unionSet:triStateFields];  

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