aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-07-27 00:43:43 +0000
committerrowanbeentje <rowan@beent.je>2011-07-27 00:43:43 +0000
commit189b2854d91b34a309ab93bfe4a06d1bd225a5b1 (patch)
tree9975bd858bca126628f7b6302f3b20cb8acc97fd
parentbf22d64062ed030d75fe0c69c8997d74ce072ff1 (diff)
downloadsequelpro-189b2854d91b34a309ab93bfe4a06d1bd225a5b1.tar.gz
sequelpro-189b2854d91b34a309ab93bfe4a06d1bd225a5b1.tar.bz2
sequelpro-189b2854d91b34a309ab93bfe4a06d1bd225a5b1.zip
- Prevent error bell when using the enter key to initiate a connection when keyboard focus is on the favorites outline view (Issue #1072)
- Don't initiate a connection when the currently selected favorite is clicked again slowly - Match compiler #ifdef around braces to imrpove Xcode 3 file parsing
-rw-r--r--Source/SPConnectionController.m6
-rw-r--r--Source/SPConnectionControllerDelegate.m3
-rw-r--r--Source/SPTextView.m6
3 files changed, 13 insertions, 2 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 50d42ee1..79dddba4 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -157,6 +157,7 @@
// Register double click for the favorites view (double click favorite to connect)
[favoritesTable setTarget:self];
+ [favoritesTable setDoubleAction:@selector(initiateConnection:)];
[favoritesTable registerForDraggedTypes:[NSArray arrayWithObject:favoritesPBoardType]];
[favoritesTable setDraggingSourceOperationMask:NSDragOperationMove forLocal:YES];
@@ -217,6 +218,11 @@
*/
- (IBAction)initiateConnection:(id)sender
{
+
+ // If this action was triggered via a double-click on the favorites outline view,
+ // ensure that one of the connections was double-clicked, not the area above or below
+ if (sender == favoritesTable && [favoritesTable clickedRow] <= 0) return;
+
// Ensure that host is not empty if this is a TCP/IP or SSH connection
if (([self type] == SPTCPIPConnection || [self type] == SPSSHTunnelConnection) && ![[self host] length]) {
SPBeginAlertSheet(NSLocalizedString(@"Insufficient connection details", @"insufficient details message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocument parentWindow], self, nil, nil, NSLocalizedString(@"Insufficient details provided to establish a connection. Please enter at least the hostname.", @"insufficient details informative message"));
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m
index ab4b4c27..85ddedab 100644
--- a/Source/SPConnectionControllerDelegate.m
+++ b/Source/SPConnectionControllerDelegate.m
@@ -200,11 +200,10 @@
/**
- * Double-Click opens the connection.
+ * Prevent editing of outline view rows
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
- if (!isConnecting) [self initiateConnection:self];
return NO;
}
@end
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index b08db401..3bcf72f5 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -2415,7 +2415,13 @@ NSInteger _alphabeticSort(id string1, id string2, void *reverse)
}
return;
}
+
+// Let Xcode 3 match braces correctly...
+#ifndef SP_REFACTOR
}
+#else
+ }
+#endif
// break down the undo grouping level for better undo behavior
[self breakUndoCoalescing];