diff options
author | stuconnolly <stuart02@gmail.com> | 2010-07-07 22:02:13 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-07-07 22:02:13 +0000 |
commit | 2a1f907c897a4aa6970ed56cfc97e50307e4ea1a (patch) | |
tree | 38c6d9163aa71c030619a9e092e81a66e767f499 /Source/SPDatabaseDocument.m | |
parent | 2327652bf0e17a04d8f888835979580638beda84 (diff) | |
download | sequelpro-2a1f907c897a4aa6970ed56cfc97e50307e4ea1a.tar.gz sequelpro-2a1f907c897a4aa6970ed56cfc97e50307e4ea1a.tar.bz2 sequelpro-2a1f907c897a4aa6970ed56cfc97e50307e4ea1a.zip |
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.
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 21 |
1 files changed, 16 insertions, 5 deletions
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")]; - } + } } /** |