diff --git a/Atom/Classes/AtomApp.h b/Atom/Classes/AtomApp.h index 3aa222d09..2afbdcf74 100644 --- a/Atom/Classes/AtomApp.h +++ b/Atom/Classes/AtomApp.h @@ -7,5 +7,6 @@ @property (nonatomic, retain) NSMutableArray *controllers; - (void)removeController:(AtomController *)controller; +- (IBAction)runSpecs:(id)sender; @end diff --git a/Atom/Classes/AtomApp.m b/Atom/Classes/AtomApp.m index aa28e76ec..d02ca5e8e 100644 --- a/Atom/Classes/AtomApp.m +++ b/Atom/Classes/AtomApp.m @@ -16,9 +16,8 @@ [self.controllers addObject:controller]; } -- (AtomController *)createSpecController { - AtomController *controller = [[AtomController alloc] initForSpecs]; - return controller; +- (IBAction)runSpecs:(id)sender { + [[AtomController alloc] initForSpecs]; } - (void)removeController:(AtomController *)controller { @@ -36,23 +35,12 @@ - (void) sendEvent: (NSEvent *)event { // Default implementation for key down tries key equivalents first // We want to wait until the web view handles the event, then allow key equivalents to be tried - if ([event type] != NSKeyDown) { + if (([event type] != NSKeyDown) || !event.window) { [super sendEvent:event]; return; } - - // TODO(NS): Make running specs a menu command with a key equivalent, so we can delete this code - BOOL shouldRunSpecs = - ([event type] == NSKeyDown) && - ([event modifierFlags] & (NSAlternateKeyMask | NSControlKeyMask | NSCommandKeyMask)) && - [[event charactersIgnoringModifiers] hasPrefix:@"s"]; - - if (shouldRunSpecs) { - [self createSpecController]; - return; - } - - [[event window] sendEvent:event]; + + [event.window sendEvent:event]; } - (void)terminate:(id)sender { @@ -72,7 +60,7 @@ } - (void)applicationDidFinishLaunching:(NSNotification *)notification { - [self createSpecController]; + [self runSpecs:self]; } @end diff --git a/Atom/en.lproj/MainMenu.xib b/Atom/en.lproj/MainMenu.xib index 5e498d5e1..b9b2b4dd8 100644 --- a/Atom/en.lproj/MainMenu.xib +++ b/Atom/en.lproj/MainMenu.xib @@ -2,10 +2,10 @@ 1070 - 11C74 + 11B26 1938 - 1138.23 - 567.00 + 1138 + 566.00 com.apple.InterfaceBuilder.CocoaPlugin 1938 @@ -61,6 +61,15 @@ + + + Run Specs + s + 1835008 + 2147483647 + + + YES @@ -753,6 +762,14 @@ 536 + + + runSpecs: + + + + 541 + print: @@ -1398,6 +1415,7 @@ + @@ -1632,6 +1650,11 @@ + + 537 + + + @@ -1704,6 +1727,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1722,13 +1746,24 @@ - 536 + 541 AtomApp NSApplication + + runSpecs: + id + + + runSpecs: + + runSpecs: + id + + IBProjectSource ./Classes/AtomApp.h @@ -1775,6 +1810,24 @@ ./Classes/NSDocument.h + + WebView + + reloadFromOrigin: + id + + + reloadFromOrigin: + + reloadFromOrigin: + id + + + + IBProjectSource + ./Classes/WebView.h + + 0