aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-03-21 22:17:50 +0000
committerBibiko <bibiko@eva.mpg.de>2010-03-21 22:17:50 +0000
commitb5cabd449156acaf18815759ee4cc5383e8fa4f6 (patch)
tree7e1c0c01cb8c86fb7dba26abf4c0b7a582d0a20f /Source/TableDocument.m
parent919f4705fc4d4e59133e4279a1e87dc432e12f2d (diff)
downloadsequelpro-b5cabd449156acaf18815759ee4cc5383e8fa4f6.tar.gz
sequelpro-b5cabd449156acaf18815759ee4cc5383e8fa4f6.tar.bz2
sequelpro-b5cabd449156acaf18815759ee4cc5383e8fa4f6.zip
• Navigator
- added 'sync' mode - the navigator follows the active window db/table selection if navigator has not multiple selected items - added drag support of selected items -- as comma separated and backtick quoted string for external apps -- as array of schema paths for SP • CMTextView - added drop support for selected items coming from the Navigator - insert them as comma list relative to current selected db/table
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m30
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 36291911..763a444b 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -743,6 +743,7 @@
break;
}
}
+
}
/**
@@ -857,6 +858,17 @@
// Do not update the navigator since nothing is changed
[[SPNavigatorController sharedNavigatorController] setIgnoreUpdate:YES];
+ // If Navigator runs in syncMode let it follow the selection
+ if([[SPNavigatorController sharedNavigatorController] syncMode]) {
+ NSMutableString *schemaPath = [NSMutableString string];
+ [schemaPath setString:[self connectionID]];
+ if([chooseDatabaseButton titleOfSelectedItem] && [[chooseDatabaseButton titleOfSelectedItem] length]) {
+ [schemaPath appendString:SPUniqueSchemaDelimiter];
+ [schemaPath appendString:[chooseDatabaseButton titleOfSelectedItem]];
+ }
+ [[SPNavigatorController sharedNavigatorController] selectPath:schemaPath];
+ }
+
// Start a task
[self startTaskWithDescription:[NSString stringWithFormat:NSLocalizedString(@"Loading database '%@'...", @"Loading database task string"), [chooseDatabaseButton titleOfSelectedItem]]];
if ([NSThread isMainThread]) {
@@ -3692,6 +3704,24 @@
return YES;
}
+- (void)windowDidBecomeKey:(NSNotification *)notification
+{
+ // Synchronize Navigator with current active document if Navigator runs in syncMode
+ if([[SPNavigatorController sharedNavigatorController] syncMode] && [self connectionID] && ![[self connectionID] isEqualToString:@"_"]) {
+ NSMutableString *schemaPath = [NSMutableString string];
+ [schemaPath setString:[self connectionID]];
+ if([self database] && [[self database] length]) {
+ [schemaPath appendString:SPUniqueSchemaDelimiter];
+ [schemaPath appendString:[self database]];
+ if([self table] && [[self table] length]) {
+ [schemaPath appendString:SPUniqueSchemaDelimiter];
+ [schemaPath appendString:[self table]];
+ }
+ }
+ [[SPNavigatorController sharedNavigatorController] selectPath:schemaPath];
+ }
+}
+
/**
* Invoked when the document window is resized
*/