diff options
author | stuconnolly <stuart02@gmail.com> | 2009-08-29 15:58:04 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-08-29 15:58:04 +0000 |
commit | 862a85c6311af3caaef4be340d090eee1dc054cf (patch) | |
tree | 3acad108416bcd56e175a62a8b02795dc06846a4 /Source/SPExportController.m | |
parent | 72258028821c732892fd4ee00149a9afece290e4 (diff) | |
download | sequelpro-862a85c6311af3caaef4be340d090eee1dc054cf.tar.gz sequelpro-862a85c6311af3caaef4be340d090eee1dc054cf.tar.bz2 sequelpro-862a85c6311af3caaef4be340d090eee1dc054cf.zip |
Implement the core CSV export process in the new CSV exporter class.
Diffstat (limited to 'Source/SPExportController.m')
-rw-r--r-- | Source/SPExportController.m | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/Source/SPExportController.m b/Source/SPExportController.m index f89e727d..15e47e61 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -73,6 +73,18 @@ if (returnCode == NSOKButton) { // First determine what type of export the user selected + SPExportType exportType = 0; + + for (NSToolbarItem *item in [exportToolbar items]) + { + if ([[item itemIdentifier] isEqualToString:[exportToolbar selectedItemIdentifier]]) { + exportType = [item tag]; + break; + } + } + + // Determine what data to use (filtered result, custom query result or selected tables) + SPExportSource exportSource = ([exportInputMatrix selectedRow] + 1); } } @@ -86,7 +98,7 @@ - (void)loadTables { - int i; + NSUInteger i; [tables removeAllObjects]; @@ -130,12 +142,12 @@ return [tables count]; } -- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex +- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { return NSArrayObjectAtIndex([tables objectAtIndex:rowIndex], ([[aTableColumn identifier] isEqualToString:@"switch"]) ? 0 : 1); } -- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex +- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { [[tables objectAtIndex:rowIndex] replaceObjectAtIndex:0 withObject:anObject]; } @@ -153,7 +165,7 @@ return (aTableView == exportTableList); } -- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex +- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { [aCell setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; } @@ -166,7 +178,7 @@ NSMutableArray *items = [NSMutableArray arrayWithCapacity:6]; for (NSToolbarItem *item in [toolbar items]) - { + { [items addObject:[item itemIdentifier]]; } |