Revision: 3839
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3839&view=rev
Author:   hofman
Date:     2008-05-02 13:55:05 -0700 (Fri, 02 May 2008)

Log Message:
-----------
Add hidden prefs for default note texts.

Modified Paths:
--------------
    trunk/SKPDFView.m

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-05-02 20:39:57 UTC (rev 3838)
+++ trunk/SKPDFView.m   2008-05-02 20:55:05 UTC (rev 3839)
@@ -102,6 +102,9 @@
 static NSString *SKResizeReadingBarModifiersKey = 
@"SKResizeReadingBarModifiers";
 static NSString *SKDisableUpdateContentsFromEnclosedTextKey = 
@"SKDisableUpdateContentsFromEnclosedText";
 
+static NSString *SKDefaultFreeTextNoteContentsKey = 
@"SKDefaultFreeTextNoteContents";
+static NSString *SKDefaultAnchoredNoteContentsKey = 
@"SKDefaultAnchoredNoteContents";
+
 static unsigned int moveReadingBarModifiers = NSAlternateKeyMask;
 static unsigned int resizeReadingBarModifiers = NSAlternateKeyMask | 
NSShiftKeyMask;
 
@@ -201,6 +204,8 @@
         moveReadingBarModifiers = [moveReadingBarModifiersNumber intValue];
     if (resizeReadingBarModifiersNumber)
         resizeReadingBarModifiers = [resizeReadingBarModifiersNumber intValue];
+    
+    [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary 
dictionaryWithObjectsAndKeys:NSLocalizedString(@"Double-click to edit.", 
@"Default text for new text note"), SKDefaultFreeTextNoteContentsKey, 
NSLocalizedString(@"New note", @"Default text for new anchored note"), 
SKDefaultAnchoredNoteContentsKey, nil]];
 }
 
 - (void)commonInitialization {
@@ -1797,12 +1802,12 @@
         case SKFreeTextNote:
             newAnnotation = [[SKPDFAnnotationFreeText alloc] 
initNoteWithBounds:bounds];
             if (text == nil)
-                text = NSLocalizedString(@"Double-click to edit.", @"Default 
text for new text note");
+                text = [[NSUserDefaults standardUserDefaults] 
stringForKey:SKDefaultFreeTextNoteContentsKey];
             break;
         case SKAnchoredNote:
             newAnnotation = [[SKPDFAnnotationNote alloc] 
initNoteWithBounds:bounds];
             if (text == nil)
-                text = NSLocalizedString(@"New note", @"Default text for new 
anchored note");
+                text = [[NSUserDefaults standardUserDefaults] 
stringForKey:SKDefaultAnchoredNoteContentsKey];
             break;
         case SKCircleNote:
             newAnnotation = [[SKPDFAnnotationCircle alloc] 
initNoteWithBounds:bounds];


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

Reply via email to