Revision: 27185 http://sourceforge.net/p/bibdesk/svn/27185 Author: hofman Date: 2021-12-13 09:19:18 +0000 (Mon, 13 Dec 2021) Log Message: ----------- Rename preference key name
Modified Paths: -------------- trunk/bibdesk/BDSKPreviewer.m trunk/bibdesk/BDSKStringConstants.h trunk/bibdesk/BDSKStringConstants.m trunk/bibdesk/BDSKTeXTask.m trunk/bibdesk/BibDocument_UI.m trunk/bibdesk/BibPref_TeX.m Modified: trunk/bibdesk/BDSKPreviewer.m =================================================================== --- trunk/bibdesk/BDSKPreviewer.m 2021-12-13 07:30:32 UTC (rev 27184) +++ trunk/bibdesk/BDSKPreviewer.m 2021-12-13 09:19:18 UTC (rev 27185) @@ -300,7 +300,7 @@ // now that we correctly check return codes from the NSTask, users blame us for TeX preview failures that have been failing all along, so we'll try to give them a clue to the error if possible (which may save a LART later on) NSSet *standardStyles = [NSSet setWithObjects:@"abbrv", @"acm", @"alpha", @"apalike", @"ieeetr", @"plain", @"siam", @"unsrt", nil]; - NSString *btStyle = [[NSUserDefaults standardUserDefaults] stringForKey:BDSKBTStyleKey]; + NSString *btStyle = [[NSUserDefaults standardUserDefaults] stringForKey:BDSKBibTeXStyleKey]; if([standardStyles containsObject:btStyle] == NO) [errorString appendFormat:NSLocalizedString(@"***** WARNING: You are using a non-standard BibTeX style *****\nThe style \"%@\" may require additional \\usepackage commands to function correctly.\n\n", @"possible cause of TeX failure"), btStyle]; Modified: trunk/bibdesk/BDSKStringConstants.h =================================================================== --- trunk/bibdesk/BDSKStringConstants.h 2021-12-13 07:30:32 UTC (rev 27184) +++ trunk/bibdesk/BDSKStringConstants.h 2021-12-13 09:19:18 UTC (rev 27185) @@ -43,7 +43,7 @@ extern NSString *BDSKTeXBinPathKey; extern NSString *BDSKBibTeXBinPathKey; -extern NSString *BDSKBTStyleKey; +extern NSString *BDSKBibTeXStyleKey; extern NSString *BDSKStringEncodingsKey; extern NSString *BDSKDefaultStringEncodingKey; extern NSString *BDSKShouldTeXifyWhenSavingAndCopyingKey; Modified: trunk/bibdesk/BDSKStringConstants.m =================================================================== --- trunk/bibdesk/BDSKStringConstants.m 2021-12-13 07:30:32 UTC (rev 27184) +++ trunk/bibdesk/BDSKStringConstants.m 2021-12-13 09:19:18 UTC (rev 27185) @@ -77,7 +77,7 @@ NSString *BDSKTeXBinPathKey = @"TeX Binary Path"; NSString *BDSKBibTeXBinPathKey = @"BibTeX Binary Path"; -NSString *BDSKBTStyleKey = @"BibTeX Style"; +NSString *BDSKBibTeXStyleKey = @"BibTeX Style"; NSString *BDSKUsesTeXKey = @"Uses TeX"; NSString *BDSKDragCopyDefaultKey = @"BDSKDragCopyDefaultKey"; Modified: trunk/bibdesk/BDSKTeXTask.m =================================================================== --- trunk/bibdesk/BDSKTeXTask.m 2021-12-13 07:30:32 UTC (rev 27184) +++ trunk/bibdesk/BDSKTeXTask.m 2021-12-13 09:19:18 UTC (rev 27185) @@ -195,7 +195,7 @@ - (NSString *)description{ NSMutableString *temporaryDescription = [[NSMutableString alloc] initWithString:[super description]]; - [temporaryDescription appendFormat:@" {\nivars:\n\tdelegate = \"%@\"\n\tfile name = \"%@\"\n\ttemplate = \"%@\"\n\tTeX file = \"%@\"\n\tBibTeX file = \"%@\"\n\tTeX binary path = %@\n\tBibTeX binary path = %@\n\tEncoding = \"%@\"\n\tBibTeX style = \"%@\"\n\tHelper files = %@\n\nenvironment:\n\tSHELL = \"%@\"\n\tBIBINPUTS = \"%@\"\n\tBSTINPUTS = \"%@\"\n\tTEXINPUTS = \"%@\"\n\tTEXCONFIG = \"%@\"\n\tTEXMFCONFIG = \"%@\"\n\tPATH = \"%@\" }", delegate, [texPath baseNameWithoutExtension], [texTemplateURL path], [texPath texFilePath], [texPath bibFilePath], [[NSUserDefaults standardUserDefaults] objectForKey:BDSKTeXBinPathKey], [[NSUserDefaults standardUserDefaults] objectForKey:BDSKBibTeXBinPathKey], [NSString localizedNameOfStringEncoding:[[NSUserDefaults standardUserDefaults] integerForKey:BDSKTeXPreviewFileEncodingKey]], [[NSUserDefaults standardUserDefaults] objectForKey:BDSKBTStyleKey], [[self helperFileURLs] description], [environment objectForKey:@"SHELL"], [environment objectForKey:@"BIBINPUTS"], [environment objectForKey:@"BSTINPUTS"], [environment objectForKey:@"TEXINPUTS"], [environment objectForKey:@"TEXCONFIG"], [environment objectForKey:@"TEXMFCONFIG"], [environment objectForKey:@"PATH"]]; + [temporaryDescription appendFormat:@" {\nivars:\n\tdelegate = \"%@\"\n\tfile name = \"%@\"\n\ttemplate = \"%@\"\n\tTeX file = \"%@\"\n\tBibTeX file = \"%@\"\n\tTeX binary path = %@\n\tBibTeX binary path = %@\n\tEncoding = \"%@\"\n\tBibTeX style = \"%@\"\n\tHelper files = %@\n\nenvironment:\n\tSHELL = \"%@\"\n\tBIBINPUTS = \"%@\"\n\tBSTINPUTS = \"%@\"\n\tTEXINPUTS = \"%@\"\n\tTEXCONFIG = \"%@\"\n\tTEXMFCONFIG = \"%@\"\n\tPATH = \"%@\" }", delegate, [texPath baseNameWithoutExtension], [texTemplateURL path], [texPath texFilePath], [texPath bibFilePath], [[NSUserDefaults standardUserDefaults] objectForKey:BDSKTeXBinPathKey], [[NSUserDefaults standardUserDefaults] objectForKey:BDSKBibTeXBinPathKey], [NSString localizedNameOfStringEncoding:[[NSUserDefaults standardUserDefaults] integerForKey:BDSKTeXPreviewFileEncodingKey]], [[NSUserDefaults standardUserDefaults] objectForKey:BDSKBibTeXStyleKey], [[self helperFileURLs] description], [environment objectForKey:@"SHELL"], [environment objectForKey:@"BIBINPUTS"], [environment objectForKey:@"BSTINPUTS"], [environment objectForKey:@"TEXINPUTS"], [environment objectForKey:@"TEXCONFIG"], [environment objectForKey:@"TEXMFCONFIG"], [environment objectForKey:@"PATH"]]; NSString *description = [temporaryDescription copy]; [temporaryDescription release]; return [description autorelease]; @@ -385,7 +385,7 @@ - (BOOL)writeTeXFileForCiteKeys:(NSArray *)citeKeys isLTB:(BOOL)ltb{ NSMutableString *texFile = nil; - NSString *style = [[NSUserDefaults standardUserDefaults] stringForKey:BDSKBTStyleKey]; + NSString *style = [[NSUserDefaults standardUserDefaults] stringForKey:BDSKBibTeXStyleKey]; NSStringEncoding encoding = [[NSUserDefaults standardUserDefaults] integerForKey:BDSKTeXPreviewFileEncodingKey]; NSError *error = nil; BOOL didWrite = NO; Modified: trunk/bibdesk/BibDocument_UI.m =================================================================== --- trunk/bibdesk/BibDocument_UI.m 2021-12-13 07:30:32 UTC (rev 27184) +++ trunk/bibdesk/BibDocument_UI.m 2021-12-13 09:19:18 UTC (rev 27185) @@ -1722,7 +1722,7 @@ options:0 context:&BDSKDocumentDefaultsObservationContext]; [sud addObserver:self - forKeyPath:[@"values." stringByAppendingString:BDSKBTStyleKey] + forKeyPath:[@"values." stringByAppendingString:BDSKBibTeXStyleKey] options:0 context:&BDSKDocumentDefaultsObservationContext]; [sud addObserver:self @@ -1773,7 +1773,7 @@ NSUserDefaultsController *sud = [NSUserDefaultsController sharedUserDefaultsController]; [sud removeObserver:self forKeyPath:[@"values." stringByAppendingString:BDSKIgnoredSortTermsKey] context:&BDSKDocumentDefaultsObservationContext]; [sud removeObserver:self forKeyPath:[@"values." stringByAppendingString:BDSKAuthorNameDisplayKey] context:&BDSKDocumentDefaultsObservationContext]; - [sud removeObserver:self forKeyPath:[@"values." stringByAppendingString:BDSKBTStyleKey] context:&BDSKDocumentDefaultsObservationContext]; + [sud removeObserver:self forKeyPath:[@"values." stringByAppendingString:BDSKBibTeXStyleKey] context:&BDSKDocumentDefaultsObservationContext]; [sud removeObserver:self forKeyPath:[@"values." stringByAppendingString:BDSKUsesTeXKey] context:&BDSKDocumentDefaultsObservationContext]; [sud removeObserver:self forKeyPath:[@"values." stringByAppendingString:BDSKHideGroupCountKey] context:&BDSKDocumentDefaultsObservationContext]; [sud removeObserver:self forKeyPath:[@"values." stringByAppendingString:BDSKHideGroupHighlightsKey] context:&BDSKDocumentDefaultsObservationContext]; @@ -1820,7 +1820,7 @@ [[[self viewForGroup:catGroup] nameField] setNeedsDisplay:YES]; } } - } else if ([key isEqualToString:BDSKBTStyleKey]) { + } else if ([key isEqualToString:BDSKBibTeXStyleKey]) { if ([previewer isVisible]) [self updatePreviews]; else if ([[NSUserDefaults standardUserDefaults] boolForKey:BDSKUsesTeXKey] && Modified: trunk/bibdesk/BibPref_TeX.m =================================================================== --- trunk/bibdesk/BibPref_TeX.m 2021-12-13 07:30:32 UTC (rev 27184) +++ trunk/bibdesk/BibPref_TeX.m 2021-12-13 09:19:18 UTC (rev 27185) @@ -79,7 +79,7 @@ } - (void)updateUI { - [bibTeXStyleField setStringValue:[sud stringForKey:BDSKBTStyleKey]]; + [bibTeXStyleField setStringValue:[sud stringForKey:BDSKBibTeXStyleKey]]; [encodingPopUpButton setEncoding:[sud integerForKey:BDSKTeXPreviewFileEncodingKey]]; } @@ -108,10 +108,10 @@ - (IBAction)changeStyle:(id)sender{ NSString *newStyle = [sender stringValue]; - NSString *oldStyle = [sud stringForKey:BDSKBTStyleKey]; + NSString *oldStyle = [sud stringForKey:BDSKBibTeXStyleKey]; if ([newStyle isEqualToString:oldStyle] == NO) { if ([standardStyles containsObject:newStyle]){ - [sud setObject:[sender stringValue] forKey:BDSKBTStyleKey]; + [sud setObject:[sender stringValue] forKey:BDSKBibTeXStyleKey]; } else { NSAlert *alert = [[[NSAlert alloc] init] autorelease]; [alert setMessageText:NSLocalizedString(@"This is a not a standard BibTeX style", @"Message in alert dialog")]; @@ -124,9 +124,9 @@ [alert setDelegate:self]; [alert beginSheetModalForWindow:[[self view] window] completionHandler:^(NSInteger returnCode){ if (NSAlertFirstButtonReturn == returnCode) { - [sud setObject:newStyle forKey:BDSKBTStyleKey]; + [sud setObject:newStyle forKey:BDSKBibTeXStyleKey]; } else if (NSAlertSecondButtonReturn == returnCode) { - [sud setObject:newStyle forKey:BDSKBTStyleKey]; + [sud setObject:newStyle forKey:BDSKBibTeXStyleKey]; [self openTeXPreviewFile:self]; } else { [bibTeXStyleField setStringValue:oldStyle]; 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