aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExportController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-07-05 17:44:01 +0000
committerstuconnolly <stuart02@gmail.com>2010-07-05 17:44:01 +0000
commit2eb73a5630448763688a7835e9073eff90ad4f5b (patch)
tree407dce3be2911e4d85f0e55f34170252702f9400 /Source/SPExportController.m
parentfa4f0429a347cede42e999566ae06b22acd2598c (diff)
downloadsequelpro-2eb73a5630448763688a7835e9073eff90ad4f5b.tar.gz
sequelpro-2eb73a5630448763688a7835e9073eff90ad4f5b.tar.bz2
sequelpro-2eb73a5630448763688a7835e9073eff90ad4f5b.zip
Simplify the ease at which export filename tokens can be localised as well as how they are updated with respect to the selected export type.
Diffstat (limited to 'Source/SPExportController.m')
-rw-r--r--Source/SPExportController.m22
1 files changed, 13 insertions, 9 deletions
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