From b57ad98e4fc5efca2b96d759936a852e7ee68630 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Fri, 18 Jun 2010 09:52:15 +0000 Subject: =?UTF-8?q?=E2=80=A2=20simplified=20and=20unified=20tab=20tooltips?= =?UTF-8?q?=20=E2=80=A2=20added=20tooltips=20for=20tab's=20overflow=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPDatabaseDocument.m | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'Source/SPDatabaseDocument.m') diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 6b2b22f1..d76479b3 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -2583,6 +2583,37 @@ } +/** + * Returns the full window title which is mainly used for tab tooltips + */ +- (NSString *)tabTitleForTooltip +{ + NSMutableString *tabTitle; + + // Determine name details + NSString *pathName = @""; + if ([[[self fileURL] path] length] && ![self isUntitled]) + pathName = [NSString stringWithFormat:@"%@ — ", [[[self fileURL] path] lastPathComponent]]; + + if ([self getConnection] == nil) + return [NSString stringWithFormat:@"%@%@", pathName, @"Sequel Pro"]; + + tabTitle = [NSMutableString string]; + + // Add the MySQL version to the window title if enabled in prefs + if ([prefs boolForKey:SPDisplayServerVersionInWindowTitle]) [tabTitle appendFormat:@"(MySQL %@)\n", [self mySQLVersion]]; + + [tabTitle appendString:[self name]]; + if ([self database]) { + if ([tabTitle length]) [tabTitle appendString:@"/"]; + [tabTitle appendString:[self database]]; + } + if ([[self table] length]) { + if ([tabTitle length]) [tabTitle appendString:@"/"]; + [tabTitle appendString:[self table]]; + } + return tabTitle; +} /** * Returns the currently selected database */ -- cgit v1.2.3