marinofaggiana před 4 roky
rodič
revize
f334f410b1

+ 2 - 1
iOSClient/Database/NCDatabase.swift

@@ -31,8 +31,9 @@ class tableAccount: Object {
     @objc dynamic var autoUpload: Bool = false
     @objc dynamic var autoUploadBackground: Bool = false
     @objc dynamic var autoUploadCreateSubfolder: Bool = false
-    @objc dynamic var autoUploadFileName = ""
+    @objc dynamic var autoUploadDeleteAssetLocalIdentifier: Bool = false
     @objc dynamic var autoUploadDirectory = ""
+    @objc dynamic var autoUploadFileName = ""
     @objc dynamic var autoUploadFull: Bool = false
     @objc dynamic var autoUploadImage: Bool = false
     @objc dynamic var autoUploadVideo: Bool = false

+ 1 - 1
iOSClient/Networking/CCNetworking.m

@@ -956,7 +956,7 @@
     } else {
     
         // Delete Asset
-        if ([CCUtility getDeleteAssetLocalIdentifiersforAutoUpload] && ![metadata.assetLocalIdentifier isEqualToString:@""] && [metadata.sessionSelector isEqualToString:selectorUploadAutoUpload]) {
+        if (tableAccount.autoUploadDeleteAssetLocalIdentifier && ![metadata.assetLocalIdentifier isEqualToString:@""] && [metadata.sessionSelector isEqualToString:selectorUploadAutoUpload]) {
             metadata.deleteAssetLocalIdentifier = true;
         }
         

+ 14 - 0
iOSClient/Settings/CCManageAutoUpload.m

@@ -119,6 +119,20 @@
     [row.cellConfig setObject:NCBrandColor.sharedInstance.textView forKey:@"textLabel.textColor"];
     [section addFormRow:row];
     
+    // Delete asset
+    
+    section = [XLFormSectionDescriptor formSection];
+    [form addFormSection:section];
+    
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"removePhotoCameraRoll" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_remove_photo_CameraRoll_", nil)];
+    row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.sharedInstance.backgroundView;
+    row.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
+    if (tableAccount.autoUploadDeleteAssetLocalIdentifier) row.value = @1;
+    else row.value = @0;
+    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
+    [row.cellConfig setObject:NCBrandColor.sharedInstance.textView forKey:@"textLabel.textColor"];
+    [section addFormRow:row];
+    
     // Auto Upload Background
     
     section = [XLFormSectionDescriptor formSection];

+ 3 - 1
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -288,7 +288,7 @@
 "_crashservice_title_"          = "Disable crash reporter";
 "_crashservice_alert_"          = "This option requires a restart of the app to take effect";
 "_upload_mov_livephoto_"        = "Live Photo";
-"_upload_mov_livephoto_footer_" = "\"Live Photo\" will save, when possible, Live Photo video and hide the mov file part";
+"_upload_mov_livephoto_footer_" = "\"Live Photo\" will save, when possible, the photo selected in \"Live Photo\" format";
 
 // Login
 
@@ -336,6 +336,8 @@
 "_create_full_upload_"                      = "Creating archive… May take a long time, please wait.";
 "_error_createsubfolders_upload_"           = "Error creating subfolders";
 "_activate_autoupload_"                     = "Enable auto upload";
+"_remove_photo_CameraRoll_"                 = "Remove from camera roll after successful upload";
+"_remove_photo_CameraRoll_desc_"            = "In case of successful auto upload a message will require the deletion of the photo or video from the camera roll, remember that the deleted photos will be available for 30 days in the trash";
 
 // Utility
 

binární
iOSClient/Supporting Files/zh-Hans.lproj/Localizable.strings


+ 0 - 3
iOSClient/Utility/CCUtility.h

@@ -177,9 +177,6 @@
 + (BOOL)getLivePhoto;
 + (void)setLivePhoto:(BOOL)set;
 
-+ (BOOL)getDeleteAssetLocalIdentifiersforAutoUpload;
-+ (void)setDeleteAssetLocalIdentifiersforAutoUpload:(BOOL)set;
-
 // ===== Varius =====
 
 + (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL;

+ 0 - 11
iOSClient/Utility/CCUtility.m

@@ -706,17 +706,6 @@
     [UICKeyChainStore setString:sSet forKey:@"livePhoto" service:k_serviceShareKeyChain];
 }
 
-+ (BOOL)getDeleteAssetLocalIdentifiersforAutoUpload
-{
-    return [[UICKeyChainStore stringForKey:@"deleteAssetLocalIdentifiersforAutoUpload" service:k_serviceShareKeyChain] boolValue];
-}
-
-+ (void)setDeleteAssetLocalIdentifiersforAutoUpload:(BOOL)set
-{
-    NSString *sSet = (set) ? @"true" : @"false";
-    [UICKeyChainStore setString:sSet forKey:@"deleteAssetLocalIdentifiersforAutoUpload" service:k_serviceShareKeyChain];
-}
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Various =====
 #pragma --------------------------------------------------------------------------------------------