Browse Source

Improved Select view

marinofaggiana 3 years ago
parent
commit
292ffb3e9a

+ 1 - 7
iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift

@@ -521,15 +521,9 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate {
         let viewController = navigationController.topViewController as! NCSelect
         
         viewController.delegate = self
-        viewController.typeOfCommandView = .select
+        viewController.typeOfCommandView = .selectCreateFolder
         viewController.includeDirectoryE2EEncryption = true
-        viewController.includeImages = false
-//        viewController.hideButtonCreateFolder = false
-//        viewController.selectFile = false
-//        viewController.titleButtonDone = NSLocalizedString("_select_", comment: "")
-        viewController.type = ""
         
-        navigationController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
         self.present(navigationController, animated: true, completion: nil)
     }
 }

+ 1 - 10
iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift

@@ -243,17 +243,8 @@ import NCCommunication
         let viewController = navigationController.topViewController as! NCSelect
         
         viewController.delegate = self
-        viewController.typeOfCommandView = .select
-        viewController.includeDirectoryE2EEncryption = false
-        viewController.includeImages = false
-        
-        //viewController.hideButtonCreateFolder = false
-        //viewController.selectFile = false
-        //viewController.titleButtonDone = NSLocalizedString("_select_", comment: "")
-        
-        viewController.type = ""
+        viewController.typeOfCommandView = .selectCreateFolder
 
-        navigationController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
         self.present(navigationController, animated: true, completion: nil)
     }
     

+ 2 - 9
iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift

@@ -620,16 +620,9 @@ class NCCreateFormUploadScanDocument: XLFormViewController, NCSelectDelegate, NC
         let viewController = navigationController.topViewController as! NCSelect
         
         viewController.delegate = self
-        viewController.typeOfCommandView = .select
+        viewController.typeOfCommandView = .selectCreateFolder
         viewController.includeDirectoryE2EEncryption = true
-        viewController.includeImages = false
-        viewController.type = ""
-        
-//        viewController.hideButtonCreateFolder = false
-//        viewController.selectFile = false
-//        viewController.titleButtonDone = NSLocalizedString("_select_", comment: "")
-        
-        navigationController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
+                
         self.present(navigationController, animated: true, completion: nil)
     }
     

+ 1 - 8
iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift

@@ -277,16 +277,9 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
         let viewController = navigationController.topViewController as! NCSelect
         
         viewController.delegate = self
-        viewController.typeOfCommandView = .select
+        viewController.typeOfCommandView = .selectCreateFolder
         viewController.includeDirectoryE2EEncryption = true
-        viewController.includeImages = false
-        viewController.type = ""
         
-//        viewController.hideButtonCreateFolder = false
-//        viewController.selectFile = false
-//        viewController.titleButtonDone = NSLocalizedString("_select_", comment: "")
-
-        navigationController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
         self.present(navigationController, animated: true, completion: nil)
     }
     

+ 0 - 9
iOSClient/Main/NCFunctionCenter.swift

@@ -470,15 +470,6 @@ import NCCommunication
 
             vc.delegate = self
             vc.typeOfCommandView = .copyMove
-//            vc.hideButtonCreateFolder = false
-//            vc.selectFile = false
-            vc.includeDirectoryE2EEncryption = false
-            vc.includeImages = false
-            vc.type = ""
-//            vc.titleButtonDone = NSLocalizedString("_move_", comment: "")
-//            vc.titleButtonDone1 = NSLocalizedString("_copy_",comment: "")
-//            vc.isButtonDone1Hide = false
-//            vc.isOverwriteHide = false
             vc.items = copyItems
             vc.serverUrl = serverUrl
             

+ 0 - 6
iOSClient/Menu/NCMedia+Menu.swift

@@ -81,13 +81,7 @@ extension NCMedia {
                         
                         viewController.delegate = self
                         viewController.typeOfCommandView = .select
-                        viewController.includeDirectoryE2EEncryption = false
-                        viewController.includeImages = false
                         viewController.type = "mediaFolder"
-
-//                        viewController.hideButtonCreateFolder = true
-//                        viewController.selectFile = false
-//                        viewController.titleButtonDone = NSLocalizedString("_select_", comment: "")
                         
                         self.present(navigationController, animated: true, completion: nil)
                     }

+ 0 - 12
iOSClient/Menu/NCViewer+Menu.swift

@@ -201,20 +201,8 @@ extension NCViewer {
                         
                         viewController.delegate = NCViewer.shared
                         viewController.typeOfCommandView = .copyMove
-                        
-//                        viewController.hideButtonCreateFolder = false
-//                        viewController.titleButtonDone = NSLocalizedString("_move_", comment: "")
-//                        viewController.titleButtonDone1 = NSLocalizedString("_copy_", comment: "")
-//                        viewController.isButtonDone1Hide = false
-//                        viewController.isOverwriteHide = false
-                        
                         viewController.items = [metadata]
-                        viewController.includeDirectoryE2EEncryption = false
-                        viewController.includeImages = false
-                        viewController.type = ""
-                       
                         
-                        navigationController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
                         self.appDelegate.window?.rootViewController?.present(navigationController, animated: true, completion: nil)
                     }
                 )

+ 2 - 0
iOSClient/Select/NCSelect.swift

@@ -47,6 +47,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
     
     @objc var includeDirectoryE2EEncryption = false
     @objc var includeImages = false
+    @objc var enableSelectFile = false
     @objc var type = ""
     @objc var items: [Any] = []
     
@@ -409,6 +410,7 @@ extension NCSelect: UICollectionViewDelegate {
             visualController.typeOfCommandView = typeOfCommandView
             visualController.includeDirectoryE2EEncryption = includeDirectoryE2EEncryption
             visualController.includeImages = includeImages
+            visualController.enableSelectFile = enableSelectFile
             visualController.type = type
             visualController.overwrite = overwrite
             visualController.items = items

+ 2 - 8
iOSClient/Settings/CCManageAutoUpload.m

@@ -492,7 +492,7 @@
     return sectionName;
 }
 
-- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type items:(NSArray *)items buttonType:(NSString *)buttonType overwrite:(BOOL)overwrite
+- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type items:(NSArray *)items cancel:(BOOL)cancel overwrite:(BOOL)overwrite select:(BOOL)select copy:(BOOL)copy move:(BOOL)move
 {
     if (serverUrl != nil) {
         
@@ -513,13 +513,7 @@
      NCSelect *viewController = (NCSelect *)navigationController.topViewController;
      
      viewController.delegate = self;
-     viewController.typeOfCommandView = 0;
-     viewController.includeDirectoryE2EEncryption = false;
-     viewController.includeImages = false;
-     viewController.type = @"";
-//     viewController.hideButtonCreateFolder = false;
-//     viewController.selectFile = false;
-//     viewController.titleButtonDone = NSLocalizedString(@"_select_", nil);
+     viewController.typeOfCommandView = 1;
      
      [navigationController setModalPresentationStyle:UIModalPresentationFullScreen];
      [self presentViewController:navigationController animated:YES completion:^{

+ 1 - 0
iOSClient/Viewer/NCViewerRichdocument/NCViewerRichdocument.swift

@@ -155,6 +155,7 @@ class NCViewerRichdocument: UIViewController, WKNavigationDelegate, WKScriptMess
                 let viewController = navigationController.topViewController as! NCSelect
                 
                 viewController.delegate = self
+                viewController.enableSelectFile = true
 //                viewController.hideButtonCreateFolder = true
 //                viewController.selectFile = true
                 viewController.includeDirectoryE2EEncryption = false