aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-06-18 09:52:15 +0000
committerBibiko <bibiko@eva.mpg.de>2010-06-18 09:52:15 +0000
commitb57ad98e4fc5efca2b96d759936a852e7ee68630 (patch)
treee7f58be5ffa235282d65ea0da9b615da6d0f9377 /Source/SPDatabaseDocument.m
parentf4957e259b41f2ce4f1eaac6e0f75b82d34995b7 (diff)
downloadsequelpro-b57ad98e4fc5efca2b96d759936a852e7ee68630.tar.gz
sequelpro-b57ad98e4fc5efca2b96d759936a852e7ee68630.tar.bz2
sequelpro-b57ad98e4fc5efca2b96d759936a852e7ee68630.zip
• simplified and unified tab tooltips
• added tooltips for tab's overflow menu
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m31
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 6b2b22f1..d76479b3 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -2584,6 +2584,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
*/
- (NSString *)database