From 2a1f907c897a4aa6970ed56cfc97e50307e4ea1a Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Wed, 7 Jul 2010 22:02:13 +0000 Subject: As the initial MySQL connection is now threaded, start the current tab's progress indicator to indicate that it's connecting in the event that the user switches to a different tab. Also preserve the tab's label as 'Connecting...' when switching tabs. --- Source/SPDatabaseDocument.m | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'Source/SPDatabaseDocument.m') diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 8492001f..d6c17b5e 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -2616,6 +2616,10 @@ if ([[[self fileURL] path] length] && ![self isUntitled]) pathName = [NSString stringWithFormat:@"%@ — ", [[[self fileURL] path] lastPathComponent]]; + if ([connectionController isConnecting]) { + return NSLocalizedString(@"Connecting…", @"window title string indicating that sp is connecting"); + } + if ([self getConnection] == nil) return [NSString stringWithFormat:@"%@%@", pathName, @"Sequel Pro"]; @@ -3793,10 +3797,16 @@ if ([[[self fileURL] path] length] && ![self isUntitled]) { pathName = [NSString stringWithFormat:@"%@ — ", [[[self fileURL] path] lastPathComponent]]; } - if (!_isConnected) { + + if ([connectionController isConnecting]) { + windowTitle = NSLocalizedString(@"Connecting…", @"window title string indicating that sp is connecting"); + tabTitle = windowTitle; + } + else if (!_isConnected) { windowTitle = [NSString stringWithFormat:@"%@%@", pathName, @"Sequel Pro"]; tabTitle = windowTitle; - } else { + } + else { windowTitle = [NSMutableString string]; tabTitle = [NSMutableString string]; @@ -3835,7 +3845,7 @@ [tabTitle appendString:[self table]]; } } - + // Set the titles [parentTabViewItem setLabel:tabTitle]; if ([parentWindowController selectedTableDocument] == self) { @@ -4381,11 +4391,12 @@ */ - (void)connectionControllerInitiatingConnection:(id)controller { - // Update the window title to indicate that we are try to establish a connection + // Update the window title to indicate that we are trying to establish a connection [parentTabViewItem setLabel:NSLocalizedString(@"Connecting…", @"window title string indicating that sp is connecting")]; + if ([parentWindowController selectedTableDocument] == self) { [parentWindow setTitle:NSLocalizedString(@"Connecting…", @"window title string indicating that sp is connecting")]; - } + } } /** -- cgit v1.2.3