Commit 08400fbe authored by Felix Paul Kühne's avatar Felix Paul Kühne

Add confirmation dialog before deleting media on iPad (close #8734)

parent 87f84981
......@@ -89,8 +89,17 @@
- (IBAction)removeMedia:(id)sender
{
NSUInteger cellIndex = [self.gridView indexForCell:self];
[self.gridView.delegate gridView:self.gridView commitEditingStyle:UITableViewCellEditingStyleDelete forRowAtIndex:cellIndex];
/* ask user if s/he really wants to delete the media file */
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DELETE_FILE", @"") message:[NSString stringWithFormat:NSLocalizedString(@"DELETE_FILE_LONG", @""), self.mediaObject.title] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:NSLocalizedString(@"BUTTON_DELETE", @""), nil];
[alert show];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 1) {
NSUInteger cellIndex = [self.gridView indexForCell:self];
[self.gridView.delegate gridView:self.gridView commitEditingStyle:UITableViewCellEditingStyleDelete forRowAtIndex:cellIndex];
}
}
@end
B"CHOOSE_AUDIO_TRACK"="Choose Audio Track";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment