aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPPrintController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-10-07 19:25:41 +0000
committerstuconnolly <stuart02@gmail.com>2010-10-07 19:25:41 +0000
commit22afbe4dacdf089c3f9f440e1ad859982cbb714e (patch)
treee8ba3561348e2680b9c6e51e0acc9c3b03fb0e00 /Source/SPPrintController.m
parenta9bab719792a3a035618ba9d19ca0651c0387c00 (diff)
downloadsequelpro-22afbe4dacdf089c3f9f440e1ad859982cbb714e.tar.gz
sequelpro-22afbe4dacdf089c3f9f440e1ad859982cbb714e.tar.bz2
sequelpro-22afbe4dacdf089c3f9f440e1ad859982cbb714e.zip
When printing a table/view's structure, change the heading accordingly. Also, don't include the tables indexes table if there are none.
Diffstat (limited to 'Source/SPPrintController.m')
-rw-r--r--Source/SPPrintController.m14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/SPPrintController.m b/Source/SPPrintController.m
index 3a2f4148..1119fc15 100644
--- a/Source/SPPrintController.m
+++ b/Source/SPPrintController.m
@@ -178,7 +178,6 @@
// Cancel the print thread
[printThread cancel];
-
}
/**
@@ -217,7 +216,16 @@
NSDictionary *tableSource = [tableSourceInstance tableSourceForPrinting];
- heading = NSLocalizedString(@"Table Structure", @"table structure print heading");
+ SPExportMode tableType = [tablesListInstance tableType];
+
+ switch (tableType) {
+ case SPTableTypeTable:
+ heading = NSLocalizedString(@"Table Structure", @"table structure print heading");
+ break;
+ case SPTableTypeView:
+ heading = NSLocalizedString(@"View Structure", @"view structure print heading");
+ break;
+ }
rows = [[NSArray alloc] initWithArray:
[[tableSource objectForKey:@"structure"] objectsAtIndexes:
@@ -235,6 +243,8 @@
[printData setObject:indexes forKey:@"indexes"];
[printData setObject:indexColumns forKey:@"indexColumns"];
+ if ([indexes count]) [printData setObject:[NSNumber numberWithInteger:1] forKey:@"hasIndexes"];
+
[rows release];
[indexes release];
}