mirror of
https://github.com/atom/atom.git
synced 2026-02-10 22:55:09 -05:00
Multiple windows can be opened, and their buffer state is saved.
This commit is contained in:
@@ -22,8 +22,10 @@
|
||||
}
|
||||
|
||||
- (id)initWithPath:(NSString *)aPath {
|
||||
aPath = aPath ? aPath : @"/tmp";
|
||||
|
||||
self = [super initWithWindowNibName:@"AtomWindow"];
|
||||
[self setPath:[aPath stringByStandardizingPath]];
|
||||
path = [[aPath stringByStandardizingPath] retain];
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -31,6 +33,8 @@
|
||||
- (void)windowDidLoad {
|
||||
[super windowDidLoad];
|
||||
|
||||
[self.window setDelegate:self];
|
||||
|
||||
[webView setUIDelegate:self];
|
||||
|
||||
[self setShouldCascadeWindows:YES];
|
||||
@@ -45,11 +49,6 @@
|
||||
[[webView mainFrame] loadRequest:request];
|
||||
}
|
||||
|
||||
- (void)close {
|
||||
[(AtomApp *)NSApp removeController:self];
|
||||
[super close];
|
||||
}
|
||||
|
||||
- (NSString *)tempfile {
|
||||
char *directory = "/tmp";
|
||||
char *prefix = "temp-file";
|
||||
@@ -60,9 +59,15 @@
|
||||
return tmpPathString;
|
||||
}
|
||||
|
||||
// WebUIDelegate Protocol
|
||||
// WebUIDelegate
|
||||
- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems {
|
||||
return defaultMenuItems;
|
||||
}
|
||||
|
||||
// WindowDelegate
|
||||
- (BOOL)windowShouldClose:(id)sender {
|
||||
[(AtomApp *)NSApp removeController:self];
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user