aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorbamse16 <marius@marius.me.uk>2009-06-04 12:44:22 +0000
committerbamse16 <marius@marius.me.uk>2009-06-04 12:44:22 +0000
commitf3e421d2e4ba9ec54878968c34044dce89dc6f09 (patch)
tree9aef4cc69ef64799984fbc6c27ee2a1bab86078d /Source/TableDocument.m
parentc9ca5d2a18f7dcbe1915d8602c399f83259a7850 (diff)
downloadsequelpro-f3e421d2e4ba9ec54878968c34044dce89dc6f09.tar.gz
sequelpro-f3e421d2e4ba9ec54878968c34044dce89dc6f09.tar.bz2
sequelpro-f3e421d2e4ba9ec54878968c34044dce89dc6f09.zip
Added print accesory view with option to Print Backgrounds
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index d0b04d5e..6804e5a4 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -46,6 +46,7 @@
#import "MainController.h"
#import "SPExtendedTableInfo.h"
#import "SPPreferenceController.h"
+#import "SPPrintAccessory.h"
// Used for printing
#import "MGTemplateEngine.h"
@@ -134,6 +135,15 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
//add ability to select orientation to print panel
NSPrintPanel *printPanel = [op printPanel];
[printPanel setOptions:[printPanel options] + NSPrintPanelShowsOrientation + NSPrintPanelShowsScaling + NSPrintPanelShowsPaperSize];
+
+ SPPrintAccessory *printAccessory = [[SPPrintAccessory alloc] init];
+ [printAccessory initWithNibName:@"printAccessory" bundle:nil];
+ [printPanel addAccessoryController:printAccessory];
+
+ NSPageLayout *pageLayout = [NSPageLayout pageLayout];
+ [pageLayout addAccessoryController:printAccessory];
+ [printAccessory release];
+
[op setPrintPanel:printPanel];
[op runOperationModalForWindow:tableWindow
@@ -217,8 +227,13 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
rows, @"rows",
nil];
+ [connection release];
+ [rows release];
+
// Process the template and display the results.
NSString *result = [engine processTemplateInFileAtPath:templatePath withVariables:print_data];
+ NSLog(@"result %@", result);
+
return result;
}