|
@@ -89,8 +89,17 @@
|
|
|
|
|
|
- (IBAction)removeMedia:(id)sender
|
|
- (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
|
|
@end
|