aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-11-11 01:27:55 +0000
committerstuconnolly <stuart02@gmail.com>2009-11-11 01:27:55 +0000
commitd62547eb8bd1391f25529b104e9f6eef3f3e7a70 (patch)
tree395c9bb419d6028399667250bcab3e7a8252a742 /Frameworks
parentae2abb7fb1a1f902939ca3d419f1f81cb95726f1 (diff)
downloadsequelpro-d62547eb8bd1391f25529b104e9f6eef3f3e7a70.tar.gz
sequelpro-d62547eb8bd1391f25529b104e9f6eef3f3e7a70.tar.bz2
sequelpro-d62547eb8bd1391f25529b104e9f6eef3f3e7a70.zip
The framework shouldn't be displaying dialogs, get the delegate to do it.
Diffstat (limited to 'Frameworks')
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h1
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m10
2 files changed, 8 insertions, 3 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
index a49112b0..548425e1 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
@@ -65,6 +65,7 @@ static inline NSData* NSStringDataUsingLossyEncoding(NSString* self, NSInteger e
- (NSString *)keychainPasswordForConnection:(id)connection;
- (NSString *)onReconnectShouldSelectDatabase:(id)connection;
- (NSString *)onReconnectShouldUseEncoding:(id)connection;
+- (void)noConnectionAvailable:(id)connection;
- (MCPConnectionCheck)connectionLost:(id)connection;
@end
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
index 456b615d..e55568d5 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
@@ -1266,11 +1266,15 @@ void performThreadedKeepAlive(void *ptr)
if (!mConnected) {
// Write a log entry
if ([delegate respondsToSelector:@selector(queryGaveError:connection:)]) [delegate queryGaveError:@"No connection available!" connection:self];
+
// Notify that the query has been performed
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:delegate];
- // Show an error alert while resetting
- NSBeginAlertSheet(NSLocalizedString(@"Error", @"error"), @"No connection available!",
- nil, nil, [delegate valueForKeyPath:@"tableWindow"], self, nil, nil, nil, @"No connection available!");
+
+ // Inform the delegate that there is no connection available
+ if (delegate && [delegate respondsToSelector:@selector(noConnectionAvailable:)]) {
+ [delegate noConnectionAvailable:self];
+ }
+
return nil;
}