marinofaggiana 5 年之前
父節點
當前提交
eab200fb11

+ 28 - 0
iOSClient/Main/Menu/NCDetailNavigationController+Menu.swift

@@ -83,6 +83,34 @@ extension NCDetailNavigationController {
             )
         )
         
+        actions.append(
+            NCMenuAction(
+                title: NSLocalizedString("_move_or_copy_", comment: ""),
+                icon: CCGraphics.changeThemingColorImage(UIImage(named: "move"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
+                action: { menuAction in
+                    
+                    let storyboard = UIStoryboard(name: "NCSelect", bundle: nil)
+                    let navigationController = storyboard.instantiateInitialViewController() as! UINavigationController
+                    let viewController = navigationController.topViewController as! NCSelect
+                    
+                    viewController.delegate = self.appDelegate.activeDetail
+                    viewController.hideButtonCreateFolder = false
+                    viewController.selectFile = false
+                    viewController.includeDirectoryE2EEncryption = false
+                    viewController.includeImages = false
+                    viewController.type = ""
+                    viewController.titleButtonDone = NSLocalizedString("_move_", comment: "")
+                    viewController.titleButtonDone1 = NSLocalizedString("_copy_", comment: "")
+                    viewController.isButtonDone1Hide = false
+                    viewController.isOverwriteHide = false
+                    viewController.layoutViewSelect = k_layout_view_move
+                    
+                    navigationController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
+                    self.present(navigationController, animated: true, completion: nil)
+                }
+            )
+        )
+        
         actions.append(
             NCMenuAction(title: NSLocalizedString("_delete_", comment: ""),
                          icon: CCGraphics.changeThemingColorImage(UIImage(named: "trash"), width: 50, height: 50, color: .red),

+ 14 - 0
iOSClient/Main/NCDetailViewController.swift

@@ -231,6 +231,7 @@ class NCDetailViewController: UIViewController {
                     // IMAGE
                     if (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) && !mediaFilterImage {
                         
+                        deleteFile(notification)
                     }
                     
                     // OTHER
@@ -813,3 +814,16 @@ extension NCDetailViewController: NCViewerImageViewControllerDelegate, NCViewerI
         }
     }
 }
+
+//MARK: -
+
+extension NCDetailViewController: NCSelectDelegate {
+    
+    func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, buttonType: String, overwrite: Bool) {
+        
+        if let metadata = metadata, let serverUrl = serverUrl {
+            NCNetworking.sharedInstance.moveMetadata(metadata, serverUrlTo: serverUrl, overwrite: overwrite) { (errorCode, errorDescription) in }
+        }
+    }
+}
+