aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-23 19:33:06 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-23 19:33:06 +0000
commited2d754e46bd6a104f1b093b979720727e95dcb5 (patch)
tree7edc96255734d21fc886945b83d31a1000f43468 /Source/TableDocument.m
parente3dd3a976de60bb6dfcaf7643c376e574a6a3906 (diff)
downloadsequelpro-ed2d754e46bd6a104f1b093b979720727e95dcb5.tar.gz
sequelpro-ed2d754e46bd6a104f1b093b979720727e95dcb5.tar.bz2
sequelpro-ed2d754e46bd6a104f1b093b979720727e95dcb5.zip
• fixed several problems for alerting an error sheet inside of a didEndSelector: of an other sheet
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 0bf9613e..93b22cae 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -784,7 +784,12 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
[mySQLConnection queryString:[NSString stringWithFormat:@"DROP DATABASE %@", [[self database] backtickQuotedString]]];
if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""]) {
// error while deleting db
- NSBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Couldn't remove database.\nMySQL said: %@", @"message of panel when removing db failed"), [mySQLConnection getLastErrorMessage]]);
+ [self performSelector:@selector(showErrorSheetWith:)
+ withObject:[NSArray arrayWithObjects:NSLocalizedString(@"Error", @"error"),
+ [NSString stringWithFormat:NSLocalizedString(@"Couldn't remove database.\nMySQL said: %@", @"message of panel when removing db failed"),
+ [mySQLConnection getLastErrorMessage]],
+ nil]
+ afterDelay:0.3];
return;
}
@@ -797,6 +802,18 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
}
}
+/*
+ * Show Error sheet (can be called from inside of a endSheet selector)
+ * via [self performSelector:@selector(showErrorSheetWithTitle:) withObject: afterDelay:]
+ */
+-(void)showErrorSheetWith:(id)error
+{
+ // error := first object is the title , second the message, only one button OK
+ NSBeginAlertSheet([error objectAtIndex:0], NSLocalizedString(@"OK", @"OK button"),
+ nil, nil, tableWindow, self, nil, nil, nil,
+ [error objectAtIndex:1]);
+}
+
- (IBAction)connectSheetShowHelp:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.sequelpro.com/docs/Getting_Connected"]];