mirror of
https://github.com/ksherlock/ample.git
synced 2025-02-20 16:29:07 +00:00
move first responder resignation code to a function.
This commit is contained in:
parent
afc3ac608a
commit
5af5e2e300
@ -594,11 +594,15 @@ static NSString *ShellQuote(NSString *s) {
|
||||
//return [super validateMenuItem: menuItem]; // not implemented?
|
||||
}
|
||||
|
||||
-(void)defocus {
|
||||
[[self window] makeFirstResponder: nil]; // in case text is being edited...
|
||||
}
|
||||
|
||||
# pragma mark - IBActions
|
||||
|
||||
- (IBAction)launchAction:(id)sender {
|
||||
|
||||
[[self window] makeFirstResponder: nil]; // in case text is being edited...
|
||||
[self defocus];
|
||||
if (![_args count]) return;
|
||||
|
||||
[LogWindowController controllerForArgs: _args];
|
||||
@ -608,7 +612,7 @@ static NSString *ShellQuote(NSString *s) {
|
||||
|
||||
- (IBAction)listMedia:(id)sender {
|
||||
|
||||
[[self window] makeFirstResponder: nil]; // in case text is being edited...
|
||||
[self defocus];
|
||||
if (!_machine) return;
|
||||
|
||||
NSMutableArray *argv = [NSMutableArray new];
|
||||
@ -635,7 +639,7 @@ static NSString *ShellQuote(NSString *s) {
|
||||
|
||||
- (IBAction)listSlots:(id)sender {
|
||||
|
||||
[[self window] makeFirstResponder: nil]; // in case text is being edited...
|
||||
[self defocus];
|
||||
if (!_machine) return;
|
||||
|
||||
NSMutableArray *argv = [NSMutableArray new];
|
||||
@ -935,7 +939,7 @@ static NSString *ShellQuote(NSString *s) {
|
||||
|
||||
-(NSDictionary *)makeBookmark {
|
||||
|
||||
[[self window] makeFirstResponder: nil];
|
||||
[self defocus];
|
||||
|
||||
NSMutableDictionary *dict = [NSMutableDictionary new];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user