Skip to content

Commit

Permalink
can use the return key to start a search in the find tab #100
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Lebel committed Nov 5, 2014
1 parent 71f8064 commit b9459e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Just build it, it should work (but let me know if you have an errors or warnings
- Better display of name connections in the main window [issue #72](https://github.com/jeromelebel/MongoHub-Mac/issues/72)
- Reopen the main window when coming back to the application (if closed) [issue #76](https://github.com/jeromelebel/MongoHub-Mac/issues/76)
- Add a dock menu (with all the connections)
- Can use return key to start a search in the find tab [issue #100](https://github.com/jeromelebel/MongoHub-Mac/issues/100)

**3.1 Beta**

Expand Down
5 changes: 0 additions & 5 deletions Sources/ConnectionWindow/MHQueryViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@
- (void)jsonWindowWillClose:(id)sender;
@end

@interface MHQueryViewController (FindTab)
- (void)findQueryComposer;

@end

@interface MHQueryViewController (InsertTab)
- (IBAction)insertQuery:(id)sender;

Expand Down
15 changes: 15 additions & 0 deletions Sources/ConnectionWindow/MHQueryViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ - (void)selectBestTextField;

@end

@interface MHQueryViewController (FindTab)
- (IBAction)findQuery:(id)sender;
- (void)findQueryComposer;

@end

@interface MHQueryViewController (UpdateTab)
- (IBAction)updateAddOperatorAction:(id)sender;
- (IBAction)updateQueryComposer:(id)sender;
Expand Down Expand Up @@ -346,6 +352,15 @@ - (void)controlTextDidChange:(NSNotification *)notification

}

-(void)controlTextDidEndEditing:(NSNotification *)notification
{
NSTextField *textField = notification.object;

if ((textField == self.findCriteriaComboBox || textField == self.findFieldFilterTextField || textField == self.findSortTextField || textField == self.findSkipTextField || textField == self.findLimitTextField) && [notification.userInfo[@"NSTextMovement"] intValue] == NSReturnTextMovement ) {
[self findQuery:nil];
}
}

- (void)showEditWindow:(id)sender
{
for (NSDictionary *document in self.findResultsViewController.selectedDocuments) {
Expand Down

0 comments on commit b9459e7

Please sign in to comment.