Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
87f84981
Commit
87f84981
authored
May 30, 2013
by
Felix Paul Kühne
Browse files
Dropbox: add confirmation dialog before downloading a file
parent
4d9b875f
Changes
2
Hide whitespace changes
Inline
Side-by-side
AspenProject/VLCDropboxTableViewController.m
View file @
87f84981
...
...
@@ -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
...
...
Resources/en.lproj/Localizable.strings
View file @
87f84981
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment