aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPAppController.m10
-rw-r--r--Source/SPConstants.h1
-rw-r--r--Source/SPConstants.m1
-rw-r--r--Source/SPTablesPreferencePane.m6
4 files changed, 13 insertions, 5 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m
index 458c62f9..24b981af 100644
--- a/Source/SPAppController.m
+++ b/Source/SPAppController.m
@@ -104,8 +104,16 @@
*/
+ (void)initialize
{
+ NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
+
+ NSMutableDictionary *preferenceDefaults = [NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:SPPreferenceDefaultsFile ofType:@"plist"]];
+
+ if (![prefs objectForKey:SPGlobalResultTableFont]) {
+ [preferenceDefaults setObject:[NSArchiver archivedDataWithRootObject:[NSFont systemFontOfSize:11]] forKey:SPGlobalResultTableFont];
+ }
+
// Register application defaults
- [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"PreferenceDefaults" ofType:@"plist"]]];
+ [prefs registerDefaults:preferenceDefaults];
// Upgrade prefs before any other parts of the app pick up on the values
SPApplyRevisionChanges();
diff --git a/Source/SPConstants.h b/Source/SPConstants.h
index 26fdc1ab..493e7c5c 100644
--- a/Source/SPConstants.h
+++ b/Source/SPConstants.h
@@ -274,6 +274,7 @@ extern NSString *SPFavoritesDataFile;
extern NSString *SPHTMLPrintTemplate;
extern NSString *SPHTMLTableInfoPrintTemplate;
extern NSString *SPHTMLHelpTemplate;
+extern NSString *SPPreferenceDefaultsFile;
// SPF file types
extern NSString *SPFExportSettingsContentType;
diff --git a/Source/SPConstants.m b/Source/SPConstants.m
index 16f59f7a..7ae37df3 100644
--- a/Source/SPConstants.m
+++ b/Source/SPConstants.m
@@ -67,6 +67,7 @@ NSString *SPFavoritesDataFile = @"Favorites.plist";
NSString *SPHTMLPrintTemplate = @"SPPrintTemplate";
NSString *SPHTMLTableInfoPrintTemplate = @"SPTableInfoPrintTemplate";
NSString *SPHTMLHelpTemplate = @"SPMySQLHelpTemplate";
+NSString *SPPreferenceDefaultsFile = @"PreferenceDefaults";
// Folder names
NSString *SPThemesSupportFolder = @"Themes";
diff --git a/Source/SPTablesPreferencePane.m b/Source/SPTablesPreferencePane.m
index f89849ec..ff3296c2 100644
--- a/Source/SPTablesPreferencePane.m
+++ b/Source/SPTablesPreferencePane.m
@@ -54,10 +54,8 @@
* Updates the displayed font according to the user's preferences.
*/
- (void)updateDisplayedTableFontName
-{
- NSFont *font = [NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPGlobalResultTableFont]];
-
- [globalResultTableFontName setFont:font];
+{
+ [globalResultTableFontName setFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPGlobalResultTableFont]]];
}
#pragma mark -