aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableTriggers.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-02-13 22:41:23 +0000
committerrowanbeentje <rowan@beent.je>2011-02-13 22:41:23 +0000
commit352d61bb7de20b1aaafddebb9621ea0ef95f8480 (patch)
tree01102a0aa04d2565047a9284e0512d9409980cd8 /Source/SPTableTriggers.m
parent224719bd0ed05f6ce757c08c3602808929f621cf (diff)
downloadsequelpro-352d61bb7de20b1aaafddebb9621ea0ef95f8480.tar.gz
sequelpro-352d61bb7de20b1aaafddebb9621ea0ef95f8480.tar.bz2
sequelpro-352d61bb7de20b1aaafddebb9621ea0ef95f8480.zip
- Fix trigger deletion to use the correct trigger name
- Improve trigger deletion error process to show error sheets correctly - Fix spelling of "Statement" in interface - Tweak trigger column widths
Diffstat (limited to 'Source/SPTableTriggers.m')
-rw-r--r--Source/SPTableTriggers.m9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/SPTableTriggers.m b/Source/SPTableTriggers.m
index 6462a43f..f5c15db0 100644
--- a/Source/SPTableTriggers.m
+++ b/Source/SPTableTriggers.m
@@ -410,15 +410,16 @@ static const NSString *SPTriggerSQLMode = @"TriggerSQLMode";
while (row != NSNotFound)
{
- NSString *triggerName = [[triggerData objectAtIndex:row] objectForKey:@"trigger"];
+ NSString *triggerName = [[triggerData objectAtIndex:row] objectForKey:SPTriggerName];
NSString *query = [NSString stringWithFormat:@"DROP TRIGGER %@.%@", [database backtickQuotedString], [triggerName backtickQuotedString]];
[connection queryString:query];
if ([connection queryErrored]) {
+ [[alert window] orderOut:self];
SPBeginAlertSheet(NSLocalizedString(@"Unable to delete trigger", @"error deleting trigger message"),
NSLocalizedString(@"OK", @"OK button"),
- nil, nil, [NSApp mainWindow], nil, nil, nil,
+ nil, nil, [tableDocumentInstance parentWindow], nil, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"The selected trigger couldn't be deleted.\n\nMySQL said: %@", @"error deleting trigger informative message"), [connection getLastErrorMessage]]);
// Abort loop
@@ -564,7 +565,7 @@ static const NSString *SPTriggerSQLMode = @"TriggerSQLMode";
// Timin title is different then what we have saved in the database (case difference)
for (NSUInteger i = 0; i < [[triggerActionTimePopUpButton itemArray] count]; i++)
{
- if ([[[triggerActionTimePopUpButton itemTitleAtIndex:i] uppercaseString] isEqualToString:[[trigger objectForKey:@"timing"] uppercaseString]]) {
+ if ([[[triggerActionTimePopUpButton itemTitleAtIndex:i] uppercaseString] isEqualToString:[[trigger objectForKey:SPTriggerActionTime] uppercaseString]]) {
[triggerActionTimePopUpButton selectItemAtIndex:i];
break;
}
@@ -573,7 +574,7 @@ static const NSString *SPTriggerSQLMode = @"TriggerSQLMode";
// Event title is different then what we have saved in the database (case difference)
for (NSUInteger i = 0; i < [[triggerEventPopUpButton itemArray] count]; i++)
{
- if ([[[triggerEventPopUpButton itemTitleAtIndex:i] uppercaseString] isEqualToString:[[trigger objectForKey:@"event"] uppercaseString]]) {
+ if ([[[triggerEventPopUpButton itemTitleAtIndex:i] uppercaseString] isEqualToString:[[trigger objectForKey:SPTriggerEvent] uppercaseString]]) {
[triggerEventPopUpButton selectItemAtIndex:i];
break;
}