Revision: 28179
          http://sourceforge.net/p/bibdesk/svn/28179
Author:   hofman
Date:     2023-02-23 22:35:13 +0000 (Thu, 23 Feb 2023)
Log Message:
-----------
Add property for whether cite key was edited, use this for cite key auto 
generation warning. Fix comment.

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditor.m
    trunk/bibdesk/BibDocument.m
    trunk/bibdesk/BibItem.h
    trunk/bibdesk/BibItem.m
    trunk/bibdesk/de.lproj/Localizable.strings
    trunk/bibdesk/en.lproj/Localizable.strings
    trunk/bibdesk/fr.lproj/Localizable.strings

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2023-02-23 22:23:08 UTC (rev 28178)
+++ trunk/bibdesk/BDSKEditor.m  2023-02-23 22:35:13 UTC (rev 28179)
@@ -659,12 +659,12 @@
 - (IBAction)showCiteKeyWarning:(id)sender{
     if ([publication hasEmptyOrDefaultCiteKey]) {
         NSAlert *alert = [[[NSAlert alloc] init] autorelease];
-        [alert setMessageText:NSLocalizedString(@"Cite Key Not Set", @"Message 
in alert dialog when duplicate citye key was found")];
+        [alert setMessageText:NSLocalizedString(@"Cite Key Not Set", @"Message 
in alert dialog when duplicate cite key was found")];
         [alert setInformativeText:NSLocalizedString(@"The cite key has not 
been set. Please provide one.", @"Informative text in alert dialog")];
         [alert beginSheetModalForWindow:[self window] completionHandler:NULL];
     } else if ([publication isValidCiteKey:[publication citeKey]] == NO) {
         NSAlert *alert = [[[NSAlert alloc] init] autorelease];
-        [alert setMessageText:NSLocalizedString(@"Duplicate Cite Key", 
@"Message in alert dialog when duplicate citye key was found")];
+        [alert setMessageText:NSLocalizedString(@"Duplicate Cite Key", 
@"Message in alert dialog when duplicate cite key was found")];
         [alert setInformativeText:NSLocalizedString(@"The cite key you entered 
is either already used in this document. Please provide a unique one.", 
@"Informative text in alert dialog")];
         [alert beginSheetModalForWindow:[self window] completionHandler:NULL];
     }
@@ -2853,7 +2853,7 @@
 }
 
 - (void)updateCiteKeyAutoGenerateStatus{
-       if ([publication hasEmptyOrDefaultCiteKey] && [[NSUserDefaults 
standardUserDefaults] boolForKey:BDSKCiteKeyAutogenerateKey]) {
+       if ([publication hasEditedCiteKey] == NO && [[NSUserDefaults 
standardUserDefaults] boolForKey:BDSKCiteKeyAutogenerateKey]) {
                if ([[statusBar iconIdentifiers] 
containsObject:BDSKNeedsToGenerateCiteKeyIdentifier] == NO) {
                        NSString *tooltip = NSLocalizedString(@"The cite key 
needs to be generated.", @"Tool tip message");
                        [statusBar addIcon:[NSImage 
imageNamed:@"CiteKeyPreferences"] 
withIdentifier:BDSKNeedsToGenerateCiteKeyIdentifier toolTip:tooltip];

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2023-02-23 22:23:08 UTC (rev 28178)
+++ trunk/bibdesk/BibDocument.m 2023-02-23 22:35:13 UTC (rev 28179)
@@ -2258,7 +2258,7 @@
         [self reportTemporaryCiteKeys:tmpCiteKey forNewDocument:NO];
     } else if (hasDuplicateCiteKey) { // should we do this when we don't edit?
         NSAlert *alert = [[[NSAlert alloc] init] autorelease];
-        [alert setMessageText:NSLocalizedString(@"Duplicate Cite Key", 
@"Message in alert dialog when duplicate citye key was found")];
+        [alert setMessageText:NSLocalizedString(@"Duplicate Cite Key", 
@"Message in alert dialog when duplicate cite key was found")];
         [alert setInformativeText:NSLocalizedString(@"One or more items you 
added have a cite key which is either already used in this document. You should 
provide a unique one.", @"Informative text in alert dialog")];
         // don't begin a sheet, because the edit command may have one put up 
already
         [alert runModal];

Modified: trunk/bibdesk/BibItem.h
===================================================================
--- trunk/bibdesk/BibItem.h     2023-02-23 22:23:08 UTC (rev 28178)
+++ trunk/bibdesk/BibItem.h     2023-02-23 22:35:13 UTC (rev 28179)
@@ -108,7 +108,7 @@
     NSMutableDictionary *URLs;
     NSNumber * fileOrder;
     BOOL hasBeenEdited;
-    BOOL citeKeyEdited;
+    BOOL hasEditedCiteKey;
     NSMutableSet *filesToBeFiled;
     BOOL localUrlNeedsToBeFiled;
        id<BDSKOwner> owner;
@@ -589,6 +589,7 @@
 - (BOOL)isValidCiteKey:(NSString *)proposedCiteKey;
 
 @property (nonatomic, readonly) BOOL hasEmptyOrDefaultCiteKey;
+@property (nonatomic, readonly) BOOL hasEditedCiteKey;
 
 /*
     @method canGenerateAndSetCiteKey

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2023-02-23 22:23:08 UTC (rev 28178)
+++ trunk/bibdesk/BibItem.m     2023-02-23 22:35:13 UTC (rev 28179)
@@ -199,7 +199,7 @@
 @implementation BibItem
 
 @synthesize owner, macroResolver, downloads, fileOrder, identifierURL, 
date=pubDate, dateAdded, dateModified, pubType, citeKey, hasBeenEdited, 
pubFields, searchScore, imported, itemIndex;
-@dynamic undoManager, localFiles, existingLocalFiles, remoteURLs, usedMacros, 
usedLocalMacros, allPeople, people, numberOfAuthors, pubAuthors, firstAuthor, 
secondAuthor, thirdAuthor, lastAuthor, bibTeXAuthorString, 
numberOfAuthorsOrEditors, pubAuthorsOrEditors, firstAuthorOrEditor, 
secondAuthorOrEditor, thirdAuthorOrEditor, lastAuthorOrEditor, crossrefParent, 
title, displayTitle, container, sortingTitle, sortingContainer, 
sortingBooktitle, rating, color, suggestedCiteKey, hasEmptyOrDefaultCiteKey, 
canGenerateAndSetCiteKey, allFieldNames, searchIndexInfo, completionObject, 
bibTeXString, RISStringValue, MODSXMLValue, endNoteXMLValue, wordXMLValue, 
RSSStringValue, requiredFields, optionalFields, defaultFields, allFields, 
fields, urls, persons, fieldComponents, authors, editors, authorsOrEditors, 
keywords, currentDate, textSkimNotes, richTextSkimNotes, linkedText, remoteURL, 
localURL, localUrlPath, URLFields, skimNotesForLocalURL, bdskURL;
+@dynamic undoManager, localFiles, existingLocalFiles, remoteURLs, usedMacros, 
usedLocalMacros, allPeople, people, numberOfAuthors, pubAuthors, firstAuthor, 
secondAuthor, thirdAuthor, lastAuthor, bibTeXAuthorString, 
numberOfAuthorsOrEditors, pubAuthorsOrEditors, firstAuthorOrEditor, 
secondAuthorOrEditor, thirdAuthorOrEditor, lastAuthorOrEditor, crossrefParent, 
title, displayTitle, container, sortingTitle, sortingContainer, 
sortingBooktitle, rating, color, suggestedCiteKey, hasEmptyOrDefaultCiteKey, 
hasEditedCiteKey, canGenerateAndSetCiteKey, allFieldNames, searchIndexInfo, 
completionObject, bibTeXString, RISStringValue, MODSXMLValue, endNoteXMLValue, 
wordXMLValue, RSSStringValue, requiredFields, optionalFields, defaultFields, 
allFields, fields, urls, persons, fieldComponents, authors, editors, 
authorsOrEditors, keywords, currentDate, textSkimNotes, richTextSkimNotes, 
linkedText, remoteURL, localURL, localUrlPath, URLFields, skimNotesForLocalURL, 
bdskURL;
 
 + (void)initialize
 {
@@ -294,7 +294,7 @@
             [self markNeWithDate:date description:[date standardDescription]];
         }
         
-        citeKeyEdited = NO;
+        hasEditedCiteKey = NO;
         
         filesToBeFiled = nil;
         localUrlNeedsToBeFiled = NO;
@@ -383,7 +383,7 @@
             macroResolver = nil;
             fileOrder = nil;
             hasBeenEdited = YES;
-            citeKeyEdited = NO;
+            hasEditedCiteKey = NO;
             // we don't bother encoding this
             spotlightMetadataChanged = YES;
             identifierURL = createUniqueURL();
@@ -1065,7 +1065,7 @@
     // no need to further call updateMetadataForKey:
     hasBeenEdited = YES;
     spotlightMetadataChanged = YES;
-    citeKeyEdited = NO == [self hasEmptyOrDefaultCiteKey];
+    hasEditedCiteKey = NO == [self hasEmptyOrDefaultCiteKey];
     
     NSDictionary *notifInfo = [NSDictionary 
dictionaryWithObjectsAndKeys:BDSKCiteKeyString, BDSKBibItemKeyKey, newCiteKey, 
BDSKBibItemNewValueKey, oldCiteKey, BDSKBibItemOldValueKey, nil];
 
@@ -1093,7 +1093,7 @@
     NSArray *requiredFields = [[BDSKTypeManager sharedManager] 
requiredFieldsForCiteKey];
     
     // see if it needs to be set (hasEmptyOrDefaultCiteKey)
-       if (nil == requiredFields || citeKeyEdited)
+       if (nil == requiredFields || hasEditedCiteKey)
                return NO;
        
     // see if we have enough fields to generate it

Modified: trunk/bibdesk/de.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/en.lproj/Localizable.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/fr.lproj/Localizable.strings
===================================================================
(Binary files differ)

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