marinofaggiana 3 年之前
父节点
当前提交
aa750b8f7a
共有 2 个文件被更改,包括 29 次插入1 次删除
  1. 27 1
      iOSClient/Settings/NCSettings.m
  2. 2 0
      iOSClient/Supporting Files/en.lproj/Localizable.strings

+ 27 - 1
iOSClient/Settings/NCSettings.m

@@ -110,6 +110,22 @@
     
     [section addFormRow:row];
     
+    // Section : CleanUp --------------------------------------------------------------
+
+    section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_cleanup_", nil)];
+    [form addFormSection:section];
+    
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"removeoldfiles" rowType:XLFormRowDescriptorTypeStepCounter title:NSLocalizedString(@"_remove_old_files_", nil)];
+    row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.secondarySystemGroupedBackground;
+    row.value = [NSString stringWithFormat:@"%ld", CCUtility.getCleanUpDay];
+    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
+    [row.cellConfig setObject:NCBrandColor.shared.label forKey:@"textLabel.textColor"];
+    [row.cellConfigAtConfigure setObject:@YES forKey:@"stepControl.wraps"];
+    [row.cellConfigAtConfigure setObject:@1 forKey:@"stepControl.stepValue"];
+    [row.cellConfigAtConfigure setObject:@0 forKey:@"stepControl.minimumValue"];
+    [row.cellConfigAtConfigure setObject:@100 forKey:@"stepControl.maximumValue"];
+    [section addFormRow:row];
+    
     // Section Advanced -------------------------------------------------
     
     section = [XLFormSectionDescriptor formSection];
@@ -266,6 +282,12 @@
             [CCUtility setEnableTouchFaceID:false];
         }
     }
+    
+    if ([rowDescriptor.tag isEqualToString:@"removeoldfiles"]) {
+        
+        NSInteger days = [[rowDescriptor.value valueData] intValue];
+        [CCUtility setCleanUpDay:days];
+    }
 }
 
 #pragma mark -
@@ -395,7 +417,11 @@
             sectionName = NSLocalizedString(@"_lock_protection_no_screen_footer_", nil);
         }
         break;
-        case 4: {
+        case 3: {
+            sectionName = NSLocalizedString(@"_remove_old_files_desc_", nil);
+        }
+        break;
+        case 5: {
                                 
             NSString *versionServer = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesVersionString];
             NSString *themingName = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesThemingName];

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

@@ -803,6 +803,8 @@
 "_save_as_copy_"            = "Save as copy";
 "_discard_changes_"         = "Close and discard changes";
 "_message_disable_overwrite_livephoto_" = "This image it's a Live Photo, the overwrite will not possible";
+"_cleanup_"                 = "Cleanup";
+"_remove_old_files_desc_"   = "Remove all unused files from the chosen days (0-365, 0 is disabled)";
 "_remove_old_files_"        = "Remove all files older than";
 
 // ----------------------------------------------------------------------------------------------------------------------------------