From 04981ec99425b464cc55cc21adfd9c927b28baea 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 2906ef9a83..cd03047dba 100644 --- a/iOSClient/Menu/NCViewer+Menu.swift +++ b/iOSClient/Menu/NCViewer+Menu.swift @@ -162,6 +162,11 @@ extension NCViewer { ) ) } + // COPY IN PASTEBOARD + // + if !webView, metadata.isCopyableInPasteboard { + actions.append(.copyAction(selectOcId: [metadata.ocId])) + } // // PDF From 18dee94e35a368861ac01364ffd69f0b9a868811 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 cd03047dba..7ddbae05d2 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 FULL RESOLUTION @@ -164,7 +205,7 @@ extension NCViewer { } // COPY IN PASTEBOARD // - if !webView, metadata.isCopyableInPasteboard { + if !webView, metadata.isCopyableInPasteboard, !metadata.isDirectoryE2EE { actions.append(.copyAction(selectOcId: [metadata.ocId])) }