|
@@ -3112,7 +3112,6 @@
|
|
|
CGPoint touch = [gestureRecognizer locationInView:self.tableView];
|
|
|
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:touch];
|
|
|
CCCellMain *cell = [self.tableView cellForRowAtIndexPath:indexPath];
|
|
|
- BOOL canShareEdit = cell.canShareEdit;
|
|
|
|
|
|
self.metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
|
|
|
|
|
@@ -3189,7 +3188,7 @@
|
|
|
else [self settingFavorite:self.metadata favorite:YES];
|
|
|
}];
|
|
|
|
|
|
- if (!lockDirectory && !isFolderEncrypted && canShareEdit) {
|
|
|
+ if (!lockDirectory && !isFolderEncrypted) {
|
|
|
|
|
|
[actionSheet addButtonWithTitle:NSLocalizedString(@"_share_", nil)
|
|
|
image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"share"] multiplier:2 color:[NCBrandColor sharedInstance].icon]
|
|
@@ -3201,7 +3200,7 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- if (!([self.metadata.fileName isEqualToString:_autoUploadFileName] == YES && [self.metadata.serverUrl isEqualToString:_autoUploadDirectory] == YES) && !lockDirectory && !self.metadata.e2eEncrypted && canShareEdit) {
|
|
|
+ if (!([self.metadata.fileName isEqualToString:_autoUploadFileName] == YES && [self.metadata.serverUrl isEqualToString:_autoUploadDirectory] == YES) && !lockDirectory && !self.metadata.e2eEncrypted) {
|
|
|
|
|
|
[actionSheet addButtonWithTitle:NSLocalizedString(@"_rename_", nil)
|
|
|
image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"rename"] multiplier:2 color:[NCBrandColor sharedInstance].icon]
|
|
@@ -3238,7 +3237,7 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- if (!([self.metadata.fileName isEqualToString:_autoUploadFileName] == YES && [self.metadata.serverUrl isEqualToString:_autoUploadDirectory] == YES) && !lockDirectory && !isFolderEncrypted && canShareEdit) {
|
|
|
+ if (!([self.metadata.fileName isEqualToString:_autoUploadFileName] == YES && [self.metadata.serverUrl isEqualToString:_autoUploadDirectory] == YES) && !lockDirectory && !isFolderEncrypted) {
|
|
|
|
|
|
[actionSheet addButtonWithTitle:NSLocalizedString(@"_move_", nil)
|
|
|
image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"move"] multiplier:2 color:[NCBrandColor sharedInstance].icon]
|
|
@@ -3287,7 +3286,7 @@
|
|
|
[self performSelector:@selector(comandoLockPassword) withObject:nil];
|
|
|
}];
|
|
|
|
|
|
- if (!self.metadata.e2eEncrypted && [CCUtility isEndToEndEnabled:appDelegate.activeAccount] && canShareEdit) {
|
|
|
+ if (!self.metadata.e2eEncrypted && [CCUtility isEndToEndEnabled:appDelegate.activeAccount]) {
|
|
|
|
|
|
[actionSheet addButtonWithTitle:NSLocalizedString(@"_e2e_set_folder_encrypted_", nil)
|
|
|
image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"lock"] width:50 height:50 color:[NCBrandColor sharedInstance].icon]
|
|
@@ -3310,7 +3309,7 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- if (self.metadata.e2eEncrypted && !_metadataFolder.e2eEncrypted && [CCUtility isEndToEndEnabled:appDelegate.activeAccount] && canShareEdit) {
|
|
|
+ if (self.metadata.e2eEncrypted && !_metadataFolder.e2eEncrypted && [CCUtility isEndToEndEnabled:appDelegate.activeAccount]) {
|
|
|
|
|
|
[actionSheet addButtonWithTitle:NSLocalizedString(@"_e2e_remove_folder_encrypted_", nil)
|
|
|
image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"lock"] width:50 height:50 color:[NCBrandColor sharedInstance].icon]
|
|
@@ -3333,17 +3332,16 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- if (canShareEdit) {
|
|
|
-
|
|
|
- [actionSheet addButtonWithTitle:NSLocalizedString(@"_delete_", nil)
|
|
|
- image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"trash"] width:50 height:50 color:[UIColor redColor]]
|
|
|
- backgroundColor:[NCBrandColor sharedInstance].backgroundView
|
|
|
- height:50.0
|
|
|
- type:AHKActionSheetButtonTypeDestructive
|
|
|
- handler:^(AHKActionSheet *as) {
|
|
|
+
|
|
|
+ [actionSheet addButtonWithTitle:NSLocalizedString(@"_delete_", nil)
|
|
|
+ image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"trash"] width:50 height:50 color:[UIColor redColor]]
|
|
|
+ backgroundColor:[NCBrandColor sharedInstance].backgroundView
|
|
|
+ height:50.0
|
|
|
+ type:AHKActionSheetButtonTypeDestructive
|
|
|
+ handler:^(AHKActionSheet *as) {
|
|
|
[self actionDelete:indexPath];
|
|
|
- }];
|
|
|
- }
|
|
|
+ }];
|
|
|
+
|
|
|
|
|
|
[actionSheet show];
|
|
|
}
|
|
@@ -3379,7 +3377,7 @@
|
|
|
else [self settingFavorite:self.metadata favorite:YES];
|
|
|
}];
|
|
|
|
|
|
- if (!_metadataFolder.e2eEncrypted && canShareEdit) {
|
|
|
+ if (!_metadataFolder.e2eEncrypted) {
|
|
|
|
|
|
[actionSheet addButtonWithTitle:NSLocalizedString(@"_share_", nil)
|
|
|
image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"share"] multiplier:2 color:[NCBrandColor sharedInstance].icon]
|
|
@@ -3403,42 +3401,42 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- if (canShareEdit) {
|
|
|
+
|
|
|
|
|
|
- [actionSheet addButtonWithTitle:NSLocalizedString(@"_rename_", nil)
|
|
|
- image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"rename"] multiplier:2 color:[NCBrandColor sharedInstance].icon]
|
|
|
- backgroundColor:[NCBrandColor sharedInstance].backgroundView
|
|
|
- height: 50.0
|
|
|
- type:AHKActionSheetButtonTypeDefault
|
|
|
- handler:^(AHKActionSheet *as) {
|
|
|
-
|
|
|
- __weak __typeof(UIAlertController) *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_rename_",nil) message:nil preferredStyle:UIAlertControllerStyleAlert];
|
|
|
-
|
|
|
- [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
|
|
- textField.text = self.metadata.fileNameView;
|
|
|
- textField.delegate = self;
|
|
|
- [textField addTarget:self action:@selector(minCharTextFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
|
|
- }];
|
|
|
-
|
|
|
- UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_",nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
|
|
|
- NSLog(@"[LOG] Cancel action");
|
|
|
- }];
|
|
|
-
|
|
|
- UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
|
|
- UITextField *fileName = alertController.textFields.firstObject;
|
|
|
- [self performSelectorOnMainThread:@selector(renameFile:) withObject:[NSMutableArray arrayWithObjects:self.metadata,fileName.text, nil] waitUntilDone:NO];
|
|
|
- }];
|
|
|
-
|
|
|
- okAction.enabled = NO;
|
|
|
-
|
|
|
- [alertController addAction:cancelAction];
|
|
|
- [alertController addAction:okAction];
|
|
|
-
|
|
|
- [self presentViewController:alertController animated:YES completion:nil];
|
|
|
+ [actionSheet addButtonWithTitle:NSLocalizedString(@"_rename_", nil)
|
|
|
+ image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"rename"] multiplier:2 color:[NCBrandColor sharedInstance].icon]
|
|
|
+ backgroundColor:[NCBrandColor sharedInstance].backgroundView
|
|
|
+ height: 50.0
|
|
|
+ type:AHKActionSheetButtonTypeDefault
|
|
|
+ handler:^(AHKActionSheet *as) {
|
|
|
+
|
|
|
+ __weak __typeof(UIAlertController) *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_rename_",nil) message:nil preferredStyle:UIAlertControllerStyleAlert];
|
|
|
+
|
|
|
+ [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
|
|
+ textField.text = self.metadata.fileNameView;
|
|
|
+ textField.delegate = self;
|
|
|
+ [textField addTarget:self action:@selector(minCharTextFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
|
|
}];
|
|
|
- }
|
|
|
+
|
|
|
+ UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_",nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
|
|
|
+ NSLog(@"[LOG] Cancel action");
|
|
|
+ }];
|
|
|
+
|
|
|
+ UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
|
|
+ UITextField *fileName = alertController.textFields.firstObject;
|
|
|
+ [self performSelectorOnMainThread:@selector(renameFile:) withObject:[NSMutableArray arrayWithObjects:self.metadata,fileName.text, nil] waitUntilDone:NO];
|
|
|
+ }];
|
|
|
+
|
|
|
+ okAction.enabled = NO;
|
|
|
+
|
|
|
+ [alertController addAction:cancelAction];
|
|
|
+ [alertController addAction:okAction];
|
|
|
+
|
|
|
+ [self presentViewController:alertController animated:YES completion:nil];
|
|
|
+ }];
|
|
|
+
|
|
|
|
|
|
- if (!_metadataFolder.e2eEncrypted && canShareEdit) {
|
|
|
+ if (!_metadataFolder.e2eEncrypted) {
|
|
|
|
|
|
[actionSheet addButtonWithTitle:NSLocalizedString(@"_move_", nil)
|
|
|
image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"move"] multiplier:2 color:[NCBrandColor sharedInstance].icon]
|
|
@@ -3450,7 +3448,7 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- if ([NCUtility.sharedInstance isEditImage:self.metadata.fileNameView] != nil && !_metadataFolder.e2eEncrypted && self.metadata.status == k_metadataStatusNormal && canShareEdit) {
|
|
|
+ if ([NCUtility.sharedInstance isEditImage:self.metadata.fileNameView] != nil && !_metadataFolder.e2eEncrypted && self.metadata.status == k_metadataStatusNormal) {
|
|
|
|
|
|
[actionSheet addButtonWithTitle:NSLocalizedString(@"_modify_photo_", nil)
|
|
|
image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"modifyPhoto"] width:50 height:50 color:[NCBrandColor sharedInstance].icon]
|
|
@@ -3505,17 +3503,14 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- if (canShareEdit) {
|
|
|
-
|
|
|
- [actionSheet addButtonWithTitle:NSLocalizedString(@"_delete_", nil)
|
|
|
- image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"trash"] width:50 height:50 color:[UIColor redColor]]
|
|
|
- backgroundColor:[NCBrandColor sharedInstance].backgroundView
|
|
|
- height:50.0
|
|
|
- type:AHKActionSheetButtonTypeDestructive
|
|
|
- handler:^(AHKActionSheet *as) {
|
|
|
- [self actionDelete:indexPath];
|
|
|
- }];
|
|
|
- }
|
|
|
+ [actionSheet addButtonWithTitle:NSLocalizedString(@"_delete_", nil)
|
|
|
+ image:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"trash"] width:50 height:50 color:[UIColor redColor]]
|
|
|
+ backgroundColor:[NCBrandColor sharedInstance].backgroundView
|
|
|
+ height:50.0
|
|
|
+ type:AHKActionSheetButtonTypeDestructive
|
|
|
+ handler:^(AHKActionSheet *as) {
|
|
|
+ [self actionDelete:indexPath];
|
|
|
+ }];
|
|
|
|
|
|
[actionSheet show];
|
|
|
}
|