aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordmoagx <post@wickenrode.com>2012-03-16 20:19:17 +0000
committerdmoagx <post@wickenrode.com>2012-03-16 20:19:17 +0000
commit8886d935e933c6239aa9b35e900d96f7d07527c7 (patch)
tree20093287366272e0e7b234f863e69e5a236a8f00
parentab3d4cc4fcc42283cebc1062729512d85e9db620 (diff)
downloadsequelpro-8886d935e933c6239aa9b35e900d96f7d07527c7.tar.gz
sequelpro-8886d935e933c6239aa9b35e900d96f7d07527c7.tar.bz2
sequelpro-8886d935e933c6239aa9b35e900d96f7d07527c7.zip
* Moves the background color code for SPTextView into the class. Fixes #1073
-rw-r--r--Source/SPDatabaseDocument.m12
-rw-r--r--Source/SPExtendedTableInfo.m11
-rw-r--r--Source/SPQueryFavoriteManager.m12
-rw-r--r--Source/SPTextView.m8
4 files changed, 6 insertions, 37 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 53d9b5c6..4af8de2f 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -299,18 +299,6 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax";
// Hide the activity list
[self setActivityPaneHidden:[NSNumber numberWithInteger:1]];
- // Bind the background color of the create syntax text view to the users preference
- [createTableSyntaxTextView setAllowsDocumentBackgroundColorChange:YES];
-
- NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
-
- [bindingOptions setObject:NSUnarchiveFromDataTransformerName forKey:@"NSValueTransformerName"];
-
- [createTableSyntaxTextView bind:@"backgroundColor"
- toObject:[NSUserDefaultsController sharedUserDefaultsController]
- withKeyPath:@"values.CustomQueryEditorBackgroundColor"
- options:bindingOptions];
-
// Load additional nibs, keeping track of the top-level objects to allow correct release
NSArray *connectionDialogTopLevelObjects = nil;
NSNib *nibLoader = [[NSNib alloc] initWithNibNamed:@"ConnectionErrorDialog" bundle:[NSBundle mainBundle]];
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index 3429446b..dcacf2ed 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -53,17 +53,6 @@ static NSString *SPUpdateTableTypeNewType = @"SPUpdateTableTypeNewType";
*/
- (void)awakeFromNib
{
- [tableCreateSyntaxTextView setAllowsDocumentBackgroundColorChange:YES];
-
- NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
-
- [bindingOptions setObject:NSUnarchiveFromDataTransformerName forKey:@"NSValueTransformerName"];
-
- [tableCreateSyntaxTextView bind:@"backgroundColor"
- toObject:[NSUserDefaultsController sharedUserDefaultsController]
- withKeyPath:@"values.CustomQueryEditorBackgroundColor"
- options:bindingOptions];
-
// Add observers for document task activity
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(startDocumentTaskForTab:)
diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m
index 28f824fe..1b5ce3dc 100644
--- a/Source/SPQueryFavoriteManager.m
+++ b/Source/SPQueryFavoriteManager.m
@@ -82,18 +82,6 @@
*/
- (void)awakeFromNib
{
- [favoriteQueryTextView setAllowsDocumentBackgroundColorChange:YES];
-
- NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
-
- [bindingOptions setObject:NSUnarchiveFromDataTransformerName forKey:@"NSValueTransformerName"];
-
- [favoriteQueryTextView bind:@"backgroundColor"
- toObject:[NSUserDefaultsController sharedUserDefaultsController]
- withKeyPath:@"values.CustomQueryEditorBackgroundColor"
- options:bindingOptions];
-
-
[favorites addObject:[NSDictionary dictionaryWithObjectsAndKeys:
@"Global", @"name",
@"", @"headerOfFileURL",
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index 500e4892..6611d6f8 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -180,7 +180,9 @@ NSInteger _alphabeticSort(id string1, id string2, void *reverse)
#ifndef SP_REFACTOR
[self setQueryHiliteColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorHighlightQueryColor]]];
- [self setQueryEditorBackgroundColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorBackgroundColor]]];
+ NSColor *backgroundColor = [NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorBackgroundColor]];
+ [self setQueryEditorBackgroundColor:backgroundColor];
+ [self setBackgroundColor:backgroundColor];
[self setCommentColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorCommentColor]]];
[self setQuoteColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorQuoteColor]]];
[self setKeywordColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorSQLKeywordColor]]];
@@ -240,7 +242,9 @@ NSInteger _alphabeticSort(id string1, id string2, void *reverse)
{
#ifndef SP_REFACTOR
if ([keyPath isEqualToString:SPCustomQueryEditorBackgroundColor]) {
- [self setQueryEditorBackgroundColor:[NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]]];
+ NSColor *backgroundColor = [NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]];
+ [self setQueryEditorBackgroundColor:backgroundColor];
+ [self setBackgroundColor:backgroundColor];
[self setNeedsDisplayInRect:[self bounds]];
} else if ([keyPath isEqualToString:SPCustomQueryEditorFont]) {
[self setFont:[NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]]];