aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPNavigatorController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-05-23 21:44:59 +0000
committerrowanbeentje <rowan@beent.je>2010-05-23 21:44:59 +0000
commitc661b409eaa0e29d9e012b79e7a66574a554817a (patch)
tree49b310ded9a226a66aa53444c9ba112824854f68 /Source/SPNavigatorController.m
parentb66006f3755c6a57dfc60d4133bc4dc4da0fef56 (diff)
downloadsequelpro-c661b409eaa0e29d9e012b79e7a66574a554817a.tar.gz
sequelpro-c661b409eaa0e29d9e012b79e7a66574a554817a.tar.bz2
sequelpro-c661b409eaa0e29d9e012b79e7a66574a554817a.zip
Initial implementation of tabs:
- Addition of PSMTabBar framework - Rework away from a document-based TableDocument - Support tabs throughout the application - Add menu items for creating tabs, and add support for dragging tabs to different windows
Diffstat (limited to 'Source/SPNavigatorController.m')
-rw-r--r--Source/SPNavigatorController.m15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m
index 8261ec2b..7e2ae14d 100644
--- a/Source/SPNavigatorController.m
+++ b/Source/SPNavigatorController.m
@@ -326,8 +326,8 @@ static SPNavigatorController *sharedNavigatorController = nil;
// Detect if more than one connection windows with the connectionID are open.
// If so, don't remove it.
- if ([[[NSDocumentController sharedDocumentController] documents] count]) {
- for(id doc in [[NSDocumentController sharedDocumentController] documents]) {
+ if ([[NSApp delegate] frontDocument]) {
+ for(id doc in [[NSApp delegate] orderedDocuments]) {
if(![[doc valueForKeyPath:@"mySQLConnection"] isConnected]) continue;
if([[doc connectionID] isEqualToString:connectionID])
docCounter++;
@@ -384,7 +384,7 @@ static SPNavigatorController *sharedNavigatorController = nil;
NSArray *pathArray = [[[parentKeys objectAtIndex:0] description] componentsSeparatedByString:SPUniqueSchemaDelimiter];
if([pathArray count] > 1) {
- TableDocument *doc = [[NSDocumentController sharedDocumentController] currentDocument];
+ TableDocument *doc = [[NSApp delegate] frontDocument];
if([doc isWorking]) {
[SPTooltip showWithObject:NSLocalizedString(@"Active connection window is busy. Please wait and try again.", @"active connection window is busy. please wait and try again. tooltip")
atLocation:pos
@@ -432,7 +432,7 @@ static SPNavigatorController *sharedNavigatorController = nil;
}
- if (doc && [doc isKindOfClass:[TableDocument class]] && [[[NSDocumentController sharedDocumentController] documents] count]) {
+ if (doc && [doc isKindOfClass:[TableDocument class]]) {
id theConnection = [doc valueForKeyPath:@"mySQLConnection"];
@@ -585,8 +585,7 @@ static SPNavigatorController *sharedNavigatorController = nil;
{
// Reset everything for current active doc connection
- if (![[[NSDocumentController sharedDocumentController] documents] count]) return;
- id doc = [[NSDocumentController sharedDocumentController] currentDocument];
+ id doc = [[NSApp delegate] frontDocument];
if(!doc) return;
NSString *connectionID = [doc connectionID];
if(!connectionID || [connectionID length] < 2) return;
@@ -743,8 +742,8 @@ static SPNavigatorController *sharedNavigatorController = nil;
[searchField setStringValue:@""];
}
- if ([[[NSDocumentController sharedDocumentController] documents] count]) {
- TableDocument *doc = [[NSDocumentController sharedDocumentController] currentDocument];
+ TableDocument *doc = [[NSApp delegate] frontDocument];
+ if (doc) {
NSMutableString *key = [NSMutableString string];
[key setString:[doc connectionID]];
if([doc database] && [(NSString*)[doc database] length]){