diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/TableDocument.h | 3 | ||||
-rw-r--r-- | Source/TableDocument.m | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/Source/TableDocument.h b/Source/TableDocument.h index 52429c7b..61b770c3 100644 --- a/Source/TableDocument.h +++ b/Source/TableDocument.h @@ -203,6 +203,9 @@ - (void)willQueryString:(NSString *)query; - (void)queryGaveError:(NSString *)error; +// Connection sheet delegate methods +- (void) controlTextDidChange:(NSNotification *)aNotification; + //splitView delegate methods - (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview; - (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)offset; diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 10ef7dca..6fae3a0b 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -1515,6 +1515,22 @@ invoked when query gave an error [self showErrorInConsole:[NSString stringWithFormat:@"/* ERROR %@ */ %@;\n", currentTime, error]]; } +#pragma mark Connection sheet delegate methods + +/** + * When a favorite is selected, and the connection details are edited, deselect the favorite; + * this is clearer and also prevents a failed connection from being repopulated with the + * favorite's details instead of the last used details. + * This method allows the password to be changed without altering the selection. + */ +- (void) controlTextDidChange:(NSNotification *)aNotification +{ + if ([aNotification object] == hostField || [aNotification object] == userField || [aNotification object] == databaseField + || [aNotification object] == socketField || [aNotification object] == portField) { + [favoritesController setSelectionIndexes:[NSIndexSet indexSet]]; + } +} + #pragma mark SplitView delegate methods /** |