Commit 87f84981 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Dropbox: add confirmation dialog before downloading a file

parent 4d9b875f
......@@ -160,8 +160,9 @@
{
DBMetadata *selectedFile = _dropboxController.currentListFiles[indexPath.row];
if (!selectedFile.isDirectory) {
/* selected item is a proper file, download it */
[_dropboxController downloadFileToDocumentFolder:selectedFile];
/* selected item is a proper file, ask the user if s/he wants to download it */
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DROPBOX_DOWNLOAD", @"") message:[NSString stringWithFormat:NSLocalizedString(@"DROPBOX_DL_LONG", @""), selectedFile.filename, [[UIDevice currentDevice] model]] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:NSLocalizedString(@"BUTTON_DOWNLOAD", @""), nil];
[alert show];
} else {
/* dive into subdirectory */
_currentPath = [_currentPath stringByAppendingFormat:@"/%@", selectedFile.filename];
......@@ -171,6 +172,14 @@
[self.tableView deselectRowAtIndexPath:indexPath animated:NO];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 1) {
DBMetadata *selectedFile = _dropboxController.currentListFiles[self.tableView.indexPathForSelectedRow.row];
[_dropboxController downloadFileToDocumentFolder:selectedFile];
}
}
#pragma mark - dropbox controller delegate
- (void)mediaListUpdated
......
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