aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPExportController.h5
-rw-r--r--Source/SPExportController.m22
2 files changed, 13 insertions, 14 deletions
diff --git a/Source/SPExportController.h b/Source/SPExportController.h
index 274da7ed..f1737595 100644
--- a/Source/SPExportController.h
+++ b/Source/SPExportController.h
@@ -187,11 +187,6 @@
SPExportSource exportSource;
/**
- * Available filename tokens
- */
- NSString *availableFilenameTokens;
-
- /**
* Display advanced view flag
*/
BOOL showAdvancedView;
diff --git a/Source/SPExportController.m b/Source/SPExportController.m
index a4851f53..6cee32b7 100644
--- a/Source/SPExportController.m
+++ b/Source/SPExportController.m
@@ -38,6 +38,7 @@
@interface SPExportController (PrivateAPI)
- (void)_updateDisplayedExportFilename;
+- (void)_updateAvailableExportFilenameTokens;
- (NSString *)_generateDefaultExportFilename;
- (NSString *)_currentDefaultExportFileExtension;
@@ -94,9 +95,6 @@
windowMinHeigth = [[self window] minSize].height;
prefs = [NSUserDefaults standardUserDefaults];
-
- // Default filename tokens
- availableFilenameTokens = NSLocalizedString(@"host,database,table,date,time", @"default custom export filename tokens");
}
return self;
@@ -358,6 +356,8 @@
[exportCSVNULLValuesAsTextField setStringValue:[prefs stringForKey:SPNullValue]];
[exportXMLNULLValuesAsTextField setStringValue:[prefs stringForKey:SPNullValue]];
+ [self _updateAvailableExportFilenameTokens];
+
if (!showCustomFilenameView) [self _updateDisplayedExportFilename];
}
@@ -379,8 +379,7 @@
[exportDeselectAllTablesButton setEnabled:isSelectedTables];
[exportRefreshTablesButton setEnabled:isSelectedTables];
- availableFilenameTokens = ([sender indexOfSelectedItem] == SPQueryExport) ? @"host,database,date,time" : @"host,database,table,date,time";
-
+ [self _updateAvailableExportFilenameTokens];
[self _updateDisplayedExportFilename];
}
}
@@ -432,10 +431,7 @@
* Opens the open panel when user selects to change the output path.
*/
- (IBAction)changeExportOutputPath:(id)sender
-{
- [exportCustomFilenameTokenField setStringValue:@""];
- [exportCustomFilenameTokensField setStringValue:availableFilenameTokens];
-
+{
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setCanChooseFiles:NO];
@@ -716,6 +712,14 @@
}
/**
+ * Updates the available export filename tokens.
+ */
+- (void)_updateAvailableExportFilenameTokens
+{
+ [exportCustomFilenameTokensField setStringValue:((exportSource == SPQueryExport) || (exportType == SPDotExport)) ? NSLocalizedString(@"host,database,date,time", @"custom export filename tokens without table") : NSLocalizedString(@"host,database,table,date,time", @"default custom export filename tokens")];
+}
+
+/**
* Generates the default export filename based on the selected export options.
*/
- (NSString *)_generateDefaultExportFilename