aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-03-17 23:49:54 +0000
committerBibiko <bibiko@eva.mpg.de>2010-03-17 23:49:54 +0000
commite963cec5171253920651b4e66b340746761e91f1 (patch)
treeedce20f9e5e78eb0f956d2dbe56cca2686097770 /Source/TableDocument.m
parentc4c24a3b54abb9fcab76bf204535e64bb2b0f61c (diff)
downloadsequelpro-e963cec5171253920651b4e66b340746761e91f1.tar.gz
sequelpro-e963cec5171253920651b4e66b340746761e91f1.tar.bz2
sequelpro-e963cec5171253920651b4e66b340746761e91f1.zip
• initial commit to support a connection/schema navigator (not yet active - to try see line 1134 in TableDocument.m)
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m34
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 2337961f..a262f09d 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -35,6 +35,7 @@
#import "SPGrowlController.h"
#import "SPExportController.h"
#import "SPQueryController.h"
+#import "SPNavigatorController.h"
#import "SPSQLParser.h"
#import "SPTableData.h"
#import "SPDatabaseData.h"
@@ -1130,6 +1131,7 @@
} else {
[[[SPQueryController sharedQueryController] window] makeKeyAndOrderFront:self];
}
+ // [self showNavigator:self];
}
/**
@@ -1149,6 +1151,37 @@
}
#pragma mark -
+#pragma mark Navigator methods
+
+/**
+ * Shows or hides the navigator
+ */
+- (void)toggleNavigator:(id)sender
+{
+ BOOL isNavigatorVisible = [[[SPNavigatorController sharedNavigatorController] window] isVisible];
+
+ // If the Console window is not visible data are not reloaded (for speed).
+ // Due to that update list if user opens the Console window.
+ if(!isNavigatorVisible) {
+ [[SPNavigatorController sharedNavigatorController] updateEntries];
+ }
+
+ // Show or hide the navigator
+ [[[SPNavigatorController sharedNavigatorController] window] setIsVisible:(!isNavigatorVisible)];
+}
+
+- (void)showNavigator:(id)sender
+{
+ BOOL isNavigatorVisible = [[[SPNavigatorController sharedNavigatorController] window] isVisible];
+
+ if (!isNavigatorVisible) {
+ [self toggleNavigator:sender];
+ } else {
+ [[[SPNavigatorController sharedNavigatorController] window] makeKeyAndOrderFront:self];
+ }
+}
+
+#pragma mark -
#pragma mark Task progress and notification methods
/**
@@ -3559,6 +3592,7 @@
[mySQLConnection setDelegate:nil];
if (_isConnected) [self closeConnection];
if ([[[SPQueryController sharedQueryController] window] isVisible]) [self toggleConsole:self];
+ if ([[[SPNavigatorController sharedNavigatorController] window] isVisible]) [self toggleNavigator:self];
[createTableSyntaxWindow orderOut:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}