aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
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
*/