Revision: 11132
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=11132&view=rev
Author:   hofman
Date:     2007-09-22 15:34:44 -0700 (Sat, 22 Sep 2007)

Log Message:
-----------
Change preset local-url formats so they all contain a unique specifier. Fix old 
preferences on startup.

Modified Paths:
--------------
    branches/TRY_ARM_FILE_INTERFACE/bibdesk/BDSKAppController.m
    branches/TRY_ARM_FILE_INTERFACE/bibdesk/BibPref_AutoFile.m
    branches/TRY_ARM_FILE_INTERFACE/bibdesk/Bibdesk.xcodeproj/project.pbxproj
    
branches/TRY_ARM_FILE_INTERFACE/bibdesk/English.lproj/BibPref_AutoFile.nib/info.nib
    
branches/TRY_ARM_FILE_INTERFACE/bibdesk/English.lproj/BibPref_AutoFile.nib/keyedobjects.nib
    
branches/TRY_ARM_FILE_INTERFACE/bibdesk/French.lproj/BibPref_AutoFile.nib/info.nib
    
branches/TRY_ARM_FILE_INTERFACE/bibdesk/French.lproj/BibPref_AutoFile.nib/keyedobjects.nib
    branches/TRY_ARM_FILE_INTERFACE/bibdesk/Info.plist

Modified: branches/TRY_ARM_FILE_INTERFACE/bibdesk/BDSKAppController.m
===================================================================
--- branches/TRY_ARM_FILE_INTERFACE/bibdesk/BDSKAppController.m 2007-09-22 
22:11:09 UTC (rev 11131)
+++ branches/TRY_ARM_FILE_INTERFACE/bibdesk/BDSKAppController.m 2007-09-22 
22:34:44 UTC (rev 11132)
@@ -260,9 +260,18 @@
         }
     }
     
+    int formatPreset = [[OFPreferenceWrapper sharedPreferenceWrapper] 
objectForKey:BDSKLocalUrlFormatPresetKey];
+    NSArray *oldPresets = [NSArray arrayWithObjects:@"%L", @"%l%n0%e", 
@"%a1/%Y%u0%e", @"%a1/%T5%e", nil];
+    NSArray *newPresets = [NSArray arrayWithObjects:@"%l%n0%e", 
@"%a1/%Y%u0%e", @"%a1/%T5%n0%e", nil];
     formatString = [[OFPreferenceWrapper sharedPreferenceWrapper] 
objectForKey:BDSKLocalUrlFormatKey];
     error = nil;
     
+    if (formatPreset > 0 && [[oldPresets objectAtIndex:formatPreset - 1] 
isEqualToString:formatString]) {
+        formatPreset = MAX(1, --formatPreset);
+        formatString = [newPresets objectAtIndex:formatPreset - 1];
+        [[OFPreferenceWrapper sharedPreferenceWrapper] setObject:formatPreset 
forKey:BDSKLocalUrlFormatPresetKey];
+    }
+    
     if ([BDSKFormatParser validateFormat:&formatString 
forField:BDSKLocalUrlString inFileType:BDSKBibtexString error:&error]) {
         [[OFPreferenceWrapper sharedPreferenceWrapper] setObject:formatString 
forKey:BDSKLocalUrlFormatKey];
         [self setRequiredFieldsForLocalUrl: [BDSKFormatParser 
requiredFieldsForFormat:formatString]];

Modified: branches/TRY_ARM_FILE_INTERFACE/bibdesk/BibPref_AutoFile.m
===================================================================
--- branches/TRY_ARM_FILE_INTERFACE/bibdesk/BibPref_AutoFile.m  2007-09-22 
22:11:09 UTC (rev 11131)
+++ branches/TRY_ARM_FILE_INTERFACE/bibdesk/BibPref_AutoFile.m  2007-09-22 
22:34:44 UTC (rev 11132)
@@ -52,7 +52,7 @@
 @implementation BibPref_AutoFile
 
 // these should correspond to the items in the popups set in IB
-static NSString *presetFormatStrings[] = {@"%L", @"%l%n0%e", @"%a1/%Y%u0%e", 
@"%a1/%T5%e"};
+static NSString *presetFormatStrings[] = {@"%l%n0%e", @"%a1/%Y%u0%e", 
@"%a1/%T5%n0%e"};
 static NSString *repositorySpecifierStrings[] = {@"", @"%a00", @"%A0", 
@"%p00", @"%P0", @"%t0", @"%T0", @"%Y", @"%y", @"%m", @"%k0", @"%L", @"%l", 
@"%e", @"%b", @"%f{}0", @"%s{}[][][]0", @"%c{}", @"%f{Cite Key}", @"%i{}0", 
@"%u0", @"%U0", @"%n0", @"%0", @"%%"};
 
 - (void)dealloc{

Modified: 
branches/TRY_ARM_FILE_INTERFACE/bibdesk/Bibdesk.xcodeproj/project.pbxproj
===================================================================
--- branches/TRY_ARM_FILE_INTERFACE/bibdesk/Bibdesk.xcodeproj/project.pbxproj   
2007-09-22 22:11:09 UTC (rev 11131)
+++ branches/TRY_ARM_FILE_INTERFACE/bibdesk/Bibdesk.xcodeproj/project.pbxproj   
2007-09-22 22:34:44 UTC (rev 11132)
@@ -2749,7 +2749,6 @@
                29B97313FDCFA39411CA2CEA /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = F993F20208553A61007A7657 /* 
Build configuration list for PBXProject "Bibdesk" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        mainGroup = 29B97314FDCFA39411CA2CEA /* BibDesk */;
                        projectDirPath = "";

Modified: 
branches/TRY_ARM_FILE_INTERFACE/bibdesk/English.lproj/BibPref_AutoFile.nib/info.nib
===================================================================
--- 
branches/TRY_ARM_FILE_INTERFACE/bibdesk/English.lproj/BibPref_AutoFile.nib/info.nib
 2007-09-22 22:11:09 UTC (rev 11131)
+++ 
branches/TRY_ARM_FILE_INTERFACE/bibdesk/English.lproj/BibPref_AutoFile.nib/info.nib
 2007-09-22 22:34:44 UTC (rev 11132)
@@ -7,14 +7,14 @@
        <key>IBEditorPositions</key>
        <dict>
                <key>5</key>
-               <string>429 389 581 486 0 0 1440 938 </string>
+               <string>429 398 581 486 0 0 1440 938 </string>
        </dict>
        <key>IBFramework Version</key>
        <string>446.1</string>
        <key>IBOpenObjects</key>
        <array>
+               <integer>5</integer>
                <integer>137</integer>
-               <integer>5</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8R218</string>

Modified: 
branches/TRY_ARM_FILE_INTERFACE/bibdesk/English.lproj/BibPref_AutoFile.nib/keyedobjects.nib
===================================================================
(Binary files differ)

Modified: 
branches/TRY_ARM_FILE_INTERFACE/bibdesk/French.lproj/BibPref_AutoFile.nib/info.nib
===================================================================
--- 
branches/TRY_ARM_FILE_INTERFACE/bibdesk/French.lproj/BibPref_AutoFile.nib/info.nib
  2007-09-22 22:11:09 UTC (rev 11131)
+++ 
branches/TRY_ARM_FILE_INTERFACE/bibdesk/French.lproj/BibPref_AutoFile.nib/info.nib
  2007-09-22 22:34:44 UTC (rev 11132)
@@ -7,7 +7,7 @@
        <key>IBEditorPositions</key>
        <dict>
                <key>5</key>
-               <string>429 389 581 486 0 0 1440 938 </string>
+               <string>429 398 581 486 0 0 1440 938 </string>
        </dict>
        <key>IBFramework Version</key>
        <string>446.1</string>

Modified: 
branches/TRY_ARM_FILE_INTERFACE/bibdesk/French.lproj/BibPref_AutoFile.nib/keyedobjects.nib
===================================================================
(Binary files differ)

Modified: branches/TRY_ARM_FILE_INTERFACE/bibdesk/Info.plist
===================================================================
--- branches/TRY_ARM_FILE_INTERFACE/bibdesk/Info.plist  2007-09-22 22:11:09 UTC 
(rev 11131)
+++ branches/TRY_ARM_FILE_INTERFACE/bibdesk/Info.plist  2007-09-22 22:34:44 UTC 
(rev 11132)
@@ -419,7 +419,7 @@
                                        <key>File papers into the papers folder 
automatically</key>
                                        <false/>
                                        <key>Local-Url Clean Braces or TeX</key>
-                                       <integer>2</integer>
+                                       <integer>1</integer>
                                        <key>Local-Url Format</key>
                                        <string>%l%n0%e</string>
                                        <key>Local-Url Format Preset</key>


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to