aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TablesList.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-07-02 01:37:19 +0000
committerstuconnolly <stuart02@gmail.com>2009-07-02 01:37:19 +0000
commit80de4434635b34f459531547dc7670987d394b98 (patch)
tree9c5caf4524e5cf206e19e3ddf6f179e21f9ee6ea /Source/TablesList.m
parent633b7969c21612273fb1b27a1ddefdcc628576e4 (diff)
downloadsequelpro-80de4434635b34f459531547dc7670987d394b98.tar.gz
sequelpro-80de4434635b34f459531547dc7670987d394b98.tar.bz2
sequelpro-80de4434635b34f459531547dc7670987d394b98.zip
Restore the position of the buttons on the remove table and truncate table confirmation dialogs, but change the cancel button to the have key equivalent of return.
Diffstat (limited to 'Source/TablesList.m')
-rw-r--r--Source/TablesList.m20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/TablesList.m b/Source/TablesList.m
index ae438dec..ec330d9a 100644
--- a/Source/TablesList.m
+++ b/Source/TablesList.m
@@ -328,10 +328,16 @@
[tableWindow endEditingFor:nil];
- NSAlert *alert = [NSAlert alertWithMessageText:@"" defaultButton:NSLocalizedString(@"Cancel", @"cancel button") alternateButton:NSLocalizedString(@"Delete", @"delete button") otherButton:nil informativeTextWithFormat:@""];
+ NSAlert *alert = [NSAlert alertWithMessageText:@"" defaultButton:NSLocalizedString(@"Delete", @"delete button") alternateButton:NSLocalizedString(@"Cancel", @"cancel button") otherButton:nil informativeTextWithFormat:@""];
[alert setAlertStyle:NSCriticalAlertStyle];
+ NSArray *buttons = [alert buttons];
+
+ // Change the alert's cancel button to have the key equivalent of return
+ [[buttons objectAtIndex:0] setKeyEquivalent:@""];
+ [[buttons objectAtIndex:1] setKeyEquivalent:@"\r"];
+
NSIndexSet *indexes = [tablesListView selectedRowIndexes];
NSString *tblTypes;
@@ -679,10 +685,16 @@
[tableWindow endEditingFor:nil];
- NSAlert *alert = [NSAlert alertWithMessageText:@"" defaultButton:NSLocalizedString(@"Cancel", @"cancel button") alternateButton:NSLocalizedString(@"Truncate", @"truncate button") otherButton:nil informativeTextWithFormat:@""];
+ NSAlert *alert = [NSAlert alertWithMessageText:@"" defaultButton:NSLocalizedString(@"Truncate", @"truncate button") alternateButton:NSLocalizedString(@"Cancel", @"cancel button") otherButton:nil informativeTextWithFormat:@""];
[alert setAlertStyle:NSCriticalAlertStyle];
+ NSArray *buttons = [alert buttons];
+
+ // Change the alert's cancel button to have the key equivalent of return
+ [[buttons objectAtIndex:0] setKeyEquivalent:@""];
+ [[buttons objectAtIndex:1] setKeyEquivalent:@"\r"];
+
if ([tablesListView numberOfSelectedRows] == 1) {
[alert setMessageText:[NSString stringWithFormat:NSLocalizedString(@"Truncate table '%@'?", @"truncate table message"), [tables objectAtIndex:[tablesListView selectedRow]]]];
[alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Are you sure you want to delete ALL records in the table '%@'. This operation cannot be undone.", @"truncate table informative message"), [tables objectAtIndex:[tablesListView selectedRow]]]];
@@ -708,14 +720,14 @@
else if ([contextInfo isEqualToString:@"removeRow"]) {
[[sheet window] orderOut:nil];
- if (returnCode == NSAlertAlternateReturn) {
+ if (returnCode == NSAlertDefaultReturn) {
[self removeTable];
}
}
else if ([contextInfo isEqualToString:@"truncateTable"]) {
[[sheet window] orderOut:nil];
- if (returnCode == NSAlertAlternateReturn) {
+ if (returnCode == NSAlertDefaultReturn) {
[self truncateTable];
}
}