فهرست منبع

Move More Compatibility from Auto Upload to Advanced [settings]

Marino Faggiana 7 سال پیش
والد
کامیت
1e09a62401

+ 0 - 1
iOSClient/Database/NCDatabase.swift

@@ -38,7 +38,6 @@ class tableAccount: Object {
     @objc dynamic var autoUploadVideo: Bool = false
     @objc dynamic var autoUploadWWAnPhoto: Bool = false
     @objc dynamic var autoUploadWWAnVideo: Bool = false
-    @objc dynamic var autoUploadFormatCompatibility: Bool = false
     @objc dynamic var displayName = ""
     @objc dynamic var email = ""
     @objc dynamic var enabled: Bool = false

+ 1 - 2
iOSClient/Networking/CCNetworking.m

@@ -789,10 +789,9 @@
             
         [[PHImageManager defaultManager] requestImageDataForAsset:asset options:options resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
                 
-            tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountActive];
             NSError *error = nil;
 
-            if ([dataUTI isEqualToString:@"public.heic"] && tableAccount.autoUploadFormatCompatibility) {
+            if ([dataUTI isEqualToString:@"public.heic"] && [CCUtility getFormatCompatibility]) {
                     
                 UIImage *image = [UIImage imageWithData:imageData];
                 imageData = UIImageJPEGRepresentation(image, 1.0);

+ 17 - 0
iOSClient/Settings/CCAdvanced.m

@@ -103,6 +103,18 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
     [section addFormRow:row];
     
+    // Format Compatibility
+    
+    section = [XLFormSectionDescriptor formSection];
+    [form addFormSection:section];
+    section.footerTitle = NSLocalizedString(@"_format_compatibility_footer_", nil);
+
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"formatCompatibility" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_format_compatibility_", nil)];
+    if ([CCUtility getFormatCompatibility]) row.value = @"1";
+    else row.value = @"0";
+    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
+    [section addFormRow:row];
+    
     // Section CLEAR CACHE -------------------------------------------------
     
     section = [XLFormSectionDescriptor formSection];
@@ -191,6 +203,11 @@
         // force reload
         [[NCManageDatabase sharedInstance] setClearAllDateReadDirectory];
     }
+    
+    if ([rowDescriptor.tag isEqualToString:@"formatCompatibility"]) {
+        
+        [CCUtility setFormatCompatibility:[[rowDescriptor.value valueData] boolValue]];
+    }
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 0 - 28
iOSClient/Settings/CCManageAutoUpload.m

@@ -154,18 +154,6 @@
     else row.value = @0;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
     [section addFormRow:row];
-
-    // Auto Upload Format Compatibility
-    
-    section = [XLFormSectionDescriptor formSection];
-    [form addFormSection:section];
-    
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUploadFormatCompatibility" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_autoupload_format_compatibility_", nil)];
-    row.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
-    if (tableAccount.autoUploadCreateSubfolder) row.value = @1;
-    else row.value = @0;
-    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
-    [section addFormRow:row];
     
     // Auto Upload file name
     
@@ -336,11 +324,6 @@
         [[NCManageDatabase sharedInstance] setAccountAutoUploadProperty:@"autoUploadWWAnVideo" state:[[rowDescriptor.value valueData] boolValue]];
     }
     
-    if ([rowDescriptor.tag isEqualToString:@"autoUploadFormatCompatibility"]) {
-        
-        [[NCManageDatabase sharedInstance] setAccountAutoUploadProperty:@"autoUploadFormatCompatibility" state:[[rowDescriptor.value valueData] boolValue]];
-    }    
-    
     if ([rowDescriptor.tag isEqualToString:@"autoUploadCreateSubfolder"]) {
         
         [[NCManageDatabase sharedInstance] setAccountAutoUploadProperty:@"autoUploadCreateSubfolder" state:[[rowDescriptor.value valueData] boolValue]];
@@ -369,8 +352,6 @@
     XLFormRowDescriptor *rowAutoUploadFull = [self.form formRowWithTag:@"autoUploadFull"];
     
     XLFormRowDescriptor *rowAutoUploadCreateSubfolder = [self.form formRowWithTag:@"autoUploadCreateSubfolder"];
-
-    XLFormRowDescriptor *rowAutoUploadFormatCompatibility = [self.form formRowWithTag:@"autoUploadFormatCompatibility"];
     
     XLFormRowDescriptor *rowAutoUploadFileName = [self.form formRowWithTag:@"autoUploadFileName"];
     
@@ -398,9 +379,6 @@
     if (tableAccount.autoUploadFull)
         [rowAutoUploadFull setValue:@1]; else [rowAutoUploadFull setValue:@0];
     
-    if (tableAccount.autoUploadFormatCompatibility)
-        [rowAutoUploadFormatCompatibility setValue:@1]; else [rowAutoUploadFormatCompatibility setValue:@0];
-    
     if (tableAccount.autoUploadCreateSubfolder)
         [rowAutoUploadCreateSubfolder setValue:@1]; else [rowAutoUploadCreateSubfolder setValue:@0];
 
@@ -418,8 +396,6 @@
     
     rowAutoUploadCreateSubfolder.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
     
-    rowAutoUploadFormatCompatibility.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
-
     rowAutoUploadFileName.hidden = [NSString stringWithFormat:@"$%@==0", @"autoUpload"];
     
     // -----------------------------------------------------------------------------------
@@ -452,10 +428,6 @@
             else sectionName = @"";
             break;
         case 6:
-            if (tableAccount.autoUpload) sectionName =  NSLocalizedString(@"_autoupload_format_compatibility_footer_", nil);
-            else sectionName = @"";
-            break;
-        case 7:
             if (tableAccount.autoUpload) sectionName =  NSLocalizedString(@"_autoupload_filenamemask_footer_", nil);
             else sectionName = @"";
             break;

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

@@ -190,8 +190,7 @@
 "_autoupload_create_subfolder_footer_" = "Store in subfolders based on year and month";
 "_autoupload_filenamemask_"         = "Change filename mask";
 "_autoupload_filenamemask_footer_"  = "Change the automatic filename mask";
-"_autoupload_format_compatibility_" = "Most Compatible";
-"_autoupload_format_compatibility_footer_" = "\"Most compatible\" will always save photos as JPEG";
+
 
 // Manage Help
 
@@ -209,6 +208,8 @@
 "_optimized_photos_how_"        = "If your iPhone is low on space, full-resolution photos are automatically replaced with optimized versions. The full-resolution versions are stored in your cloud.";
 "_upload_del_photos_how_"       = "Files will be removed from device memory after they’ve been uploaded to your cloud. They will remain in the camera roll. Just download the files to see them.";
 "_show_hidden_files_"           = "Show hidden files";
+"_format_compatibility_"        = "Most Compatible";
+"_format_compatibility_footer_" = "\"Most compatible\" will always save photos as JPEG";
 
 // Login
 

+ 4 - 0
iOSClient/Utility/CCUtility.h

@@ -91,6 +91,8 @@
 
 + (void)setShowHiddenFiles:(BOOL)show;
 
++ (void)setFormatCompatibility:(BOOL)set;
+
 + (void)setEndToEndPublicKey:(NSString *)account publicKey:(NSString *)publicKey;
 + (void)setEndToEndPrivateKey:(NSString *)account privateKey:(NSString *)privateKey;
 + (void)setEndToEndPassphrase:(NSString *)account passphrase:(NSString *)passphrase;
@@ -142,6 +144,8 @@
 
 + (BOOL)getShowHiddenFiles;
 
++ (BOOL)getFormatCompatibility;
+
 + (NSString *)getEndToEndPublicKey:(NSString *)account;
 + (NSString *)getEndToEndPrivateKey:(NSString *)account;
 + (NSString *)getEndToEndPassphrase:(NSString *)account;

+ 11 - 0
iOSClient/Utility/CCUtility.m

@@ -231,6 +231,12 @@
     [UICKeyChainStore setString:sShow forKey:@"showHiddenFiles" service:k_serviceShareKeyChain];
 }
 
++ (void)setFormatCompatibility:(BOOL)set
+{
+    NSString *sSet = (set) ? @"true" : @"false";
+    [UICKeyChainStore setString:sSet forKey:@"formatCompatibility" service:k_serviceShareKeyChain];
+}
+
 + (void)setEndToEndPublicKey:(NSString *)account publicKey:(NSString *)publicKey
 {
     NSString *key = [E2E_PublicKey stringByAppendingString:account];
@@ -459,6 +465,11 @@
     return [[UICKeyChainStore stringForKey:@"showHiddenFiles" service:k_serviceShareKeyChain] boolValue];
 }
 
++ (BOOL)getFormatCompatibility
+{
+    return [[UICKeyChainStore stringForKey:@"formatCompatibility" service:k_serviceShareKeyChain] boolValue];
+}
+
 + (NSString *)getEndToEndPublicKey:(NSString *)account
 {
     NSString *key = [E2E_PublicKey stringByAppendingString:account];