|
@@ -2,7 +2,7 @@
|
|
|
* VLCBoxTableViewController.m
|
|
|
* VLC for iOS
|
|
|
*****************************************************************************
|
|
|
- * Copyright (c) 2014 VideoLAN. All rights reserved.
|
|
|
+ * Copyright (c) 2014-2015 VideoLAN. All rights reserved.
|
|
|
* $Id$
|
|
|
*
|
|
|
* Authors: Carola Nitz <nitz.carola # googlemail.com>
|
|
@@ -14,6 +14,7 @@
|
|
|
#import "VLCBoxController.h"
|
|
|
#import "VLCAppDelegate.h"
|
|
|
#import <SSKeychain/SSKeychain.h>
|
|
|
+#import "UIDevice+SpeedCategory.h"
|
|
|
|
|
|
@interface VLCBoxTableViewController () <VLCCloudStorageTableViewCell, BoxAuthorizationViewControllerDelegate>
|
|
|
{
|
|
@@ -134,12 +135,16 @@
|
|
|
{
|
|
|
_selectedFile = _boxController.currentListFiles[[self.tableView indexPathForCell:cell].row];
|
|
|
|
|
|
- /* selected item is a proper file, ask the user if s/he wants to download it */
|
|
|
- UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DROPBOX_DOWNLOAD", nil) message:[NSString stringWithFormat:NSLocalizedString(@"DROPBOX_DL_LONG", nil), _selectedFile.name, [[UIDevice currentDevice] model]] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", nil) otherButtonTitles:NSLocalizedString(@"BUTTON_DOWNLOAD", nil), nil];
|
|
|
- [alert show];
|
|
|
+ if (_selectedFile.size.longLongValue < [[UIDevice currentDevice] freeDiskspace].longLongValue) {
|
|
|
+ /* selected item is a proper file, ask the user if s/he wants to download it */
|
|
|
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DROPBOX_DOWNLOAD", nil) message:[NSString stringWithFormat:NSLocalizedString(@"DROPBOX_DL_LONG", nil), _selectedFile.name, [[UIDevice currentDevice] model]] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", nil) otherButtonTitles:NSLocalizedString(@"BUTTON_DOWNLOAD", nil), nil];
|
|
|
+ [alert show];
|
|
|
+ } else {
|
|
|
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DISK_FULL", nil) message:[NSString stringWithFormat:NSLocalizedString(@"DISK_FULL_FORMAT", nil), _selectedFile.name, [[UIDevice currentDevice] model]] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_OK", nil) otherButtonTitles:nil];
|
|
|
+ [alert show];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
|
|
|
{
|
|
|
if (buttonIndex == 1)
|