aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPExportControllerDelegate.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-04-16 20:16:52 +0000
committerstuconnolly <stuart02@gmail.com>2012-04-16 20:16:52 +0000
commit4cad6f0e6e4fb497b480256c2abe3de34ebf225c (patch)
treeb66d6a72a1537cf98624acf3c685f1a4d916fd86 /Source/SPExportControllerDelegate.m
parent0d3b69f964a8d9d93ca794d457b461463f1ec95d (diff)
downloadsequelpro-4cad6f0e6e4fb497b480256c2abe3de34ebf225c.tar.gz
sequelpro-4cad6f0e6e4fb497b480256c2abe3de34ebf225c.tar.bz2
sequelpro-4cad6f0e6e4fb497b480256c2abe3de34ebf225c.zip
Bring outline view branch up to date with trunk.
Diffstat (limited to 'Source/SPExportControllerDelegate.m')
-rw-r--r--Source/SPExportControllerDelegate.m28
1 files changed, 18 insertions, 10 deletions
diff --git a/Source/SPExportControllerDelegate.m b/Source/SPExportControllerDelegate.m
index e8e9f1c6..23821d12 100644
--- a/Source/SPExportControllerDelegate.m
+++ b/Source/SPExportControllerDelegate.m
@@ -31,6 +31,7 @@
@interface SPExportController (SPExportControllerPrivateAPI)
- (void)_toggleExportButtonOnBackgroundThread;
+- (void)_toggleSQLExportTableNameTokenAvailability;
- (void)_updateExportFormatInformation;
- (void)_switchTab;
@@ -55,6 +56,7 @@
{
[[tables objectAtIndex:rowIndex] replaceObjectAtIndex:[exportTableList columnWithIdentifier:[tableColumn identifier]] withObject:anObject];
+ [self updateAvailableExportFilenameTokens];
[self _toggleExportButtonOnBackgroundThread];
[self _updateExportFormatInformation];
}
@@ -67,9 +69,9 @@
return (tableView == exportTableList);
}
-- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex
+- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex
{
- [aCell setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+ [cell setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
}
#pragma mark -
@@ -102,23 +104,29 @@
*/
- (NSArray *)tokenField:(NSTokenField *)tokenField shouldAddObjects:(NSArray *)tokens atIndex:(NSUInteger)index
{
- NSMutableArray *processedTokens = [NSMutableArray array];
NSUInteger i, j;
+ NSMutableArray *processedTokens = [NSMutableArray array];
NSCharacterSet *alphanumericSet = [NSCharacterSet alphanumericCharacterSet];
- for (NSString *inputToken in tokens) {
+ for (NSString *inputToken in tokens)
+ {
j = 0;
- for (i = 0; i < [inputToken length]; i++) {
+
+ for (i = 0; i < [inputToken length]; i++)
+ {
if (![alphanumericSet characterIsMember:[inputToken characterAtIndex:i]]) {
if (i > j) {
- [processedTokens addObject:[self tokenObjectForString:[inputToken substringWithRange:NSMakeRange(j, i-j)]]];
+ [processedTokens addObject:[self tokenObjectForString:[inputToken substringWithRange:NSMakeRange(j, i - j)]]];
}
+
[processedTokens addObject:[inputToken substringWithRange:NSMakeRange(i, 1)]];
- j = i+1;
+
+ j = i + 1;
}
}
+
if (j < i) {
- [processedTokens addObject:[self tokenObjectForString:[inputToken substringWithRange:NSMakeRange(j, i-j)]]];
+ [processedTokens addObject:[self tokenObjectForString:[inputToken substringWithRange:NSMakeRange(j, i - j)]]];
}
}
@@ -146,9 +154,9 @@
* During text entry into the token field, update the displayed filename and also
* trigger tokenization after a short delay.
*/
-- (void)controlTextDidChange:(NSNotification *)aNotification
+- (void)controlTextDidChange:(NSNotification *)notification
{
- if ([aNotification object] == exportCustomFilenameTokenField) {
+ if ([notification object] == exportCustomFilenameTokenField) {
[self updateDisplayedExportFilename];
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(tokenizeCustomFilenameTokenField) object:nil];
[self performSelector:@selector(tokenizeCustomFilenameTokenField) withObject:nil afterDelay:0.5];