aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionDelegate.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-05-09 01:00:23 +0000
committerrowanbeentje <rowan@beent.je>2010-05-09 01:00:23 +0000
commit4144a5e1b78480fd86994a9c255c9a0fb98db48b (patch)
tree144569ffc18dea3b4b3feedf89b04753c1ef53c3 /Source/SPConnectionDelegate.m
parent1ba45688cf6b851a662429eb770ce4fcea93d1bf (diff)
downloadsequelpro-4144a5e1b78480fd86994a9c255c9a0fb98db48b.tar.gz
sequelpro-4144a5e1b78480fd86994a9c255c9a0fb98db48b.tar.bz2
sequelpro-4144a5e1b78480fd86994a9c255c9a0fb98db48b.zip
Rework alert sheets:
- Change MCPConnection.m to no longer use a reference to tableWindow to attach sheets - instead use a delate error display method if available - Rework TableSource and TableContent sheetDidEnd methods into per-task methods rather than overloading contextInfo - Rework SPAlertSheets to perform actions on the main thread, with the loss of (unused) support for a didDismissSelector. This addresses a number of crashes logged by the crash reporter
Diffstat (limited to 'Source/SPConnectionDelegate.m')
-rw-r--r--Source/SPConnectionDelegate.m13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/SPConnectionDelegate.m b/Source/SPConnectionDelegate.m
index ae67697c..258b4402 100644
--- a/Source/SPConnectionDelegate.m
+++ b/Source/SPConnectionDelegate.m
@@ -28,6 +28,7 @@
#import "SPQueryController.h"
#import "SPKeychain.h"
#import "SPConstants.h"
+#import "SPAlertSheets.h"
@implementation TableDocument (SPConnectionDelegate)
@@ -102,7 +103,7 @@
*/
- (void)noConnectionAvailable:(id)connection
{
- NSBeginAlertSheet(NSLocalizedString(@"No connection available", @"no connection available message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil, NSLocalizedString(@"An error has occured and there doesn't seem to be a connection available.", @"no connection available informatie message"));
+ SPBeginAlertSheet(NSLocalizedString(@"No connection available", @"no connection available message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, NSLocalizedString(@"An error has occured and there doesn't seem to be a connection available.", @"no connection available informatie message"));
}
/**
@@ -132,6 +133,16 @@
}
/**
+ * Invoke to display an informative but non-fatal error directly to the user.
+ */
+- (void)showErrorWithTitle:(NSString *)theTitle message:(NSString *)theMessage
+{
+ if ([tableWindow isVisible]) {
+ SPBeginAlertSheet(theTitle, NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, theMessage);
+ }
+}
+
+/**
* Invoked when user dismisses the error sheet displayed as a result of the current connection being lost.
*/
- (IBAction)closeErrorConnectionSheet:(id)sender