aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStuart Connolly <stuart02@gmail.com>2017-01-07 11:57:44 +0000
committerStuart Connolly <stuart02@gmail.com>2017-01-07 11:57:44 +0000
commitfb15b94b31f88b0ec3c4037ef3f38bc0cc11bbf0 (patch)
tree1fccdfba999dbefc05457ea826cf61431e52c150 /Source
parent29aad5964d5a290db2eb6ecb82f40ab270e8915d (diff)
downloadsequelpro-fb15b94b31f88b0ec3c4037ef3f38bc0cc11bbf0.tar.gz
sequelpro-fb15b94b31f88b0ec3c4037ef3f38bc0cc11bbf0.tar.bz2
sequelpro-fb15b94b31f88b0ec3c4037ef3f38bc0cc11bbf0.zip
Fix #2457: Use system font as default for table content, not Lucida Grande.
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 -