diff options
author | Stuart Connolly <stuart02@gmail.com> | 2017-01-07 11:57:44 +0000 |
---|---|---|
committer | Stuart Connolly <stuart02@gmail.com> | 2017-01-07 11:57:44 +0000 |
commit | fb15b94b31f88b0ec3c4037ef3f38bc0cc11bbf0 (patch) | |
tree | 1fccdfba999dbefc05457ea826cf61431e52c150 | |
parent | 29aad5964d5a290db2eb6ecb82f40ab270e8915d (diff) | |
download | sequelpro-fb15b94b31f88b0ec3c4037ef3f38bc0cc11bbf0.tar.gz sequelpro-fb15b94b31f88b0ec3c4037ef3f38bc0cc11bbf0.tar.bz2 sequelpro-fb15b94b31f88b0ec3c4037ef3f38bc0cc11bbf0.zip |
Fix #2457: Use system font as default for table content, not Lucida Grande.
-rw-r--r-- | Resources/Plists/PreferenceDefaults.plist | 2 | ||||
-rw-r--r-- | Source/SPAppController.m | 10 | ||||
-rw-r--r-- | Source/SPConstants.h | 1 | ||||
-rw-r--r-- | Source/SPConstants.m | 1 | ||||
-rw-r--r-- | Source/SPTablesPreferencePane.m | 6 |
5 files changed, 13 insertions, 7 deletions
diff --git a/Resources/Plists/PreferenceDefaults.plist b/Resources/Plists/PreferenceDefaults.plist index 1d55e65a..952b37c5 100644 --- a/Resources/Plists/PreferenceDefaults.plist +++ b/Resources/Plists/PreferenceDefaults.plist @@ -127,8 +127,6 @@ <false/> <key>FilterTableDefaultOperator</key> <string>LIKE '%@%'</string> - <key>GlobalResultTableFont</key> - <data>BAtzdHJlYW10eXBlZIHoA4QBQISEhAZOU0ZvbnQehIQITlNPYmplY3QAhYQBaSSEBVszNmNdBgAAABoAAAD//kwAdQBjAGkAZABhAEcAcgBhAG4AZABlAAAAhAFmC4QBYwCYAZgAmACG</data> <key>GrowlEnabled</key> <true/> <key>KeepAliveInterval</key> 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 - |