Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #57 from falsecz/confirm-delete-connection

Confirm dialog before connection delete
  • Loading branch information...
commit 20b17bb88a0adbf985d5a7dbc30877e3afdba619 2 parents 9c3b51e + 38790b6
@jeromelebel authored
Showing with 14 additions and 2 deletions.
  1. +14 −2 Sources/MHApplicationDelegate.m
View
16 Sources/MHApplicationDelegate.m
@@ -312,8 +312,20 @@ - (IBAction)showAddConnectionPanel:(id)sender
- (IBAction)deleteConnection:(id)sender
{
- [connectionsArrayController remove:sender];
- [self saveConnections];
+ NSAlert *alert = [[[NSAlert alloc] init] autorelease];
+ [alert addButtonWithTitle:@"OK"];
+ [alert addButtonWithTitle:@"Cancel"];
+ [alert setMessageText:@"Delete the connection?"];
+ [alert setInformativeText:@"Deleted connections cannot be restored."];
+ [alert setAlertStyle:NSWarningAlertStyle];
+
+ NSInteger answer = [alert runModal];
+ alert = nil;
+
+ if (answer == NSAlertFirstButtonReturn) {
+ [connectionsArrayController remove:sender];
+ [self saveConnections];
+ }
}
- (IBAction)showEditConnectionPanel:(id)sender
Please sign in to comment.
Something went wrong with that request. Please try again.