diff options
author | rowanbeentje <rowan@beent.je> | 2010-07-19 22:26:22 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-07-19 22:26:22 +0000 |
commit | a5f4c3274ac06be78f78200ae486037e9b1a8910 (patch) | |
tree | 06e136ae385e81e8ce7afd1a73012ce96f82c4cd /Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | |
parent | fe499cde3cee2acf911273b7889a60160150c158 (diff) | |
download | sequelpro-a5f4c3274ac06be78f78200ae486037e9b1a8910.tar.gz sequelpro-a5f4c3274ac06be78f78200ae486037e9b1a8910.tar.bz2 sequelpro-a5f4c3274ac06be78f78200ae486037e9b1a8910.zip |
- Clean up SPDataImport, removing unused methods and cleaning up order and methods
- Improve error handling when the connecting dies during import (previous the sheet would stay open)
- Fix localised strings for error messages (label and text the wrong way round)
- Improve comments
Diffstat (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m')
-rw-r--r-- | Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index 143152d2..56073806 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -118,6 +118,7 @@ static BOOL sTruncateLongFieldInLogs = YES; serverVersionString = nil; mTimeZone = nil; isDisconnecting = NO; + userTriggeredDisconnect = NO; automaticReconnectAttempts = 0; pingFailureCount = 0; @@ -395,6 +396,7 @@ static BOOL sTruncateLongFieldInLogs = YES; } mConnected = YES; + userTriggeredDisconnect = NO; connectionStartTime = mach_absolute_time(); lastKeepAliveTime = 0; automaticReconnectAttempts = 0; @@ -598,6 +600,7 @@ static BOOL sTruncateLongFieldInLogs = YES; switch (failureDecision) { case MCPConnectionCheckDisconnect: [self setLastErrorMessage:NSLocalizedString(@"User triggered disconnection", @"User triggered disconnection")]; + userTriggeredDisconnect = YES; [reconnectionPool release]; return NO; default: @@ -619,6 +622,15 @@ static BOOL sTruncateLongFieldInLogs = YES; } /** + * Returns YES if the user chose to disconnect at the last "connection failure" + * prompt, NO otherwise. + */ +- (BOOL)userTriggeredDisconnect +{ + return userTriggeredDisconnect; +} + +/** * Checks if the connection to the server is still on. * If not, tries to reconnect (changing no parameters from the MYSQL pointer). * This method just uses mysql_ping(). @@ -670,6 +682,7 @@ static BOOL sTruncateLongFieldInLogs = YES; case MCPConnectionCheckDisconnect: if (mConnected) [self disconnect]; [self setLastErrorMessage:NSLocalizedString(@"User triggered disconnection", @"User triggered disconnection")]; + userTriggeredDisconnect = YES; return NO; // 'Retry' has been selected - return a recursive call. |