aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-07-25 11:32:17 +0000
committerstuconnolly <stuart02@gmail.com>2010-07-25 11:32:17 +0000
commit0dff71796759307023398775fde082e3bdd41d31 (patch)
treeb473ecef3cabfd134539855ecf6693def89e19bd /Source
parent15578792fecccae6121b1e8b47108776e3d80747 (diff)
downloadsequelpro-0dff71796759307023398775fde082e3bdd41d31.tar.gz
sequelpro-0dff71796759307023398775fde082e3bdd41d31.tar.bz2
sequelpro-0dff71796759307023398775fde082e3bdd41d31.zip
During a CSV export if the user selects the tab as the separator update the extension to be .tsv
Diffstat (limited to 'Source')
-rw-r--r--Source/SPExportController.m16
-rw-r--r--Source/SPExportFilenameUtilities.m3
2 files changed, 18 insertions, 1 deletions
diff --git a/Source/SPExportController.m b/Source/SPExportController.m
index bb16d36f..b7d26fef 100644
--- a/Source/SPExportController.m
+++ b/Source/SPExportController.m
@@ -119,6 +119,12 @@
// If found the set the default path to the user's desktop, otherwise use their home directory
[exportPathField setStringValue:([paths count] > 0) ? [paths objectAtIndex:0] : NSHomeDirectory()];
+
+ // Register to receive notifications of a change in selection of the CSV field separator
+ /*[[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(comboBoxSelectionDidChange:)
+ name:NSComboBoxSelectionDidChangeNotification
+ object:nil];*/
}
#pragma mark -
@@ -629,6 +635,16 @@
}
#pragma mark -
+#pragma mark Combo box delegate methods
+
+- (void)comboBoxSelectionDidChange:(NSNotification *)notification
+{
+ if ([notification object] == exportCSVFieldsTerminatedField) {
+ [self updateDisplayedExportFilename];
+ }
+}
+
+#pragma mark -
#pragma mark Other
/**
diff --git a/Source/SPExportFilenameUtilities.m b/Source/SPExportFilenameUtilities.m
index 53786d51..64101b21 100644
--- a/Source/SPExportFilenameUtilities.m
+++ b/Source/SPExportFilenameUtilities.m
@@ -95,7 +95,8 @@
extension = SPFileExtensionSQL;
break;
case SPCSVExport:
- extension = @"csv";
+ // If the tab character (\t) is selected as the feild separator return the extension as .tsv
+ extension = ([exportCSVFieldsTerminatedField indexOfSelectedItem] == 2) ? @"tsv" : @"csv";
break;
case SPXMLExport:
extension = @"xml";