Browse Source

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
7c275995c3
2 changed files with 31 additions and 11 deletions
  1. 21 10
      iOSClient/Settings/NCManageE2EE.swift
  2. 10 1
      iOSClient/Settings/NCSettings.m

+ 21 - 10
iOSClient/Settings/NCManageE2EE.swift

@@ -132,6 +132,7 @@ struct NCViewE2EE: View {
                     .frame(height: 100)
                     .padding()
 
+                /*
                 Button(action: {}) {
                     HStack{
                         Image(systemName: "person.crop.circle.fill")
@@ -144,9 +145,10 @@ struct NCViewE2EE: View {
                 .background(Color.blue)
                 .cornerRadius(.infinity)
                 .frame(height: 100)
+                */
 
                 if manageE2EE.isEndToEndEnabled {
-                    Text("Activated")
+                    Text("Cifratura End to And attivata")
                 } else {
                     Button(action: {
                         manageE2EE.endToEndInitialize.initEndToEndEncryption()
@@ -155,16 +157,25 @@ struct NCViewE2EE: View {
                     })
                 }
 
+                if manageE2EE.isEndToEndEnabled {
+                    Button(action: {
 
-                Button(action: {
-                    if CCUtility.getPasscode().isEmpty {
-                        NCContentPresenter.shared.showInfo(error: NKError(errorCode: 0, errorDescription: "_e2e_settings_lock_not_active_"))
-                    } else {
-                        manageE2EE.requestPasscodeType("removeLocallyEncryption")
-                    }
-                }, label: {
-                    Text(NSLocalizedString("_e2e_settings_remove_", comment: ""))
-                })
+                    }, label: {
+                        Text("Leggi la frase segreta")
+                    })
+                }
+
+                if manageE2EE.isEndToEndEnabled {
+                    Button(action: {
+                        if CCUtility.getPasscode().isEmpty {
+                            NCContentPresenter.shared.showInfo(error: NKError(errorCode: 0, errorDescription: "_e2e_settings_lock_not_active_"))
+                        } else {
+                            manageE2EE.requestPasscodeType("removeLocallyEncryption")
+                        }
+                    }, label: {
+                        Text(NSLocalizedString("_e2e_settings_remove_", comment: ""))
+                    })
+                }
 
 #if DEBUG
                 Button(action: {

+ 10 - 1
iOSClient/Settings/NCSettings.m

@@ -126,6 +126,16 @@
         section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_e2e_settings_title_", nil)];
         [form addFormSection:section];
 
+        // EndToEnd Encryption
+        row = [XLFormRowDescriptor formRowDescriptorWithTag:@"e2eEncryption" rowType:XLFormRowDescriptorTypeButton title:@"OLD"];
+        row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
+        [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
+        [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
+        [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
+        [row.cellConfig setObject:[[UIImage imageNamed:@"lock"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
+        row.action.viewControllerClass = [NCManageEndToEndEncryption class];
+        [section addFormRow:row];
+
         // EndToEnd Encryption
         NSString *title = [NSString stringWithFormat:@"%@",NSLocalizedString(@"_e2e_settings_", nil)];
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"e2eEncryption" rowType:XLFormRowDescriptorTypeButton title:title];
@@ -135,7 +145,6 @@
         [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[[UIImage imageNamed:@"lock"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
         row.action.formSelector = @selector(manageE2EE:);
-        //row.action.viewControllerClass = [NCManageEndToEndEncryption class];
         [section addFormRow:row];
     }