diff options
author | bamse16 <marius@marius.me.uk> | 2009-04-11 09:14:42 +0000 |
---|---|---|
committer | bamse16 <marius@marius.me.uk> | 2009-04-11 09:14:42 +0000 |
commit | 1824ae6360c9ce1897e75404163d39df08ee5fbf (patch) | |
tree | 0eca1f6f4cb42e08f25e44a4683aecfb5881aac2 /Source/TableSource.m | |
parent | 41f8cde09ff77996339cabc71517496976beee2e (diff) | |
download | sequelpro-1824ae6360c9ce1897e75404163d39df08ee5fbf.tar.gz sequelpro-1824ae6360c9ce1897e75404163d39df08ee5fbf.tar.bz2 sequelpro-1824ae6360c9ce1897e75404163d39df08ee5fbf.zip |
Added printing support via WebKit WebView
Diffstat (limited to 'Source/TableSource.m')
-rw-r--r-- | Source/TableSource.m | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/TableSource.m b/Source/TableSource.m index 92aa9811..de6bca6c 100644 --- a/Source/TableSource.m +++ b/Source/TableSource.m @@ -91,7 +91,7 @@ loads aTable, put it in an array, update the tableViewColumns and reload the tab [tableFields setArray:[self fetchResultAsArray:tableSourceResult]]; [tableSourceResult release]; - indexResult = [[mySQLConnection queryString:[NSString stringWithFormat:@"SHOW INDEX FROM %@", [selectedTable backtickQuotedString]]] retain]; + indexResult = [[mySQLConnection queryString:[NSString stringWithFormat:@"NSPrintPanelShowsPageSetupAccessory %@", [selectedTable backtickQuotedString]]] retain]; // [indexes setArray:[[self fetchResultAsArray:indexResult] retain]]; [indexes setArray:[self fetchResultAsArray:indexResult]]; [indexResult release]; @@ -832,6 +832,23 @@ returns a dictionary containing enum/set field names as key and possible values return [NSDictionary dictionaryWithDictionary:enumFields]; } +- (NSArray *)tableStructureForPrint +{ + CMMCPResult *queryResult; + NSMutableArray *tempResult = [NSMutableArray array]; + int i; + + queryResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW COLUMNS FROM %@", [selectedTable backtickQuotedString]]]; + + if ([queryResult numOfRows]) [queryResult dataSeek:0]; + [tempResult addObject:[queryResult fetchFieldNames]]; + for ( i = 0 ; i < [queryResult numOfRows] ; i++ ) { + [tempResult addObject:[queryResult fetchRowAsArray]]; + } + + return tempResult; +} + #pragma mark TableView datasource methods - (int)numberOfRowsInTableView:(NSTableView *)aTableView |