aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-04-17 18:19:32 +0000
committerstuconnolly <stuart02@gmail.com>2009-04-17 18:19:32 +0000
commit6646f022ec631d24afe58e8fbe4a7824f4a9c498 (patch)
tree1582920aa2805a8b6f8751eee94eaa26fbfe1edc /Source/TableDocument.m
parent0be6e77f9b561db628c9ea5b8ddaef4f165d6b7c (diff)
downloadsequelpro-6646f022ec631d24afe58e8fbe4a7824f4a9c498.tar.gz
sequelpro-6646f022ec631d24afe58e8fbe4a7824f4a9c498.tar.bz2
sequelpro-6646f022ec631d24afe58e8fbe4a7824f4a9c498.zip
- Update delete table and database warning messages to be more user friendly (issue #192).
- Also make these messages have a style of critical to indicate the potential loss of data as a result of performing the operation. - Updated Localizable.strings to accommodate new dialog messages.
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m20
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 850ee443..851213e7 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -497,10 +497,9 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
* if contextInfo == removedatabase -> tries to remove the selected database
*/
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(NSString *)contextInfo
-{
- [sheet orderOut:self];
-
+{
if ([contextInfo isEqualToString:@"connect"]) {
+ [sheet orderOut:self];
[self connectToDB:nil];
return;
}
@@ -680,10 +679,19 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
{
if ([chooseDatabaseButton indexOfSelectedItem] == 0)
return;
+
if (![tablesListInstance selectionShouldChangeInTableView:nil])
return;
- NSBeginAlertSheet(NSLocalizedString(@"Warning", @"warning"), NSLocalizedString(@"Delete", @"delete button"), NSLocalizedString(@"Cancel", @"cancel button"), nil, tableWindow, self, nil, @selector(sheetDidEnd:returnCode:contextInfo:), @"removedatabase", [NSString stringWithFormat:NSLocalizedString(@"Do you really want to delete the database %@?", @"message of panel asking for confirmation for deleting db"), [self database]]);
+ NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@"Delete database '%@'?", @"delete database message"), [self database]]
+ defaultButton:NSLocalizedString(@"Delete", @"delete button")
+ alternateButton:NSLocalizedString(@"Cancel", @"cancel button")
+ otherButton:nil
+ informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"Are you sure you want to delete the database '%@'. This operation cannot be undone.", @"delete database informative message"), [self database]]];
+
+ [alert setAlertStyle:NSCriticalAlertStyle];
+
+ [alert beginSheetModalForWindow:tableWindow modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"removedatabase"];
}
#pragma mark Console methods
@@ -1604,10 +1612,10 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
[toolbarItem setToolTip:NSLocalizedString(@"Show or hide the console which shows all MySQL commands performed by Sequel Pro", @"tooltip for toolbar item for show/hide console")];
if ([[[SPQueryConsole sharedQueryConsole] window] isVisible]) {
- [toolbarItem setLabel:NSLocalizedString(@"Hide Console", @"toolbar item for hide console")];
+ [toolbarItem setLabel:NSLocalizedString(@"Hide Console", @"Hide Console")];
[toolbarItem setImage:[NSImage imageNamed:@"hideconsole"]];
} else {
- [toolbarItem setLabel:NSLocalizedString(@"Show Console", @"toolbar item for showconsole")];
+ [toolbarItem setLabel:NSLocalizedString(@"Show Console", @"Show Console")];
[toolbarItem setImage:[NSImage imageNamed:@"showconsole"]];
}