Permalink
Browse files

Fix #2457: Use system font as default for table content, not Lucida …

…Grande.
  • Loading branch information...
stuconnolly committed Jan 7, 2017
1 parent 29aad59 commit fb15b94b31f88b0ec3c4037ef3f38bc0cc11bbf0
@@ -127,8 +127,6 @@
<false/>
<key>FilterTableDefaultOperator</key>
<string>LIKE &apos;%@%&apos;</string>
- <key>GlobalResultTableFont</key>
- <data>BAtzdHJlYW10eXBlZIHoA4QBQISEhAZOU0ZvbnQehIQITlNPYmplY3QAhYQBaSSEBVszNmNdBgAAABoAAAD//kwAdQBjAGkAZABhAEcAcgBhAG4AZABlAAAAhAFmC4QBYwCYAZgAmACG</data>
<key>GrowlEnabled</key>
<true/>
<key>KeepAliveInterval</key>
View
@@ -104,8 +104,16 @@ - (id)init
*/
+ (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();
View
@@ -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;
View
@@ -67,6 +67,7 @@
NSString *SPHTMLPrintTemplate = @"SPPrintTemplate";
NSString *SPHTMLTableInfoPrintTemplate = @"SPTableInfoPrintTemplate";
NSString *SPHTMLHelpTemplate = @"SPMySQLHelpTemplate";
+NSString *SPPreferenceDefaultsFile = @"PreferenceDefaults";
// Folder names
NSString *SPThemesSupportFolder = @"Themes";
@@ -54,10 +54,8 @@ - (IBAction)showGlobalResultTableFontPanel:(id)sender
* 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 -

0 comments on commit fb15b94

Please sign in to comment.