Revision: 3702
http://skim-app.svn.sourceforge.net/skim-app/?rev=3702&view=rev
Author: hofman
Date: 2008-04-10 14:04:04 -0700 (Thu, 10 Apr 2008)
Log Message:
-----------
More string constants.
Modified Paths:
--------------
trunk/PDFAnnotation_SKExtensions.h
trunk/PDFAnnotation_SKExtensions.m
trunk/SKDocument.m
trunk/SKDownloadController.m
trunk/SKInfoWindowController.m
trunk/SKNoteWindowController.m
trunk/SKNotesDocument.m
trunk/SKPSProgressController.m
trunk/SKPreferenceController.m
Modified: trunk/PDFAnnotation_SKExtensions.h
===================================================================
--- trunk/PDFAnnotation_SKExtensions.h 2008-04-10 18:27:28 UTC (rev 3701)
+++ trunk/PDFAnnotation_SKExtensions.h 2008-04-10 21:04:04 UTC (rev 3702)
@@ -66,6 +66,7 @@
extern NSString *SKPDFAnnotationTypeKey;
extern NSString *SKPDFAnnotationBoundsKey;
+extern NSString *SKPDFAnnotationPageKey;
extern NSString *SKPDFAnnotationPageIndexKey;
extern NSString *SKPDFAnnotationContentsKey;
extern NSString *SKPDFAnnotationStringKey;
Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m 2008-04-10 18:27:28 UTC (rev 3701)
+++ trunk/PDFAnnotation_SKExtensions.m 2008-04-10 21:04:04 UTC (rev 3702)
@@ -80,6 +80,7 @@
NSString *SKPDFAnnotationTypeKey = @"type";
NSString *SKPDFAnnotationBoundsKey = @"bounds";
+NSString *SKPDFAnnotationPageKey = @"page";
NSString *SKPDFAnnotationPageIndexKey = @"pageIndex";
NSString *SKPDFAnnotationContentsKey = @"contents";
NSString *SKPDFAnnotationStringKey = @"string";
Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m 2008-04-10 18:27:28 UTC (rev 3701)
+++ trunk/SKDocument.m 2008-04-10 21:04:04 UTC (rev 3702)
@@ -69,6 +69,7 @@
#import "SKBookmarkController.h"
#import "PDFPage_SKExtensions.h"
#import "NSGeometry_SKExtensions.h"
+#import "SKSnapshotWindowController.h"
#define BUNDLE_DATA_FILENAME @"data"
@@ -192,7 +193,7 @@
unsigned int pageIndex = [[[self pdfView] currentPage] pageIndex];
NSString *path = [[self fileURL] path];
if (pageIndex != NSNotFound && path)
- [[SKBookmarkController sharedBookmarkController]
addRecentDocumentForPath:path pageIndex:pageIndex snapshots:[[[self
mainWindowController] snapshots] valueForKey:@"currentSetup"]];
+ [[SKBookmarkController sharedBookmarkController]
addRecentDocumentForPath:path pageIndex:pageIndex snapshots:[[[self
mainWindowController] snapshots] valueForKey:SKSnapshotCurrentSetupKey]];
}
- (void)undoableActionDoesntDirtyDocumentDeferred:(NSNumber *)anUndoState {
@@ -254,7 +255,7 @@
[self stopCheckingFileUpdates];
isSaving = YES;
} else if (exportUsingPanel) {
- [[NSUserDefaults standardUserDefaults] setObject:typeName
forKey:@"SKLastExportedType"];
+ [[NSUserDefaults standardUserDefaults] setObject:typeName
forKey:SKLastExportedTypeKey];
}
BOOL success = NO;
Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m 2008-04-10 18:27:28 UTC (rev 3701)
+++ trunk/SKDownloadController.m 2008-04-10 21:04:04 UTC (rev 3702)
@@ -47,6 +47,13 @@
static NSString *SKDownloadsWindowFrameAutosaveName = @"SKDownloadsWindow";
+static NSString *SKDownloadsWindowProgressColumnIdentifier = @"progress";
+static NSString *SKDownloadsWindowIconColumnIdentifier = @"icon";
+static NSString *SKDownloadsWindowCancelColumnIdentifier = @"cancel";
+static NSString *SKDownloadsWindowResumeColumnIdentifier = @"resume";
+
+static NSString *SKDownloadFileNameKey = @"fileName";
+
@implementation SKDownloadController
+ (id)sharedDownloadController {
@@ -278,9 +285,9 @@
NSString *identifier = [tableColumn identifier];
SKDownload *download = [downloads objectAtIndex:row];
- if ([identifier isEqualToString:@"progress"]) {
+ if ([identifier
isEqualToString:SKDownloadsWindowProgressColumnIdentifier]) {
return [download fileName];
- } else if ([identifier isEqualToString:@"icon"]) {
+ } else if ([identifier
isEqualToString:SKDownloadsWindowIconColumnIdentifier]) {
return [download fileIcon];
}
return nil;
@@ -317,12 +324,12 @@
NSString *identifier = [tableColumn identifier];
SKDownload *download = [downloads objectAtIndex:row];
- if ([identifier isEqualToString:@"progress"]) {
+ if ([identifier
isEqualToString:SKDownloadsWindowProgressColumnIdentifier]) {
if ([cell respondsToSelector:@selector(setProgressIndicator:)])
[(SKProgressCell *)cell setProgressIndicator:[download
progressIndicator]];
if ([cell respondsToSelector:@selector(setStatus:)])
[(SKProgressCell *)cell setStatus:[download status]];
- } else if ([identifier isEqualToString:@"cancel"]) {
+ } else if ([identifier
isEqualToString:SKDownloadsWindowCancelColumnIdentifier]) {
if ([download canCancel]) {
[cell setImage:[NSImage imageNamed:@"Cancel"]];
[cell setAction:@selector(cancelDownload:)];
@@ -332,7 +339,7 @@
[cell setAction:@selector(removeDownload:)];
[cell setTarget:self];
}
- } else if ([identifier isEqualToString:@"resume"]) {
+ } else if ([identifier
isEqualToString:SKDownloadsWindowResumeColumnIdentifier]) {
if ([download canResume]) {
[cell setImage:[NSImage imageNamed:@"Resume"]];
[cell setAction:@selector(resumeDownload:)];
@@ -347,12 +354,12 @@
- (NSString *)tableView:(NSTableView *)aTableView toolTipForCell:(NSCell
*)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)tableColumn
row:(int)row mouseLocation:(NSPoint)mouseLocation {
NSString *toolTip = nil;
- if ([[tableColumn identifier] isEqualToString:@"cancel"]) {
+ if ([[tableColumn identifier]
isEqualToString:SKDownloadsWindowCancelColumnIdentifier]) {
if ([[downloads objectAtIndex:row] canCancel])
toolTip = NSLocalizedString(@"Cancel download", @"Tool tip
message");
else
toolTip = NSLocalizedString(@"Remove download", @"Tool tip
message");
- } else if ([[tableColumn identifier] isEqualToString:@"resume"]) {
+ } else if ([[tableColumn identifier]
isEqualToString:SKDownloadsWindowResumeColumnIdentifier]) {
if ([[downloads objectAtIndex:row] canResume])
toolTip = NSLocalizedString(@"Resume download", @"Tool tip
message");
}
@@ -418,7 +425,7 @@
#pragma mark SKTypeSelectHelper datasource protocol
- (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper
*)typeSelectHelper {
- return [downloads valueForKey:@"fileName"];
+ return [downloads valueForKey:SKDownloadFileNameKey];
}
- (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper
*)typeSelectHelper {
Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m 2008-04-10 18:27:28 UTC (rev 3701)
+++ trunk/SKInfoWindowController.m 2008-04-10 21:04:04 UTC (rev 3702)
@@ -43,6 +43,20 @@
static NSString *SKInfoWindowFrameAutosaveName = @"SKInfoWindow";
+static NSString *SKInfoVersionKey = @"Version";
+static NSString *SKInfoPageCountKey = @"PageCount";
+static NSString *SKInfoPageSizeKey = @"PageSize";
+static NSString *SKInfoPageWidthKey = @"PageWidth";
+static NSString *SKInfoPageHeightKey = @"PageHeight";
+static NSString *SKInfoKeywordsStringKey = @"KeywordsString";
+static NSString *SKInfoEncryptedKey = @"Encrypted";
+static NSString *SKInfoAllowsPrintingKey = @"AllowsPrinting";
+static NSString *SKInfoAllowsCopyingKey = @"AllowsCopying";
+static NSString *SKInfoFileNameKey = @"FileName";
+static NSString *SKInfoFileSizeKey = @"FileSize";
+static NSString *SKInfoPhysicalSizeKey = @"PhysicalSize";
+static NSString *SKInfoLogicalSizeKey = @"LogicalSize";
+
@implementation SKInfoWindowController
+ (void)initialize {
@@ -190,24 +204,24 @@
if ([doc respondsToSelector:@selector(pdfDocument)] && (pdfDoc =
[(SKDocument *)doc pdfDocument])) {
[dictionary addEntriesFromDictionary:[pdfDoc documentAttributes]];
- [dictionary setValue:[NSString stringWithFormat: @"%d.%d", [pdfDoc
majorVersion], [pdfDoc minorVersion]] forKey:@"Version"];
- [dictionary setValue:[NSNumber numberWithInt:[pdfDoc pageCount]]
forKey:@"PageCount"];
+ [dictionary setValue:[NSString stringWithFormat: @"%d.%d", [pdfDoc
majorVersion], [pdfDoc minorVersion]] forKey:SKInfoVersionKey];
+ [dictionary setValue:[NSNumber numberWithInt:[pdfDoc pageCount]]
forKey:SKInfoPageCountKey];
if ([pdfDoc pageCount]) {
NSSize cropSize = [[pdfDoc pageAtIndex:0]
boundsForBox:kPDFDisplayBoxCropBox].size;
NSSize mediaSize = [[pdfDoc pageAtIndex:0]
boundsForBox:kPDFDisplayBoxMediaBox].size;
- [dictionary setValue:SKSizeString(cropSize, mediaSize)
forKey:@"PageSize"];
- [dictionary setValue:[NSNumber numberWithFloat:cropSize.width]
forKey:@"PageWidth"];
- [dictionary setValue:[NSNumber numberWithFloat:cropSize.height]
forKey:@"PageHeight"];
+ [dictionary setValue:SKSizeString(cropSize, mediaSize)
forKey:SKInfoPageSizeKey];
+ [dictionary setValue:[NSNumber numberWithFloat:cropSize.width]
forKey:SKInfoPageWidthKey];
+ [dictionary setValue:[NSNumber numberWithFloat:cropSize.height]
forKey:SKInfoPageHeightKey];
}
- [dictionary setValue:[[dictionary valueForKey:@"Keywords"]
componentsJoinedByString:@"\n"] forKey:@"KeywordsString"];
- [dictionary setValue:[NSNumber numberWithBool:[pdfDoc isEncrypted]]
forKey:@"Encrypted"];
- [dictionary setValue:[NSNumber numberWithBool:[pdfDoc allowsPrinting]]
forKey:@"AllowsPrinting"];
- [dictionary setValue:[NSNumber numberWithBool:[pdfDoc allowsCopying]]
forKey:@"AllowsCopying"];
+ [dictionary setValue:[[dictionary valueForKey:@"Keywords"]
componentsJoinedByString:@"\n"] forKey:SKInfoKeywordsStringKey];
+ [dictionary setValue:[NSNumber numberWithBool:[pdfDoc isEncrypted]]
forKey:SKInfoEncryptedKey];
+ [dictionary setValue:[NSNumber numberWithBool:[pdfDoc allowsPrinting]]
forKey:SKInfoAllowsPrintingKey];
+ [dictionary setValue:[NSNumber numberWithBool:[pdfDoc allowsCopying]]
forKey:SKInfoAllowsCopyingKey];
}
- [dictionary setValue:[[doc fileName] lastPathComponent]
forKey:@"FileName"];
- [dictionary setValue:SKFileSizeStringForFileURL([doc fileURL],
&physicalSize, &logicalSize) forKey:@"FileSize"];
- [dictionary setValue:[NSNumber numberWithUnsignedLongLong:physicalSize]
forKey:@"PhysicalSize"];
- [dictionary setValue:[NSNumber numberWithUnsignedLongLong:logicalSize]
forKey:@"LogicalSize"];
+ [dictionary setValue:[[doc fileName] lastPathComponent]
forKey:SKInfoFileNameKey];
+ [dictionary setValue:SKFileSizeStringForFileURL([doc fileURL],
&physicalSize, &logicalSize) forKey:SKInfoFileSizeKey];
+ [dictionary setValue:[NSNumber numberWithUnsignedLongLong:physicalSize]
forKey:SKInfoPhysicalSizeKey];
+ [dictionary setValue:[NSNumber numberWithUnsignedLongLong:logicalSize]
forKey:SKInfoLogicalSizeKey];
return dictionary;
}
Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m 2008-04-10 18:27:28 UTC (rev 3701)
+++ trunk/SKNoteWindowController.m 2008-04-10 21:04:04 UTC (rev 3702)
@@ -64,15 +64,15 @@
keepOnTop = [[NSUserDefaults standardUserDefaults]
boolForKey:SKKeepNoteWindowsOnTopKey];
forceOnTop = NO;
- [note addObserver:self forKeyPath:@"page" options:0 context:NULL];
- [note addObserver:self forKeyPath:@"bounds" options:0 context:NULL];
+ [note addObserver:self forKeyPath:SKPDFAnnotationPageKey options:0
context:NULL];
+ [note addObserver:self forKeyPath:SKPDFAnnotationBoundsKey options:0
context:NULL];
}
return self;
}
- (void)dealloc {
- [note removeObserver:self forKeyPath:@"page"];
- [note removeObserver:self forKeyPath:@"bounds"];
+ [note removeObserver:self forKeyPath:SKPDFAnnotationPageKey];
+ [note removeObserver:self forKeyPath:SKPDFAnnotationBoundsKey];
[[NSNotificationCenter defaultCenter] removeObserver:self];
CFRelease(editors);
[note release];
@@ -130,12 +130,12 @@
- (void)setNote:(PDFAnnotation *)newNote {
if (note != newNote) {
- [note removeObserver:self forKeyPath:@"page"];
- [note removeObserver:self forKeyPath:@"bounds"];
+ [note removeObserver:self forKeyPath:SKPDFAnnotationPageKey];
+ [note removeObserver:self forKeyPath:SKPDFAnnotationBoundsKey];
[note release];
note = [newNote retain];
- [note addObserver:self forKeyPath:@"page" options:0 context:NULL];
- [note addObserver:self forKeyPath:@"bounds" options:0 context:NULL];
+ [note addObserver:self forKeyPath:SKPDFAnnotationPageKey options:0
context:NULL];
+ [note addObserver:self forKeyPath:SKPDFAnnotationBoundsKey options:0
context:NULL];
}
}
@@ -254,7 +254,7 @@
[textView setFont:font];
}
} else if (object == note) {
- if ([keyPath isEqualToString:@"page"] || [keyPath
isEqualToString:@"bounds"])
+ if ([keyPath isEqualToString:SKPDFAnnotationPageKey] || [keyPath
isEqualToString:SKPDFAnnotationBoundsKey])
[self updateStatusMessage];
} else {
[super observeValueForKeyPath:keyPath ofObject:object change:change
context:context];
Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m 2008-04-10 18:27:28 UTC (rev 3701)
+++ trunk/SKNotesDocument.m 2008-04-10 21:04:04 UTC (rev 3702)
@@ -58,6 +58,12 @@
static NSString *SKNotesDocumentRowHeightKey = @"rowHeight";
static NSString *SKNotesDocumentChildKey = @"child";
+static NSString *SKNotesDocumentNotesKey = @"notes";
+
+static NSString *SKNotesDocumentNoteColumnIdentifier = @"note";
+static NSString *SKNotesDocumentTypeColumnIdentifier = @"type";
+static NSString *SKNotesDocumentPageColumnIdentifier = @"page";
+
@implementation SKNotesDocument
- (id)init {
@@ -155,7 +161,7 @@
[newNotes addObject:note];
[note release];
}
- [[self mutableArrayValueForKey:@"notes"] setArray:newNotes];
+ [[self mutableArrayValueForKey:SKNotesDocumentNotesKey]
setArray:newNotes];
[outlineView reloadData];
didRead = YES;
}
@@ -240,7 +246,7 @@
- (void)autoSizeNoteRows:(id)sender {
float rowHeight = [outlineView rowHeight];
- NSTableColumn *tableColumn = [outlineView
tableColumnWithIdentifier:@"note"];
+ NSTableColumn *tableColumn = [outlineView
tableColumnWithIdentifier:SKNotesDocumentNoteColumnIdentifier];
id cell = [tableColumn dataCell];
float indentation = [outlineView indentationPerLevel];
float width = NSWidth([cell drawingRectForBounds:NSMakeRect(0.0, 0.0,
[tableColumn width] - indentation, rowHeight)]);
@@ -324,11 +330,11 @@
- (id)outlineView:(NSOutlineView *)ov objectValueForTableColumn:(NSTableColumn
*)tableColumn byItem:(id)item {
NSString *tcID = [tableColumn identifier];
- if ([tcID isEqualToString:@"note"]) {
+ if ([tcID isEqualToString:SKNotesDocumentNoteColumnIdentifier]) {
return [item valueForKey:SKPDFAnnotationTypeKey] ? [item
valueForKey:SKPDFAnnotationStringKey] : [item
valueForKey:SKPDFAnnotationTextKey];
- } else if([tcID isEqualToString:@"type"]) {
+ } else if([tcID isEqualToString:SKNotesDocumentTypeColumnIdentifier]) {
return [NSDictionary dictionaryWithObjectsAndKeys:[item
valueForKey:SKPDFAnnotationTypeKey], SKPDFAnnotationTypeKey, nil];
- } else if ([tcID isEqualToString:@"page"]) {
+ } else if ([tcID isEqualToString:SKNotesDocumentPageColumnIdentifier]) {
NSNumber *pageNumber = [item valueForKey:SKPDFAnnotationPageIndexKey];
return pageNumber ? [NSString stringWithFormat:@"%i", [pageNumber
intValue] + 1] : nil;
}
@@ -347,11 +353,11 @@
NSSortDescriptor *pageIndexSortDescriptor = [[[NSSortDescriptor alloc]
initWithKey:SKPDFAnnotationPageIndexKey ascending:ascending] autorelease];
NSSortDescriptor *boundsSortDescriptor = [[[NSSortDescriptor alloc]
initWithKey:SKPDFAnnotationBoundsKey ascending:ascending
selector:@selector(boundsCompare:)] autorelease];
NSMutableArray *sds = [NSMutableArray
arrayWithObjects:pageIndexSortDescriptor, boundsSortDescriptor, nil];
- if ([tcID isEqualToString:@"type"]) {
+ if ([tcID isEqualToString:SKNotesDocumentTypeColumnIdentifier]) {
[sds insertObject:[[[NSSortDescriptor alloc]
initWithKey:SKPDFAnnotationTypeKey ascending:YES
selector:@selector(noteTypeCompare:)] autorelease] atIndex:0];
- } else if ([tcID isEqualToString:@"note"]) {
+ } else if ([tcID isEqualToString:SKNotesDocumentNoteColumnIdentifier])
{
[sds insertObject:[[[NSSortDescriptor alloc]
initWithKey:SKPDFAnnotationStringKey ascending:YES
selector:@selector(localizedCaseInsensitiveNumericCompare:)] autorelease]
atIndex:0];
- } else if ([tcID isEqualToString:@"page"]) {
+ } else if ([tcID isEqualToString:SKNotesDocumentPageColumnIdentifier])
{
if (oldTableColumn == nil)
ascending = NO;
}
Modified: trunk/SKPSProgressController.m
===================================================================
--- trunk/SKPSProgressController.m 2008-04-10 18:27:28 UTC (rev 3701)
+++ trunk/SKPSProgressController.m 2008-04-10 21:04:04 UTC (rev 3702)
@@ -41,6 +41,12 @@
#import "NSTask_SKExtensions.h"
#import "Files_SKExtensions.h"
+static NSString *SKPSProgressProviderKey = @"provider";
+static NSString *SKPSProgressConsumerKey = @"consumer";
+static NSString *SKPSProgressDviFileKey = @"dviFile";
+static NSString *SKPSProgressPdfDataKey = @"pdfData";
+static NSString *SKPSProgressDviToolPathKey = @"dviToolPath";
+
static NSString *SKDviConversionCommandKey = @"SKDviConversionCommand";
enum {
@@ -222,7 +228,7 @@
CFMutableDataRef pdfData =
CFDataCreateMutable(CFGetAllocator((CFDataRef)psData), 0);
CGDataConsumerRef consumer = CGDataConsumerCreateWithCFData(pdfData);
- NSDictionary *dictionary = [NSDictionary
dictionaryWithObjectsAndKeys:(id)provider, @"provider", (id)consumer,
@"consumer", nil];
+ NSDictionary *dictionary = [NSDictionary
dictionaryWithObjectsAndKeys:(id)provider, SKPSProgressProviderKey,
(id)consumer, SKPSProgressConsumerKey, nil];
int rv = [self runModalConversionWithInfo:dictionary];
@@ -246,8 +252,8 @@
{
NSAutoreleasePool *pool = [NSAutoreleasePool new];
- CGDataProviderRef provider = (void *)[info objectForKey:@"provider"];
- CGDataConsumerRef consumer = (void *)[info objectForKey:@"consumer"];
+ CGDataProviderRef provider = (void *)[info
objectForKey:SKPSProgressProviderKey];
+ CGDataConsumerRef consumer = (void *)[info
objectForKey:SKPSProgressConsumerKey];
Boolean success = CGPSConverterConvert(converter, provider, consumer,
NULL);
[self stopModalOnMainThread:success];
@@ -323,7 +329,7 @@
if (dviToolPath) {
pdfData = [[NSMutableData alloc] init];
- NSDictionary *dictionary = [NSDictionary
dictionaryWithObjectsAndKeys:dviFile, @"dviFile", pdfData, @"pdfData",
dviToolPath, @"dviToolPath", nil];
+ NSDictionary *dictionary = [NSDictionary
dictionaryWithObjectsAndKeys:dviFile, SKPSProgressDviFileKey, pdfData,
SKPSProgressPdfDataKey, dviToolPath, SKPSProgressDviToolPathKey, nil];
int rv = [self runModalConversionWithInfo:dictionary];
@@ -346,8 +352,8 @@
- (void)doConversionWithInfo:(NSDictionary *)info {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- NSString *dviFile = [info objectForKey:@"dviFile"];
- NSString *commandPath = [info objectForKey:@"dviToolPath"];
+ NSString *dviFile = [info objectForKey:SKPSProgressDviFileKey];
+ NSString *commandPath = [info objectForKey:SKPSProgressDviToolPathKey];
NSString *commandName = [commandPath lastPathComponent];
NSString *tmpDir = SKUniqueDirectoryCreating(NSTemporaryDirectory(), YES);
BOOL outputPS = [commandName isEqualToString:@"dvips"];
@@ -379,7 +385,7 @@
task = nil;
NSData *outData = success ? [NSData dataWithContentsOfFile:outFile] : nil;
- NSMutableData *pdfData = [info objectForKey:@"pdfData"];
+ NSMutableData *pdfData = [info objectForKey:SKPSProgressPdfDataKey];
if (outputPS && success) {
NSAssert(NULL == converter, @"attempted to reenter
SKPSProgressController, but this is not supported");
@@ -391,7 +397,7 @@
CGDataProviderRef provider =
CGDataProviderCreateWithCFData((CFDataRef)outData);
CGDataConsumerRef consumer =
CGDataConsumerCreateWithCFData((CFMutableDataRef)pdfData);
- NSDictionary *dictionary = [NSDictionary
dictionaryWithObjectsAndKeys:(id)provider, @"provider", (id)consumer,
@"consumer", nil];
+ NSDictionary *dictionary = [NSDictionary
dictionaryWithObjectsAndKeys:(id)provider, SKPSProgressProviderKey,
(id)consumer, SKPSProgressConsumerKey, nil];
OSAtomicCompareAndSwap32Barrier(0, 1, (int32_t *)&convertingPS);
Modified: trunk/SKPreferenceController.m
===================================================================
--- trunk/SKPreferenceController.m 2008-04-10 18:27:28 UTC (rev 3701)
+++ trunk/SKPreferenceController.m 2008-04-10 21:04:04 UTC (rev 3702)
@@ -44,14 +44,17 @@
#import "NSView_SKExtensions.h"
#import <Sparkle/Sparkle.h>
-#define INITIAL_USER_DEFAULTS_FILENAME @"InitialUserDefaults"
-#define RESETTABLE_KEYS_KEY @"ResettableKeys"
+static NSString *SKPreferenceInitialUserDefaultsFileName =
@"InitialUserDefaults";
+static NSString *SKPreferenceResettableKeysKey = @"ResettableKeys";
static float SKDefaultFontSizes[] = {8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0,
16.0, 18.0, 20.0, 24.0, 28.0, 32.0, 48.0, 64.0};
static NSString *SKTeXEditors[] = {@"TextMate", @"BBEdit", @"TextWrangler",
@"Emacs", @"Aquamacs Emacs", @"LyX"};
static NSString *SKTeXEditorCommands[] = {@"mate", @"bbedit", @"edit",
@"emacsclient", @"emacsclient", @"lyxeditor"};
static NSString *SKTeXEditorArguments[] = {@"-l %line \"%file\"", @"+%line
\"%file\"", @"+%line \"%file\"", @"--no-wait +%line \"%file\"", @"--no-wait
+%line \"%file\"", @"\"%file\" %line"};
+static NSString *SKPreferenceFontNameKey = @"fontName";
+static NSString *SKPreferenceDisplayNameKey = @"displayName";
+
static NSString *SKPreferenceWindowFrameAutosaveName = @"SKPreferenceWindow";
@implementation SKPreferenceController
@@ -65,8 +68,8 @@
- (id)init {
if (self = [super init]) {
- NSString *initialUserDefaultsPath = [[NSBundle mainBundle]
pathForResource:INITIAL_USER_DEFAULTS_FILENAME ofType:@"plist"];
- resettableKeys = [[[NSDictionary
dictionaryWithContentsOfFile:initialUserDefaultsPath]
valueForKey:RESETTABLE_KEYS_KEY] retain];
+ NSString *initialUserDefaultsPath = [[NSBundle mainBundle]
pathForResource:SKPreferenceInitialUserDefaultsFileName ofType:@"plist"];
+ resettableKeys = [[[NSDictionary
dictionaryWithContentsOfFile:initialUserDefaultsPath]
valueForKey:SKPreferenceResettableKeysKey] retain];
NSMutableArray *tmpFonts = [NSMutableArray array];
NSMutableArray *fontNames = [[[[NSFontManager sharedFontManager]
availableFontFamilies] mutableCopy] autorelease];
@@ -77,7 +80,7 @@
fontEnum = [fontNames objectEnumerator];
while (fontName = [fontEnum nextObject]) {
NSFont *font = [NSFont fontWithName:fontName size:0.0];
- [tmpFonts addObject:[NSDictionary
dictionaryWithObjectsAndKeys:[font fontName], @"fontName", [font displayName],
@"displayName", nil]];
+ [tmpFonts addObject:[NSDictionary
dictionaryWithObjectsAndKeys:[font fontName], SKPreferenceFontNameKey, [font
displayName], SKPreferenceDisplayNameKey, nil]];
}
fonts = [tmpFonts copy];
@@ -131,26 +134,26 @@
[self updateRevertButtons];
- [textLineWell bind:@"lineWidth" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKFreeTextNoteLineWidthKey) options:nil];
- [textLineWell bind:@"style" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKFreeTextNoteLineStyleKey) options:nil];
- [textLineWell bind:@"dashPattern" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKFreeTextNoteDashPatternKey) options:nil];
+ [textLineWell bind:SKLineWellLineWidthKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKFreeTextNoteLineWidthKey) options:nil];
+ [textLineWell bind:SKLineWellStyleKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKFreeTextNoteLineStyleKey) options:nil];
+ [textLineWell bind:SKLineWellDashPatternKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKFreeTextNoteDashPatternKey) options:nil];
[textLineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
- [circleLineWell bind:@"lineWidth" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKCircleNoteLineWidthKey) options:nil];
- [circleLineWell bind:@"style" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKCircleNoteLineStyleKey) options:nil];
- [circleLineWell bind:@"dashPattern" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKCircleNoteDashPatternKey) options:nil];
+ [circleLineWell bind:SKLineWellLineWidthKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKCircleNoteLineWidthKey) options:nil];
+ [circleLineWell bind:SKLineWellStyleKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKCircleNoteLineStyleKey) options:nil];
+ [circleLineWell bind:SKLineWellDashPatternKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKCircleNoteDashPatternKey) options:nil];
[circleLineWell setDisplayStyle:SKLineWellDisplayStyleOval];
- [boxLineWell bind:@"lineWidth" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKSquareNoteLineWidthKey) options:nil];
- [boxLineWell bind:@"style" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKSquareNoteLineStyleKey) options:nil];
- [boxLineWell bind:@"dashPattern" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKSquareNoteDashPatternKey) options:nil];
+ [boxLineWell bind:SKLineWellLineWidthKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKSquareNoteLineWidthKey) options:nil];
+ [boxLineWell bind:SKLineWellStyleKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKSquareNoteLineStyleKey) options:nil];
+ [boxLineWell bind:SKLineWellDashPatternKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKSquareNoteDashPatternKey) options:nil];
[boxLineWell setDisplayStyle:SKLineWellDisplayStyleRectangle];
- [lineLineWell bind:@"lineWidth" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKLineNoteLineWidthKey) options:nil];
- [lineLineWell bind:@"style" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKLineNoteLineStyleKey) options:nil];
- [lineLineWell bind:@"dashPattern" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKLineNoteDashPatternKey) options:nil];
- [lineLineWell bind:@"startLineStyle" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKLineNoteStartLineStyleKey) options:nil];
- [lineLineWell bind:@"endLineStyle" toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKLineNoteEndLineStyleKey) options:nil];
+ [lineLineWell bind:SKLineWellLineWidthKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKLineNoteLineWidthKey) options:nil];
+ [lineLineWell bind:SKLineWellStyleKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKLineNoteLineStyleKey) options:nil];
+ [lineLineWell bind:SKLineWellDashPatternKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKLineNoteDashPatternKey) options:nil];
+ [lineLineWell bind:SKLineWellStartLineStyleKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKLineNoteStartLineStyleKey) options:nil];
+ [lineLineWell bind:SKLineWellEndLineStyleKey toObject:sudc
withKeyPath:VALUES_KEY_PATH(SKLineNoteEndLineStyleKey) options:nil];
}
- (void)windowDidResignMain:(NSNotification *)notification {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit