aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPWindowController.m18
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m
index e9b73491..c097e711 100644
--- a/Source/SPWindowController.m
+++ b/Source/SPWindowController.m
@@ -160,14 +160,14 @@
*/
- (IBAction) closeTab:(id)sender
{
-
// Return if the selected tab shouldn't be closed
if (![selectedTableDocument parentTabShouldClose]) return;
// If there are multiple tabs, close the front tab.
if ([tabView numberOfTabViewItems] > 1) {
[tabView removeTabViewItem:[tabView selectedTabViewItem]];
- } else {
+ }
+ else {
[[self window] performClose:self];
}
}
@@ -572,6 +572,20 @@
}
/**
+ * Displays the current tab's context menu.
+ */
+- (NSMenu *)tabView:(NSTabView *)aTabView menuForTabViewItem:(NSTabViewItem *)tabViewItem
+{
+ NSMenu *menu = [[NSMenu alloc] init];
+
+ [menu addItemWithTitle:NSLocalizedString(@"Close Tab", @"close tab context menu item") action:@selector(closeTab:) keyEquivalent:@""];
+ [menu insertItem:[NSMenuItem separatorItem] atIndex:1];
+ [menu addItemWithTitle:NSLocalizedString(@"Open in New Tab", @"open connection in new tab context menu item") action:@selector(openDatabaseInNewTab:) keyEquivalent:@""];
+
+ return [menu autorelease];
+}
+
+/**
* When tab drags start, show all the tab bars. This allows adding tabs to windows
* containing only one tab - where the bar is normally hidden.
*/