"New Window" item on Dock menu activates MacVim

This commit is contained in:
Bjorn Winckler
2008-08-10 16:50:02 +02:00
parent 0fae0b0238
commit 85c6b71293
5 changed files with 22 additions and 3 deletions
+2
View File
@@ -17,6 +17,8 @@
<string>id</string>
<key>newWindow</key>
<string>id</string>
<key>newWindowAndActivate</key>
<string>id</string>
<key>openWebsite</key>
<string>id</string>
<key>orderFrontPreferencePanel</key>
+1 -3
View File
@@ -9,9 +9,7 @@
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>218</integer>
</array>
<array/>
<key>IBSystem Version</key>
<string>9E17</string>
<key>targetFramework</key>
Binary file not shown.
+2
View File
@@ -27,6 +27,7 @@
NSMenuItem *recentFilesMenuItem;
NSMutableArray *cachedVimControllers;
int preloadPid;
BOOL shouldActivateWhenNextWindowOpens;
#ifdef MM_ENABLE_PLUGINS
NSMenuItem *plugInMenuItem;
@@ -50,6 +51,7 @@
- (void)setPreloadCacheSize:(int)size;
- (IBAction)newWindow:(id)sender;
- (IBAction)newWindowAndActivate:(id)sender;
- (IBAction)fileOpen:(id)sender;
- (IBAction)selectNextWindow:(id)sender;
- (IBAction)selectPreviousWindow:(id)sender;
+17
View File
@@ -110,6 +110,7 @@ static int executeInLoginShell(NSString *path, NSArray *args);
- (void)clearPreloadCacheWithCount:(int)count;
- (NSDate *)rcFilesModificationDate;
- (BOOL)openVimControllerWithArguments:(NSDictionary *)arguments;
- (void)activateWhenNextWindowOpens;
#ifdef MM_ENABLE_PLUGINS
- (void)removePlugInMenu;
@@ -724,6 +725,11 @@ static int executeInLoginShell(NSString *path, NSArray *args);
[openSelectionString release];
openSelectionString = nil;
}
if (shouldActivateWhenNextWindowOpens) {
[NSApp activateIgnoringOtherApps:YES];
shouldActivateWhenNextWindowOpens = NO;
}
}
- (void)setMainMenu:(NSMenu *)mainMenu
@@ -849,6 +855,12 @@ static int executeInLoginShell(NSString *path, NSArray *args);
}
}
- (IBAction)newWindowAndActivate:(id)sender
{
[self activateWhenNextWindowOpens];
[self newWindow:sender];
}
- (IBAction)fileOpen:(id)sender
{
NSString *dir = nil;
@@ -1583,6 +1595,11 @@ static int executeInLoginShell(NSString *path, NSArray *args);
return YES;
}
- (void)activateWhenNextWindowOpens
{
shouldActivateWhenNextWindowOpens = YES;
}
@end // MMAppController (Private)