aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPPrintAccessory.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2013-02-16 22:03:09 +0000
committerstuconnolly <stuart02@gmail.com>2013-02-16 22:03:09 +0000
commit27156550b646a74d2345b4ff9650b7a3b4ba052e (patch)
tree4f2608744fcef3524e1c208d860452a120e1a4ce /Source/SPPrintAccessory.m
parent624244dd35a6ca2e7942fbadbcaea756367b3453 (diff)
downloadsequelpro-27156550b646a74d2345b4ff9650b7a3b4ba052e.tar.gz
sequelpro-27156550b646a74d2345b4ff9650b7a3b4ba052e.tar.bz2
sequelpro-27156550b646a74d2345b4ff9650b7a3b4ba052e.zip
Fix more wanrings by creating a protocol that delegates of the copy table should conform to.
Diffstat (limited to 'Source/SPPrintAccessory.m')
-rw-r--r--Source/SPPrintAccessory.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/SPPrintAccessory.m b/Source/SPPrintAccessory.m
index 2722b574..ce8c950c 100644
--- a/Source/SPPrintAccessory.m
+++ b/Source/SPPrintAccessory.m
@@ -45,6 +45,7 @@
- (void)awakeFromNib
{
[self setView:printAccessoryView];
+
[defaultsController addObserver:self forKeyPath:@"values.PrintBackground" options:NSKeyValueObservingOptionNew context:@"PrinterSettingsChanged"];
}
@@ -63,7 +64,8 @@
if ([(NSString *)context isEqualToString:@"PrinterSettingsChanged"]) {
if (printWebView)
[[printWebView preferences] setShouldPrintBackgrounds:[[defaultsController valueForKeyPath:@"values.PrintBackground"] boolValue]];
- } else {
+ }
+ else {
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}
}
@@ -74,12 +76,14 @@
- (void)setPrintView:(WebView *)theWebView
{
printWebView = theWebView;
+
[[printWebView preferences] setShouldPrintBackgrounds:[[defaultsController valueForKeyPath:@"values.PrintBackground"] boolValue]];
}
- (void)dealloc
{
[defaultsController removeObserver:self forKeyPath:@"values.PrintBackground"];
+
[super dealloc];
}