From 5ea885b9227f6ffd8463e5829454dd1cb71104df 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 9f8de5dcc5..203d5b0fee 100644 --- a/iOSClient/Menu/NCViewer+Menu.swift +++ b/iOSClient/Menu/NCViewer+Menu.swift @@ -183,6 +183,11 @@ extension NCViewer { ) ) } + // COPY IN PASTEBOARD + // + if !webView, metadata.isCopyableInPasteboard { + actions.append(.copyAction(selectOcId: [metadata.ocId])) + } // // PDF From 0bab518f1672bf12dfd40ef99035b30cbd7a0575 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 | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/iOSClient/Menu/NCViewer+Menu.swift b/iOSClient/Menu/NCViewer+Menu.swift index 203d5b0fee..28e5c8358f 100644 --- a/iOSClient/Menu/NCViewer+Menu.swift +++ b/iOSClient/Menu/NCViewer+Menu.swift @@ -68,7 +68,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: ""), @@ -97,9 +97,9 @@ extension NCViewer { if !webView, metadata.canShare { actions.append(.share(selectedMetadatas: [metadata], viewController: viewController)) } - + // - // SAVE LIVE PHOTO + // PRINT // if let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata), let hudView = viewController.tabBarController?.view { @@ -124,13 +124,7 @@ extension NCViewer { icon: utility.loadImage(named: "doc.viewfinder", colors: [NCBrandColor.shared.iconImageColor]), action: { _ in if self.utilityFileSystem.fileProviderStorageExists(metadata) { - NotificationCenter.default.post( - name: Notification.Name(rawValue: NCGlobal.shared.notificationCenterDownloadedFile), - object: nil, - userInfo: ["ocId": metadata.ocId, - "selector": NCGlobal.shared.selectorSaveAsScan, - "error": NKError(), - "account": metadata.account]) + NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterDownloadedFile, userInfo: ["ocId": metadata.ocId, "selector": NCGlobal.shared.selectorPrint, "error": NKError(), "account": metadata.account]) } else { guard let metadata = NCManageDatabase.shared.setMetadatasSessionInWaitDownload(metadatas: [metadata], session: NextcloudKit.shared.nkCommonInstance.sessionIdentifierDownload, @@ -142,11 +136,19 @@ extension NCViewer { ) ) } + + // + // SAVE CAMERA ROLL + // + if !webView, metadata.isSavebleInCameraRoll { + actions.append(.saveMediaAction(selectedMediaMetadatas: [metadata])) + } + // // RENAME // - if !webView, metadata.isRenameable { + if !webView, metadata.isRenameable, !metadata.isDirectoryE2EE { actions.append( NCMenuAction( title: NSLocalizedString("_rename_", comment: ""), @@ -185,7 +187,7 @@ extension NCViewer { } // COPY IN PASTEBOARD // - if !webView, metadata.isCopyableInPasteboard { + if !webView, metadata.isCopyableInPasteboard, !metadata.isDirectoryE2EE { actions.append(.copyAction(selectOcId: [metadata.ocId])) } @@ -247,7 +249,7 @@ extension NCViewer { // DELETE // if !webView, metadata.isDeletable { - actions.append(.deleteAction(selectedMetadatas: [metadata], indexPaths: [], metadataFolder: nil, viewController: viewController)) + actions.append(.deleteAction(selectedMetadatas: [metadata], indexPath: [], metadataFolder: nil, viewController: viewController)) } viewController.presentMenu(with: actions)