aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbamse16 <marius@marius.me.uk>2009-08-18 19:22:33 +0000
committerbamse16 <marius@marius.me.uk>2009-08-18 19:22:33 +0000
commitb30cc9d877f2dab24901ac9cf5c6e1f1835fb454 (patch)
treebc8c81999b7f6ca646977c753acab7bb27489c37
parent2da638b9f70d504668dd3e5103485b0b1eb7fd22 (diff)
downloadsequelpro-b30cc9d877f2dab24901ac9cf5c6e1f1835fb454.tar.gz
sequelpro-b30cc9d877f2dab24901ac9cf5c6e1f1835fb454.tar.bz2
sequelpro-b30cc9d877f2dab24901ac9cf5c6e1f1835fb454.zip
Issue 351: Export CSV pipe
I had to cheat and name the file %@.csv, so the suggested filetype is csv, but you can change it to something else.
-rw-r--r--Source/TableDump.m24
1 files changed, 8 insertions, 16 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m
index 0a7d5e0e..4e53afb9 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -146,54 +146,47 @@
// Export the full resultset for the currently selected table to a file in CSV format
case 6:
- file = [NSString stringWithString:(NSString *)[tableDocumentInstance table]];
- [savePanel setRequiredFileType:@"csv"];
+ file = [NSString stringWithFormat:@"%@.csv", [tableDocumentInstance table]];
[savePanel setAccessoryView:exportCSVView];
contextInfo = @"exportTableContentAsCSV";
break;
// Export the full resultset for the currently selected table to a file in XML format
case 7:
- file = [NSString stringWithString:(NSString *)[tableDocumentInstance table]];
- [savePanel setRequiredFileType:@"xml"];
+ file = [NSString stringWithFormat:@"%@.xml", [tableDocumentInstance table]];
contextInfo = @"exportTableContentAsXML";
break;
// Export the current "browse" view to a file in CSV format
case 8:
- file = [NSString stringWithFormat:@"%@ view", [tableDocumentInstance table]];
- [savePanel setRequiredFileType:@"csv"];
+ file = [NSString stringWithFormat:@"%@ view.csv", [tableDocumentInstance table]];
[savePanel setAccessoryView:exportCSVView];
contextInfo = @"exportBrowseViewAsCSV";
break;
// Export the current "browse" view to a file in XML format
case 9:
- file = [NSString stringWithFormat:@"%@ view", [tableDocumentInstance table]];
- [savePanel setRequiredFileType:@"xml"];
+ file = [NSString stringWithFormat:@"%@ view.xml", [tableDocumentInstance table]];
contextInfo = @"exportBrowseViewAsXML";
break;
// Export the current custom query result set to a file in CSV format
case 10:
- file = @"customresult";
- [savePanel setRequiredFileType:@"csv"];
+ file = @"customresult.csv";
[savePanel setAccessoryView:exportCSVView];
contextInfo = @"exportCustomResultAsCSV";
break;
// Export the current custom query result set to a file in XML format
case 11:
- file = @"customresult";
- [savePanel setRequiredFileType:@"xml"];
+ file = @"customresult.xml";
contextInfo = @"exportCustomResultAsXML";
break;
// Export multiple tables to a file in CSV format
case 12:
[self reloadTables:self];
- file = [NSString stringWithString:[tableDocumentInstance database]];
- [savePanel setRequiredFileType:@"csv"];
+ file = [NSString stringWithFormat:@"%@.csv", [tableDocumentInstance database]];
[savePanel setAccessoryView:exportMultipleCSVView];
contextInfo = @"exportMultipleTablesAsCSV";
break;
@@ -201,8 +194,7 @@
// Export multiple tables to a file in XML format
case 13:
[self reloadTables:self];
- file = [NSString stringWithString:[tableDocumentInstance database]];
- [savePanel setRequiredFileType:@"xml"];
+ file = [NSString stringWithFormat:@"%@.xml", [tableDocumentInstance database]];
[savePanel setAccessoryView:exportMultipleXMLView];
contextInfo = @"exportMultipleTablesAsXML";
break;