mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Move "Go to Tab" to the Window menu and rename to "Select Tab"
Also edit the source to reflect the change in name (e.g., `updateGoToMenu:` → `updateSelectTabMenu:`).
This commit is contained in:
committed by
Allan Odgaard
parent
91befc271b
commit
e452a5ee55
@@ -1040,9 +1040,6 @@ CQ
|
||||
<action selector="goToRelatedFile:" target="-1" id="305"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Go to Tab" id="383">
|
||||
<menu key="submenu" title="Go to Tab" id="384"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="440"/>
|
||||
<menuItem title="Back" id="545">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
@@ -1159,6 +1156,9 @@ CQ
|
||||
<action selector="selectPreviousTab:" target="-1" id="337"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select Tab" id="383" userLabel="Select Tab">
|
||||
<menu key="submenu" title="Select Tab" id="384"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="333">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
@@ -1260,7 +1260,7 @@ DQ
|
||||
</window>
|
||||
<customObject id="581" customClass="OakSubmenuController">
|
||||
<connections>
|
||||
<outlet property="goToMenu" destination="384" id="593"/>
|
||||
<outlet property="selectTabMenu" destination="384" id="593"/>
|
||||
<outlet property="marksMenu" destination="595" id="597"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
|
||||
@@ -426,7 +426,7 @@ static NSTextField* OakCreateTextField ()
|
||||
|
||||
// ====================
|
||||
|
||||
- (void)updateGoToMenu:(NSMenu*)aMenu
|
||||
- (void)updateSelectTabMenu:(NSMenu*)aMenu
|
||||
{
|
||||
if(![[self window] isKeyWindow])
|
||||
{
|
||||
|
||||
@@ -323,7 +323,7 @@ static NSUInteger const kOakSourceIndexFavorites = 1;
|
||||
self.sourceIndex = [sender tag];
|
||||
}
|
||||
|
||||
- (void)updateGoToMenu:(NSMenu*)aMenu
|
||||
- (void)updateSelectTabMenu:(NSMenu*)aMenu
|
||||
{
|
||||
if(self.window.isKeyWindow)
|
||||
{
|
||||
|
||||
@@ -2261,11 +2261,11 @@ namespace
|
||||
[self openItems:@[ @{ @"path" : path } ] closingOtherTabs:NO];
|
||||
}
|
||||
|
||||
// ===========================
|
||||
// = Go to Tab Menu Delegate =
|
||||
// ===========================
|
||||
// ============================
|
||||
// = Select Tab Menu Delegate =
|
||||
// ============================
|
||||
|
||||
- (void)updateGoToMenu:(NSMenu*)aMenu
|
||||
- (void)updateSelectTabMenu:(NSMenu*)aMenu
|
||||
{
|
||||
if(![self.window isKeyWindow])
|
||||
{
|
||||
|
||||
@@ -562,9 +562,9 @@ NSString* const FFFindWasTriggeredByEnter = @"FFFindWasTriggeredByEnter";
|
||||
_windowController.statusString = [NSString stringWithFormat:fmt, [_documentSearch searchString], [NSNumberFormatter localizedStringFromNumber:@(self.countOfMatches) numberStyle:NSNumberFormatterDecimalStyle]];
|
||||
}
|
||||
|
||||
// ==================
|
||||
// = Go to… Submenu =
|
||||
// ==================
|
||||
// =======================
|
||||
// = Select Tab… Submenu =
|
||||
// =======================
|
||||
|
||||
- (IBAction)takeSelectedPathFrom:(id)sender
|
||||
{
|
||||
@@ -573,7 +573,7 @@ NSString* const FFFindWasTriggeredByEnter = @"FFFindWasTriggeredByEnter";
|
||||
[_windowController.resultsViewController showResultNode:item.firstResultNode];
|
||||
}
|
||||
|
||||
- (void)updateGoToMenu:(NSMenu*)aMenu
|
||||
- (void)updateSelectTabMenu:(NSMenu*)aMenu
|
||||
{
|
||||
if(self.countOfMatches == 0)
|
||||
{
|
||||
|
||||
@@ -329,7 +329,7 @@ static NSButton* OakCreateStopSearchButton ()
|
||||
- (void)menuNeedsUpdate:(NSMenu*)aMenu
|
||||
{
|
||||
[aMenu removeAllItems];
|
||||
[NSApp sendAction:@selector(updateGoToMenu:) to:nil from:aMenu];
|
||||
[NSApp sendAction:@selector(updateSelectTabMenu:) to:nil from:aMenu];
|
||||
}
|
||||
|
||||
- (NSDictionary*)allViews
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
@interface OakSubmenuController : NSObject <NSMenuDelegate>
|
||||
{
|
||||
IBOutlet NSMenu* goToMenu;
|
||||
IBOutlet NSMenu* selectTabMenu;
|
||||
IBOutlet NSMenu* marksMenu;
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -25,7 +25,7 @@ OAK_DEBUG_VAR(OakSubmenuController);
|
||||
@implementation OakSubmenuController
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[goToMenu setDelegate:self];
|
||||
[selectTabMenu setDelegate:self];
|
||||
[marksMenu setDelegate:self];
|
||||
}
|
||||
|
||||
@@ -40,14 +40,14 @@ OAK_DEBUG_VAR(OakSubmenuController);
|
||||
|
||||
- (void)menuNeedsUpdate:(NSMenu*)aMenu
|
||||
{
|
||||
[self updateMenu:aMenu withSelector:aMenu == goToMenu ? @selector(updateGoToMenu:) : @selector(updateBookmarksMenu:)];
|
||||
[self updateMenu:aMenu withSelector:aMenu == selectTabMenu ? @selector(updateSelectTabMenu:) : @selector(updateBookmarksMenu:)];
|
||||
}
|
||||
|
||||
- (BOOL)menuHasKeyEquivalent:(NSMenu*)aMenu forEvent:(NSEvent*)anEvent target:(id*)anId action:(SEL*)aSEL
|
||||
{
|
||||
D(DBF_OakSubmenuController, bug("%s %s\n", to_s(anEvent).c_str(), [[aMenu description] UTF8String]););
|
||||
|
||||
if(aMenu != goToMenu)
|
||||
if(aMenu != selectTabMenu)
|
||||
return NO;
|
||||
|
||||
std::string const eventString = to_s(anEvent);
|
||||
@@ -55,7 +55,7 @@ OAK_DEBUG_VAR(OakSubmenuController);
|
||||
return NO;
|
||||
|
||||
NSMenu* dummy = [NSMenu new];
|
||||
[self updateMenu:dummy withSelector:@selector(updateGoToMenu:)];
|
||||
[self updateMenu:dummy withSelector:@selector(updateSelectTabMenu:)];
|
||||
for(NSMenuItem* item in [dummy itemArray])
|
||||
{
|
||||
if(eventString == ns::create_event_string(item.keyEquivalent, item.keyEquivalentModifierMask))
|
||||
|
||||
@@ -682,7 +682,7 @@ static path::glob_list_t globs_for_path (std::string const& path)
|
||||
self.path = [_path stringByDeletingLastPathComponent];
|
||||
}
|
||||
|
||||
- (void)updateGoToMenu:(NSMenu*)aMenu
|
||||
- (void)updateSelectTabMenu:(NSMenu*)aMenu
|
||||
{
|
||||
if(self.window.isKeyWindow)
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ OAK_DEBUG_VAR(Preferences);
|
||||
[self.windowController selectControllerAtIndex:index];
|
||||
}
|
||||
|
||||
- (void)updateGoToMenu:(NSMenu*)aMenu
|
||||
- (void)updateSelectTabMenu:(NSMenu*)aMenu
|
||||
{
|
||||
if(![self.windowController.window isKeyWindow])
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user