aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPBundleCommandTextView.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-11-29 14:53:37 +0000
committerBibiko <bibiko@eva.mpg.de>2010-11-29 14:53:37 +0000
commitcef5a0200f433e53bd27b2516e5ac269205f0420 (patch)
treeb8506962744b98ecf1930f0f850def8def2887a4 /Source/SPBundleCommandTextView.m
parentacc0d65e502eac87ab469db11a96cbc7a4b39593 (diff)
downloadsequelpro-cef5a0200f433e53bd27b2516e5ac269205f0420.tar.gz
sequelpro-cef5a0200f433e53bd27b2516e5ac269205f0420.tar.bz2
sequelpro-cef5a0200f433e53bd27b2516e5ac269205f0420.zip
• Bundle Editor
- fixed an init font setting problem (thanks to Rowan) - further work on triggers
Diffstat (limited to 'Source/SPBundleCommandTextView.m')
-rw-r--r--Source/SPBundleCommandTextView.m21
1 files changed, 16 insertions, 5 deletions
diff --git a/Source/SPBundleCommandTextView.m b/Source/SPBundleCommandTextView.m
index b90cea43..d5a649bb 100644
--- a/Source/SPBundleCommandTextView.m
+++ b/Source/SPBundleCommandTextView.m
@@ -54,8 +54,8 @@
[prefs addObserver:self forKeyPath:SPCustomQueryEditorTabStopWidth options:NSKeyValueObservingOptionNew context:NULL];
- if([[NSUserDefaults standardUserDefaults] dataForKey:@"BundleEditorFont"]) {
- NSFont *nf = [NSUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] dataForKey:@"BundleEditorFont"]];
+ if([prefs dataForKey:@"BundleEditorFont"]) {
+ NSFont *nf = [NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"BundleEditorFont"]];
[self setFont:nf];
}
@@ -345,6 +345,15 @@
NSMutableArray *myArrayOfTabs;
NSMutableParagraphStyle *paragraphStyle;
+ if(tvFont == nil && [prefs dataForKey:@"BundleEditorFont"]) {
+ tvFont = [NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"BundleEditorFont"]];
+ }
+ if(tvFont == nil) {
+ tvFont = [NSFont fontWithName:SPDefaultMonospacedFontName size:12];
+ [self setFont:tvFont];
+ [prefs setObject:[NSArchiver archivedDataWithRootObject:tvFont] forKey:@"BundleEditorFont"];
+ }
+
BOOL oldEditableStatus = [self isEditable];
[self setEditable:YES];
@@ -719,9 +728,11 @@
// Action receiver for a font change in the font panel
- (void)changeFont:(id)sender
{
- NSFont *nf = [[NSFontPanel sharedFontPanel] panelConvertFont:[self font]];
- [self setFont:nf];
- [self saveChangedFontInUserDefaults];
+ if (prefs && [self font] != nil) {
+ NSFont *nf = [[NSFontPanel sharedFontPanel] panelConvertFont:[self font]];
+ [self setFont:nf];
+ [self saveChangedFontInUserDefaults];
+ }
}
@end