aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPGeneralPreferencePane.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-01-22 12:19:21 +0000
committerstuconnolly <stuart02@gmail.com>2012-01-22 12:19:21 +0000
commit1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f (patch)
tree6c08ad29618ea02caf302180706d010c90cd57e0 /Source/SPGeneralPreferencePane.m
parente23ba5155a53c43a106ac9646f51321ccc7d86f4 (diff)
downloadsequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.tar.gz
sequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.tar.bz2
sequelpro-1d7ed99d602bf9c7aa4ea40a9a2ab6458864e51f.zip
Bring outlinew view branch up to date with trunk (r3375:3468).
Diffstat (limited to 'Source/SPGeneralPreferencePane.m')
-rw-r--r--Source/SPGeneralPreferencePane.m14
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/SPGeneralPreferencePane.m b/Source/SPGeneralPreferencePane.m
index fc2b4014..4a263be4 100644
--- a/Source/SPGeneralPreferencePane.m
+++ b/Source/SPGeneralPreferencePane.m
@@ -96,12 +96,7 @@ static NSString *SPDatabaseImage = @"database-small";
}
// Select the default favorite from prefs
- if (![prefs boolForKey:SPSelectLastFavoriteUsed]) {
- [defaultFavoritePopup selectItemWithTag:[prefs integerForKey:SPDefaultFavorite]];
- }
- else {
- [defaultFavoritePopup selectItemAtIndex:0];
- }
+ [self updateDefaultFavoritePopupSelection];
}
#pragma mark -
@@ -161,6 +156,13 @@ static NSString *SPDatabaseImage = @"database-small";
return items;
}
+- (void)updateDefaultFavoritePopupSelection
+{
+ NSUInteger index = [prefs integerForKey:SPDefaultFavorite];
+
+ [defaultFavoritePopup selectItemAtIndex:(![prefs boolForKey:SPSelectLastFavoriteUsed] && index > 0 && index < [[defaultFavoritePopup itemArray] count]) ? index + 2 : 0];
+}
+
#pragma mark -
#pragma mark Preference pane protocol methods