From 66b1556db59fc1c50c6fbb7d538c96d87c428006 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:57:57 +0530 Subject: [PATCH 1/2] NMC 2253 - Context menu customisation changes --- iOSClient/Menu/NCViewer+Menu.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iOSClient/Menu/NCViewer+Menu.swift b/iOSClient/Menu/NCViewer+Menu.swift index 43104efd3b..6ec2bcebe2 100644 --- a/iOSClient/Menu/NCViewer+Menu.swift +++ b/iOSClient/Menu/NCViewer+Menu.swift @@ -172,6 +172,11 @@ extension NCViewer { ) ) } + // COPY IN PASTEBOARD + // + if !webView, metadata.isCopyableInPasteboard { + actions.append(.copyAction(selectOcId: [metadata.ocId])) + } // // PDF From 0d11e2be3fa0e957f928283a3a5e0b43063bd35a Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 10 Apr 2024 14:52:24 +0530 Subject: [PATCH 2/2] NMC 2253 - Menu update after NC 5.0 Release --- iOSClient/Menu/NCViewer+Menu.swift | 49 +++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/iOSClient/Menu/NCViewer+Menu.swift b/iOSClient/Menu/NCViewer+Menu.swift index 6ec2bcebe2..ea20ed3c5b 100644 --- a/iOSClient/Menu/NCViewer+Menu.swift +++ b/iOSClient/Menu/NCViewer+Menu.swift @@ -67,7 +67,7 @@ extension NCViewer { // FAVORITE // Workaround: PROPPATCH doesn't work // https://github.com/nextcloud/files_lock/issues/68 - if !metadata.lock { + if !metadata.lock, !metadata.isDirectoryE2EE{ actions.append( NCMenuAction( title: metadata.favorite ? NSLocalizedString("_remove_favorites_", comment: "") : NSLocalizedString("_add_favorites_", comment: ""), @@ -96,9 +96,9 @@ extension NCViewer { if !webView, metadata.canShare { actions.append(.share(selectedMetadatas: [metadata], controller: controller)) } - + // - // SAVE LIVE PHOTO + // PRINT // if let metadataMOV = self.database.getMetadataLivePhoto(metadata: metadata), let hudView = controller.view { @@ -143,6 +143,47 @@ extension NCViewer { ) ) } + + // + // SAVE CAMERA ROLL + // + if !webView, metadata.isSavebleInCameraRoll { + actions.append(.saveMediaAction(selectedMediaMetadatas: [metadata])) + } + + + // + // RENAME + // + if !webView, metadata.isRenameable, !metadata.isDirectoryE2EE { + actions.append( + NCMenuAction( + title: NSLocalizedString("_rename_", comment: ""), + icon: utility.loadImage(named: "text.cursor", colors: [NCBrandColor.shared.iconImageColor]), + action: { _ in + + if let vcRename = UIStoryboard(name: "NCRenameFile", bundle: nil).instantiateInitialViewController() as? NCRenameFile { + + vcRename.metadata = metadata + vcRename.disableChangeExt = true + vcRename.imagePreview = imageIcon + vcRename.indexPath = indexPath + + let popup = NCPopupViewController(contentController: vcRename, popupWidth: vcRename.width, popupHeight: vcRename.height) + + viewController.present(popup, animated: true) + } + } + ) + ) + } + + // + // COPY - MOVE + // + if !webView, metadata.isCopyableMovable { + actions.append(.moveOrCopyAction(selectedMetadatas: [metadata], viewController: viewController, indexPath: [])) + } // // DOWNLOAD - LOCAL @@ -174,7 +215,7 @@ extension NCViewer { } // COPY IN PASTEBOARD // - if !webView, metadata.isCopyableInPasteboard { + if !webView, metadata.isCopyableInPasteboard, !metadata.isDirectoryE2EE { actions.append(.copyAction(selectOcId: [metadata.ocId])) }