Skip to content

Commit

Permalink
Fix #2457: Use system font as default for table content, not Lucida G…
Browse files Browse the repository at this point in the history
…rande.
  • Loading branch information
stuconnolly committed Jan 7, 2017
1 parent 29aad59 commit fb15b94
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Resources/Plists/PreferenceDefaults.plist
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
10 changes: 9 additions & 1 deletion Source/SPAppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions Source/SPConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions Source/SPConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
NSString *SPHTMLPrintTemplate = @"SPPrintTemplate";
NSString *SPHTMLTableInfoPrintTemplate = @"SPTableInfoPrintTemplate";
NSString *SPHTMLHelpTemplate = @"SPMySQLHelpTemplate";
NSString *SPPreferenceDefaultsFile = @"PreferenceDefaults";

// Folder names
NSString *SPThemesSupportFolder = @"Themes";
Expand Down
6 changes: 2 additions & 4 deletions Source/SPTablesPreferencePane.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down

0 comments on commit fb15b94

Please sign in to comment.