mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
@@ -128,6 +128,19 @@
|
||||
}
|
||||
|
||||
- (void)open:(NSString *)path {
|
||||
NSArray *windows = [NSApp windows];
|
||||
int count = [windows count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
NSWindow *window = [windows objectAtIndex:i];
|
||||
if ([window isVisible] && ![window isExcludedFromWindowsMenu]) {
|
||||
AtomWindowController *controller = [window windowController];
|
||||
if ([path isEqualToString:controller.pathToOpen]) {
|
||||
[window makeKeyAndOrderFront:nil];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[[AtomWindowController alloc] initWithPath:path];
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ class AtomCefClient;
|
||||
@property (nonatomic, retain) IBOutlet NSSplitView *splitView;
|
||||
@property (nonatomic, retain) IBOutlet NSView *webView;
|
||||
@property (nonatomic, retain) IBOutlet NSView *devToolsView;
|
||||
@property (nonatomic, retain) NSString *pathToOpen;
|
||||
|
||||
- (id)initWithPath:(NSString *)path;
|
||||
- (id)initUnstableWithPath:(NSString *)path;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
@synthesize splitView=_splitView;
|
||||
@synthesize webView=_webView;
|
||||
@synthesize devToolsView=_devToolsView;
|
||||
@synthesize pathToOpen=_pathToOpen;
|
||||
|
||||
- (void)dealloc {
|
||||
[_splitView release];
|
||||
@@ -17,7 +18,7 @@
|
||||
[_bootstrapScript release];
|
||||
[_resourcePath release];
|
||||
[_pathToOpen release];
|
||||
|
||||
|
||||
_cefClient = NULL;
|
||||
_cefDevToolsClient = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user