diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-08-26 19:41:46 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-08-26 19:41:46 +0000 |
commit | 082332ed69b7cfb2d11d1d45b848cb1fc393b3ca (patch) | |
tree | 08f3bcabd2fba5e4b4d912a3a6ba8fb4b0174287 /Source | |
parent | 07d42ca087e58f23f64f6cf9dfe212286b750e12 (diff) | |
download | sequelpro-082332ed69b7cfb2d11d1d45b848cb1fc393b3ca.tar.gz sequelpro-082332ed69b7cfb2d11d1d45b848cb1fc393b3ca.tar.bz2 sequelpro-082332ed69b7cfb2d11d1d45b848cb1fc393b3ca.zip |
• fixed bug for remembering the Query Editor font after restart and new doc resp.
- delegate textViewDidChangeTypingAttributes: should only save the textView font if it is not (null) which occurs while awaking from nib
- removed a setFont: command since the editor's font is already bound to the pref's setting
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CustomQuery.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index b1ac72d0..d11d6608 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -1031,7 +1031,6 @@ toObject: [NSUserDefaultsController sharedUserDefaultsController] withKeyPath:@"values.CustomQueryEditorBackgroundColor" options:bindingOptions]; - [textView setFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"CustomQueryEditorFont"]]]; [textView setBackgroundColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"CustomQueryEditorBackgroundColor"]]]; [textView setTextColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"CustomQueryEditorTextColor"]]]; [textView setInsertionPointColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"CustomQueryEditorCaretColor"]]]; @@ -1804,7 +1803,10 @@ - (void)textViewDidChangeTypingAttributes:(NSNotification *)aNotification { // Only save the font if prefs have been loaded, ensuring the saved font has been applied once. - if (prefs) [prefs setObject:[NSArchiver archivedDataWithRootObject:[textView font]] forKey:@"CustomQueryEditorFont"]; + // And check for [textView font] != nil which occurs while awaking from nib. + if (prefs && [textView font] != nil) + [prefs setObject:[NSArchiver archivedDataWithRootObject:[textView font]] forKey:@"CustomQueryEditorFont"]; + } #pragma mark - |