diff options
author | stuconnolly <stuart02@gmail.com> | 2010-11-11 21:55:18 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-11-11 21:55:18 +0000 |
commit | 18167b0fa0d58aaf12490c34a663fa661be8ec3e (patch) | |
tree | 57028df964c524dbd442d273091f5996770b10d1 | |
parent | e7afbbbfa7e36146acae973d14a51faf9fbcf5ec (diff) | |
download | sequelpro-18167b0fa0d58aaf12490c34a663fa661be8ec3e.tar.gz sequelpro-18167b0fa0d58aaf12490c34a663fa661be8ec3e.tar.bz2 sequelpro-18167b0fa0d58aaf12490c34a663fa661be8ec3e.zip |
Make sure the root favorite has a name key and value. Also, update string files.
-rw-r--r-- | Resources/English.lproj/Localizable.strings | bin | 184256 -> 185348 bytes | |||
-rw-r--r-- | Source/SPAppController.m | 3 | ||||
-rw-r--r-- | Source/SPConstants.h | 1 | ||||
-rw-r--r-- | Source/SPConstants.m | 1 | ||||
-rw-r--r-- | Source/SPFavoritesController.m | 2 | ||||
-rw-r--r-- | Source/SPFavoritesPreferencePane.m | 2 | ||||
-rw-r--r-- | Source/SPPreferencesUpgrade.m | 10 |
7 files changed, 13 insertions, 6 deletions
diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings Binary files differindex 88e44abd..fe8b7d27 100644 --- a/Resources/English.lproj/Localizable.strings +++ b/Resources/English.lproj/Localizable.strings diff --git a/Source/SPAppController.m b/Source/SPAppController.m index a1f8b292..b1c1f026 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -32,6 +32,7 @@ #import "SPEncodingPopupAccessory.h" #import "SPWindowController.h" #import "SPPreferencesUpgrade.h" +#import "SPFavoritesController.h" #import <PSMTabBar/PSMTabBarControl.h> #import <Sparkle/Sparkle.h> @@ -64,6 +65,8 @@ // Migrate old connection favorites to the app's support directory (only uncomment when ready) //SPMigrateConnectionFavoritesData(); + + [SPFavoritesController sharedFavoritesController]; } /** diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 0b51fb17..c90cfe2d 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -400,6 +400,7 @@ extern NSString *SPPreferenceToolbarShortcuts; // Connection favorite keys extern NSString *SPFavoritesRootKey; extern NSString *SPFavoriteChildrenKey; +extern NSString *SPFavoritesGroupNameKey; extern NSString *SPFavoriteIDKey; extern NSString *SPFavoriteNameKey; extern NSString *SPFavoriteDatabaseKey; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index 637e046e..874200d2 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -220,6 +220,7 @@ NSString *SPPreferenceToolbarShortcuts = @"SPPreferenceToolbarShortcut // Connection favorite keys NSString *SPFavoritesRootKey = @"Favorites Root"; NSString *SPFavoriteChildrenKey = @"Children"; +NSString *SPFavoritesGroupNameKey = @"Name"; NSString *SPFavoriteIDKey = @"id"; NSString *SPFavoriteNameKey = @"name"; NSString *SPFavoriteDatabaseKey = @"database"; diff --git a/Source/SPFavoritesController.m b/Source/SPFavoritesController.m index 08df59c8..d66f9b72 100644 --- a/Source/SPFavoritesController.m +++ b/Source/SPFavoritesController.m @@ -182,7 +182,7 @@ static SPFavoritesController *sharedFavoritesController = nil; favorites = [[NSDictionary alloc] initWithContentsOfFile:favoritesFile]; } else { - NSDictionary *newFavorites = [NSDictionary dictionaryWithObject:[NSDictionary dictionaryWithObject:[NSArray array] forKey:SPFavoriteChildrenKey] forKey:SPFavoritesRootKey]; + NSDictionary *newFavorites = [NSDictionary dictionaryWithObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Favorites", @"favorites label"), SPFavoritesGroupNameKey, [NSArray array], SPFavoriteChildrenKey, nil] forKey:SPFavoritesRootKey]; NSError *error = nil; NSString *errorString = nil; diff --git a/Source/SPFavoritesPreferencePane.m b/Source/SPFavoritesPreferencePane.m index 7833d923..6b328d47 100644 --- a/Source/SPFavoritesPreferencePane.m +++ b/Source/SPFavoritesPreferencePane.m @@ -743,7 +743,7 @@ - (NSString *)preferencePaneName { - return NSLocalizedString(@"Favorites", @"favorites preference pane name"); + return NSLocalizedString(@"Favorites", @"favorites label"); } - (NSString *)preferencePaneIdentifier diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m index 081be36a..7b1c31cf 100644 --- a/Source/SPPreferencesUpgrade.m +++ b/Source/SPPreferencesUpgrade.m @@ -305,6 +305,7 @@ void SPMigrateConnectionFavoritesData(void) { NSError *error = nil; NSFileManager *fileManager = [NSFileManager defaultManager]; + NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; NSString *dataPath = [fileManager applicationSupportDirectoryForSubDirectory:SPDataSupportFolder error:&error]; @@ -316,10 +317,11 @@ void SPMigrateConnectionFavoritesData(void) NSString *favoritesFile = [dataPath stringByAppendingPathComponent:SPFavoritesDataFile]; // Only proceed if the new favorites plist doesn't already exist - if (![fileManager fileExistsAtPath:favoritesFile]) { - NSDictionary *newFavorites = [NSDictionary dictionaryWithObject:[NSDictionary dictionaryWithObject:[[NSUserDefaults standardUserDefaults] objectForKey:SPFavorites] forKey:SPFavoriteChildrenKey] forKey:SPFavoritesRootKey]; + if (![fileManager fileExistsAtPath:favoritesFile]) { + + NSDictionary *newFavorites = [NSDictionary dictionaryWithObject:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Favorites", @"favorites label"), SPFavoritesGroupNameKey, [prefs objectForKey:SPFavorites], SPFavoriteChildrenKey, nil] forKey:SPFavoritesRootKey]; - NSError *error = nil; + error = nil; NSString *errorString = nil; NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:newFavorites @@ -333,7 +335,7 @@ void SPMigrateConnectionFavoritesData(void) } else { // Only uncomment when migration is complete - //[[NSUserDefaults standardUserDefaults] removeObjectForKey:SPFavorites]; + //[prefs removeObjectForKey:SPFavorites]; } } else if (errorString) { |