Revision: 27895
http://sourceforge.net/p/bibdesk/svn/27895
Author: hofman
Date: 2022-09-16 11:56:57 +0000 (Fri, 16 Sep 2022)
Log Message:
-----------
use macros for string constants
Modified Paths:
--------------
trunk/bibdesk/BDSKEditor.m
Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m 2022-09-16 06:30:15 UTC (rev 27894)
+++ trunk/bibdesk/BDSKEditor.m 2022-09-16 11:56:57 UTC (rev 27895)
@@ -102,6 +102,9 @@
#define BDSKTouchBarItemIdentifierQuickLook
@"edu.ucsd.mmccrack.bibdesk.touchbar-item.quickLook"
+#define BDSKNeedsToGenerateCiteKeyIdentifier @"BDSKNeedsToGenerateCiteKey"
+#define BDSKNeedsToBeFiledIdentifier @"BDSKNeedsToBeFiled"
+
static char BDSKEditorObservationContext;
// offset of the table from the left window edge
@@ -210,7 +213,7 @@
// Setup the statusbar
[statusBar retain];
[statusBar layoutSubtreeIfNeeded];
- [statusBar setDelegate:self];
+ [statusBar setDelegate:self];NSLog(@"%f",NSMaxX(actionButton.frame));
[statusBar setLeftMargin:NSMaxX([actionButton frame]) + 5.0];
if ([[NSUserDefaults standardUserDefaults]
boolForKey:BDSKShowEditorStatusBarKey] == NO)
[self toggleStatusBar:nil];
@@ -2792,10 +2795,10 @@
NSMutableArray *missingFields = [NSMutableArray arrayWithCapacity:5];
NSString *tooltip = nil;
- if ([identifier isEqualToString:@"NeedsToGenerateCiteKey"]) {
+ if ([identifier isEqualToString:BDSKNeedsToGenerateCiteKeyIdentifier]) {
requiredFields = [[BDSKTypeManager sharedManager]
requiredFieldsForCiteKey];
tooltip = NSLocalizedString(@"The cite key needs to be
generated.", @"Tool tip message");
- } else if ([identifier isEqualToString:@"NeedsToBeFiled"]) {
+ } else if ([identifier isEqualToString:BDSKNeedsToBeFiledIdentifier]) {
requiredFields = [[BDSKTypeManager sharedManager]
requiredFieldsForLocalFile];
tooltip = NSLocalizedString(@"The linked file needs to be
filed.", @"Tool tip message");
} else {
@@ -2827,30 +2830,30 @@
BOOL fileLocalUrl = [[NSUserDefaults standardUserDefaults]
boolForKey:BDSKUseLocalUrlAndUrlKey];
if (fileLocalUrl == NO && [[publication filesToBeFiled] count]) {
[self setStatus:NSLocalizedString(@"Linked file needs to be
filed.",@"Linked file needs to be filed.")];
- if ([[statusBar iconIdentifiers] containsObject:@"NeedsToBeFiled"] ==
NO) {
+ if ([[statusBar iconIdentifiers]
containsObject:BDSKNeedsToBeFiledIdentifier] == NO) {
NSString *tooltip = NSLocalizedString(@"The linked file needs to
be filed.", @"Tool tip message");
- [statusBar addIcon:[NSImage imageNamed:NSImageNameFolder]
withIdentifier:@"NeedsToBeFiled" toolTip:tooltip];
+ [statusBar addIcon:[NSImage imageNamed:NSImageNameFolder]
withIdentifier:BDSKNeedsToBeFiledIdentifier toolTip:tooltip];
}
} else if (fileLocalUrl && [publication localUrlNeedsToBeFiled]) {
[self setStatus:NSLocalizedString(@"Local-Url needs to be
filed.",@"Local-Url needs to be filed.")];
- if ([[statusBar iconIdentifiers] containsObject:@"NeedsToBeFiled"]
== NO) {
+ if ([[statusBar iconIdentifiers]
containsObject:BDSKNeedsToBeFiledIdentifier] == NO) {
NSString *tooltip = NSLocalizedString(@"The Local-Url needs to
be filed.", @"Tool tip message");
- [statusBar addIcon:[NSImage imageNamed:NSImageNameFolder]
withIdentifier:@"NeedsToBeFiled" toolTip:tooltip];
+ [statusBar addIcon:[NSImage imageNamed:NSImageNameFolder]
withIdentifier:BDSKNeedsToBeFiledIdentifier toolTip:tooltip];
}
} else {
[self setStatus:@""];
- [statusBar removeIconWithIdentifier:@"NeedsToBeFiled"];
+ [statusBar
removeIconWithIdentifier:BDSKNeedsToBeFiledIdentifier];
}
}
- (void)updateCiteKeyAutoGenerateStatus{
if ([publication hasEmptyOrDefaultCiteKey] && [[NSUserDefaults
standardUserDefaults] boolForKey:BDSKCiteKeyAutogenerateKey]) {
- if ([[statusBar iconIdentifiers]
containsObject:@"NeedsToGenerateCiteKey"] == NO) {
+ if ([[statusBar iconIdentifiers]
containsObject:BDSKNeedsToGenerateCiteKeyIdentifier] == NO) {
NSString *tooltip = NSLocalizedString(@"The cite key
needs to be generated.", @"Tool tip message");
- [statusBar addIcon:[NSImage imageNamed:@"key"]
withIdentifier:@"NeedsToGenerateCiteKey" toolTip:tooltip];
+ [statusBar addIcon:[NSImage imageNamed:@"key"]
withIdentifier:BDSKNeedsToGenerateCiteKeyIdentifier toolTip:tooltip];
}
} else {
- [statusBar removeIconWithIdentifier:@"NeedsToGenerateCiteKey"];
+ [statusBar
removeIconWithIdentifier:BDSKNeedsToGenerateCiteKeyIdentifier];
}
}
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