diff options
author | rowanbeentje <rowan@beent.je> | 2012-02-23 02:13:56 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-02-23 02:13:56 +0000 |
commit | 05f1612cbb7e33cf9135a346fc2505cc0e87e853 (patch) | |
tree | 785824be4e44a61389271343d958851fa4ff7dd0 /Source/SPConnectionDelegate.m | |
parent | a889340b9cb1eca0d3ff022e8e6e2c718480bf44 (diff) | |
download | sequelpro-05f1612cbb7e33cf9135a346fc2505cc0e87e853.tar.gz sequelpro-05f1612cbb7e33cf9135a346fc2505cc0e87e853.tar.bz2 sequelpro-05f1612cbb7e33cf9135a346fc2505cc0e87e853.zip |
Warning: this branch commit is largely untested, and known to throw exceptions as database structure retrieval is currently missing!
Further work on SPMySQLFramework integration:
- Improve SPMySQL framework build settings including correct ppc builds and a Distribution configuration for the build distributions to match
- Add new convenience querying and result methods to the framework
- Amend Sequel Pro source to use the new SPMySQL.framework methods everywhere, replacing MCPKit methods where they differ and improving some functions
- Remove MCPKit from the source
- Fix a number of warnings on Release-style builds
Diffstat (limited to 'Source/SPConnectionDelegate.m')
-rw-r--r-- | Source/SPConnectionDelegate.m | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/Source/SPConnectionDelegate.m b/Source/SPConnectionDelegate.m index 58482d1c..2936ba82 100644 --- a/Source/SPConnectionDelegate.m +++ b/Source/SPConnectionDelegate.m @@ -28,11 +28,12 @@ #import "SPQueryController.h" #import "SPKeychain.h" #import "SPAlertSheets.h" +#import "SPMySQLConstants.h" @implementation SPDatabaseDocument (SPConnectionDelegate) #pragma mark - -#pragma mark MCPKit connection delegate methods +#pragma mark SPMySQLConnection delegate methods /** * Invoked when the framework is about to perform a query. @@ -60,18 +61,9 @@ } /** - * Invoked when the framework is in the process of reconnecting to the server and needs to know - * which database to select. - */ -- (NSString *)onReconnectShouldSelectDatabase:(id)connection -{ - return selectedDatabase; -} - -/** * Invoked when the current connection needs a password from the Keychain. */ -- (NSString *)keychainPasswordForConnection:(MCPConnection *)connection +- (NSString *)keychainPasswordForConnection:(SPMySQLConnection *)connection { // If no keychain item is available, return an empty password @@ -89,8 +81,10 @@ /** * Invoked when the current connection needs a ssh password from the Keychain. + * This isn't actually part of the SPMySQLConnection delegate protocol, but is here + * due to its similarity to the previous method. */ -- (NSString *)keychainPasswordForSSHConnection:(MCPConnection *)connection +- (NSString *)keychainPasswordForSSHConnection:(SPMySQLConnection *)connection { // If no keychain item is available, return an empty password @@ -123,9 +117,9 @@ /** * Invoked when the connection fails and the framework needs to know how to proceed. */ -- (MCPConnectionCheck)connectionLost:(id)connection +- (SPMySQLConnectionLostDecision)connectionLost:(id)connection { - NSInteger connectionErrorCode = MCPConnectionCheckDisconnect; + NSInteger connectionErrorCode = SPMySQLConnectionLostDisconnect; // Only display the reconnect dialog if the window is visible if ([self parentWindow] && [[self parentWindow] isVisible]) { @@ -144,7 +138,7 @@ [connectionErrorDialog orderOut:nil]; // If 'disconnect' was selected, trigger a window close. - if (connectionErrorCode == MCPConnectionCheckDisconnect) { + if (connectionErrorCode == SPMySQLConnectionLostDisconnect) { [self performSelectorOnMainThread:@selector(closeAndDisconnect) withObject:nil waitUntilDone:YES]; } } @@ -179,7 +173,7 @@ _isConnected = NO; if ([[[self parentTabViewItem] tabView] numberOfTabViewItems] == 1) { [theParentWindow orderOut:self]; - [theParentWindow setAlphaValue:0.0]; + [theParentWindow setAlphaValue:0.0f]; [theParentWindow performSelector:@selector(close) withObject:nil afterDelay:1.0]; } else { [[[self parentTabViewItem] tabView] performSelector:@selector(removeTabViewItem:) withObject:[self parentTabViewItem] afterDelay:0.5]; |