From d6ae882f00e0a71df6ea118acca58cf4a1bf99d2 Mon Sep 17 00:00:00 2001 From: "Bernd.Rederlechner@t-systems.com" Date: Wed, 31 Jan 2024 10:02:05 +0100 Subject: [PATCH 01/50] Add custom build for debugging merge --- .github/workflows/nmc-custom-client.yml | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/nmc-custom-client.yml diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml new file mode 100644 index 0000000000..71ce2a4f46 --- /dev/null +++ b/.github/workflows/nmc-custom-client.yml @@ -0,0 +1,37 @@ +### +# SPDX-License-Identifier: AGPL-3.0 +# +# Author: Bernd rederlechner +# +# Builds a stable release package based on a release assembly +# customisation-- +# +# As soon as a package is deployed to production, the tag and the branch +# MUST STAY FOR 2 years and not deleted. +# +# Release packages, tags and customisation branches not delivered to production should +# be deleted asap a newer release is available. +# + +name: MCLOUD custom client merge + +on: + workflow_dispatch: + inputs: + branch: + type: choice + description: Custom build from base branch + options: + - master + - stable-4.9.7 + # - v3.0.8 + default: master + +jobs: + assemble-custom: + uses: nextmcloud/.github/.github/workflows/nmc-custom-client.yml@master + with: + trunk: 'master' + stable: ${{ inputs.branch }} + result: ${{ format('customisation-{0}-{1}', github.actor, inputs.branch) }} + secrets: inherit \ No newline at end of file From afec9db109997d602ca5a0355276ccc7533fe3d7 Mon Sep 17 00:00:00 2001 From: "Bernd.Rederlechner@t-systems.com" Date: Mon, 12 Feb 2024 16:37:32 +0100 Subject: [PATCH 02/50] Add script for automatic backport PR creation --- .github/workflows/nmc-custom-stables.yml | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/nmc-custom-stables.yml diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml new file mode 100644 index 0000000000..8062414c0f --- /dev/null +++ b/.github/workflows/nmc-custom-stables.yml @@ -0,0 +1,36 @@ +### +# SPDX-License-Identifier: AGPL-3.0 +# +# Author: Bernd rederlechner +# +# Builds a stable release package based on a release assembly +# customisation-- +# +# As soon as a package is deployed to production, the tag and the branch +# MUST STAY FOR 2 years and not deleted. +# +# Release packages, tags and customisation branches not delivered to production should +# be deleted asap a newer release is available. +# + +name: MCLOUD create stable backports + +on: + workflow_dispatch: + inputs: + branch: + type: choice + description: Custom build from base branch + options: + - stable-4.9.7 + - 4.9.6 + - 4.9.5 + default: stable-4.9.7 + +jobs: + backport-custom: + uses: nextmcloud/.github/.github/workflows/nmc-custom-stables.yml@master + with: + trunk: 'master' + stable: ${{ inputs.branch }} + secrets: inherit \ No newline at end of file From a7331f7f33eb2e6b28dfcd2578dd97ef110431f5 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:09:32 +0530 Subject: [PATCH 03/50] Update script for adding new stable branch --- .github/workflows/nmc-custom-stables.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 8062414c0f..9058d719ed 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,10 +22,11 @@ on: type: choice description: Custom build from base branch options: + - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-4.9.7 + default: stable-5.2.1 jobs: backport-custom: @@ -33,4 +34,4 @@ jobs: with: trunk: 'master' stable: ${{ inputs.branch }} - secrets: inherit \ No newline at end of file + secrets: inherit From 6d5d658ff791bd0999128fa92003e9e9086214e6 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 15 Apr 2024 18:28:46 +0530 Subject: [PATCH 04/50] Update stable branch 5.2.7 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 9058d719ed..c1b444820d 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,11 +22,12 @@ on: type: choice description: Custom build from base branch options: + - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.2.1 + default: stable-5.2.7 jobs: backport-custom: From 1fad2c6c0a0e2b1c9e8f55c3ac376c178a44f961 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 22 May 2024 12:27:39 +0530 Subject: [PATCH 05/50] Update new version 5.2.7 --- .github/workflows/nmc-custom-client.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 71ce2a4f46..bffac0f70b 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -24,6 +24,8 @@ on: options: - master - stable-4.9.7 + - stable-5.2.1 + - stable-5.2.7 # - v3.0.8 default: master @@ -34,4 +36,4 @@ jobs: trunk: 'master' stable: ${{ inputs.branch }} result: ${{ format('customisation-{0}-{1}', github.actor, inputs.branch) }} - secrets: inherit \ No newline at end of file + secrets: inherit From 4780986bc32051b287d753ee7d7c8495267997c4 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 26 Jul 2024 13:58:51 +0530 Subject: [PATCH 06/50] Update nmc-custom-client.yml --- .github/workflows/nmc-custom-client.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index bffac0f70b..42f6190758 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -26,6 +26,7 @@ on: - stable-4.9.7 - stable-5.2.1 - stable-5.2.7 + - stable-5.5.0 # - v3.0.8 default: master From 00d0e3c9f331ff2294e1ae493f6aab26c1e7a510 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:07:07 +0530 Subject: [PATCH 07/50] Update nmc-custom-stables.yml Added new stable 5.5.4 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index c1b444820d..aa1b6ca733 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,12 +22,13 @@ on: type: choice description: Custom build from base branch options: + - stable-5.5.4 - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.2.7 + default: stable-5.5.4 jobs: backport-custom: From 3a8c54fc77deff5199325e7a89f1205e9f00e5c5 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:41:09 +0530 Subject: [PATCH 08/50] Update nmc-custom-stables.yml for NC stable 5.5.5 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index aa1b6ca733..a9c6fa2b9d 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,13 +22,14 @@ on: type: choice description: Custom build from base branch options: + - stable-5.5.5 - stable-5.5.4 - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.5.4 + default: stable-5.5.5 jobs: backport-custom: From df6dfb5bf40f539e3400a39aab931725ef7d1cc1 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:42:57 +0530 Subject: [PATCH 09/50] Update nmc-custom-client.yml for NC Stable 5.5.5 --- .github/workflows/nmc-custom-client.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 42f6190758..1c140fefec 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -27,6 +27,7 @@ on: - stable-5.2.1 - stable-5.2.7 - stable-5.5.0 + - stable-5.5.5 # - v3.0.8 default: master From 8b011db56072cd6a057553f53b4d13f0dbaea66c Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 18 Nov 2024 14:57:36 +0530 Subject: [PATCH 10/50] Update nmc-custom-stables.yml for stable-6.1.3 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index a9c6fa2b9d..58cb823f28 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.1.3 - stable-5.5.5 - stable-5.5.4 - stable-5.2.7 @@ -29,7 +30,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.5.5 + default: stable-6.1.3 jobs: backport-custom: From 0ed65b2963e7f71746a4ae6de9c6de604ee517d0 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 31 Mar 2025 14:56:50 +0530 Subject: [PATCH 11/50] Update nmc-custom-stables.yml Update nmc-custom-stables.yml for NC stable-6.2.7 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 58cb823f28..6494e6bb04 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 - stable-5.5.4 @@ -30,7 +31,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.1.3 + default: stable-6.2.7 jobs: backport-custom: From f7d49f9a1d8234d794d5f8c7edea3eb3781ed947 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 31 Mar 2025 14:59:30 +0530 Subject: [PATCH 12/50] Update nmc-custom-client.yml Update nmc-custom-client.yml for NC Stable 6.2.7 --- .github/workflows/nmc-custom-client.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 1c140fefec..d7f0c57da2 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -28,6 +28,8 @@ on: - stable-5.2.7 - stable-5.5.0 - stable-5.5.5 + - stable-6.1.3 + - stable-6.2.7 # - v3.0.8 default: master From 25b24844da6cc7df00f2d290ab994bfc220366c2 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Wed, 16 Apr 2025 17:45:12 +0530 Subject: [PATCH 13/50] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 6494e6bb04..5ddb738302 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.6.0 - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 @@ -31,7 +32,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.2.7 + default: stable-6.6.0 jobs: backport-custom: From d1570d30c4fe29a600e6984198cb9a3d8fb49b3e Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 13:56:34 +0530 Subject: [PATCH 14/50] Update nmc-custom-stables.yml for NC Stable 6.5.0 --- .github/workflows/nmc-custom-stables.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 5ddb738302..d418101a89 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,7 +22,7 @@ on: type: choice description: Custom build from base branch options: - - stable-6.6.0 + - stable-6.5.0 - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 @@ -32,7 +32,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.6.0 + default: stable-6.5.0 jobs: backport-custom: From a668307181a03c8afcddb815bf8080d7a53f590c Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 15:23:20 +0530 Subject: [PATCH 15/50] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index d418101a89..ac0f14243f 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.6.0 - stable-6.5.0 - stable-6.2.7 - stable-6.1.3 @@ -32,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.5.0 + default: stable-6.6.0 jobs: backport-custom: From 87724b033fb1890c447a28930b9139990d701152 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 16/50] NMC 2161 - Menu option images and color theming changes --- .../File Provider Extension UI.xcscheme | 1 - .../WidgetDashboardIntentHandler.xcscheme | 1 - .../NCSelectableNavigationView.swift | 104 ++++++ iOSClient/Menu/AppDelegate+Menu.swift | 319 ++++++++++++++++++ 4 files changed, 423 insertions(+), 2 deletions(-) create mode 100644 iOSClient/Main/Collection Common/NCSelectableNavigationView.swift create mode 100644 iOSClient/Menu/AppDelegate+Menu.swift diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index fd16f58a63..6e1cc593fa 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 485c4c3f00..d912dd669b 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift new file mode 100644 index 0000000000..6f337e7f5a --- /dev/null +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -0,0 +1,104 @@ +// +// NCSelectableNavigationView.swift +// Nextcloud +// +// Created by Henrik Storch on 27.01.22. +// Copyright © 2022 Henrik Storch. All rights reserved. +// +// Author Marino Faggiana +// Author Henrik Storch +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +import NextcloudKit +import Realm +import UIKit + +extension RealmSwiftObject { + var primaryKeyValue: String? { + guard let primaryKeyName = self.objectSchema.primaryKeyProperty?.name else { return nil } + return value(forKey: primaryKeyName) as? String + } +} + +public protocol NCSelectableViewTabBar { + var tabBarController: UITabBarController? { get } + var hostingController: UIViewController? { get } +} + +protocol NCSelectableNavigationView: AnyObject { + var viewController: UIViewController { get } + var appDelegate: AppDelegate { get } + var selectableDataSource: [RealmSwiftObject] { get } + var collectionView: UICollectionView! { get set } + var isEditMode: Bool { get set } + var selectOcId: [String] { get set } + var selectIndexPaths: [IndexPath] { get set } + var titleCurrentFolder: String { get } + var navigationItem: UINavigationItem { get } + var navigationController: UINavigationController? { get } + var layoutKey: String { get } + var serverUrl: String { get } + var tabBarSelect: NCSelectableViewTabBar? { get set } + + func reloadDataSource(withQueryDB: Bool) + func setNavigationLeftItems() + func setNavigationRightItems(enableMenu: Bool) + func createMenuActions() -> [NCMenuAction] + + func toggleSelect(isOn: Bool?) + func onListSelected() + func onGridSelected() +} + +extension NCSelectableNavigationView { + func setNavigationLeftItems() {} + + func saveLayout(_ layoutForView: NCDBLayoutForView) { + NCManageDatabase.shared.setLayoutForView(layoutForView: layoutForView) + NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource) + setNavigationRightItems(enableMenu: false) + } + + /// If explicit `isOn` is not set, it will invert `isEditMode` + func toggleSelect(isOn: Bool? = nil) { + DispatchQueue.main.async { + self.isEditMode = isOn ?? !self.isEditMode + self.selectOcId.removeAll() + self.selectIndexPaths.removeAll() + self.setNavigationLeftItems() + self.setNavigationRightItems(enableMenu: true) + self.collectionView.reloadData() + } + } + + func collectionViewSelectAll() { + selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) + collectionView.reloadData() + setNavigationRightItems(enableMenu: false) + } + + func tapNotification() { + if let viewController = UIStoryboard(name: "NCNotification", bundle: nil).instantiateInitialViewController() as? NCNotification { + navigationController?.pushViewController(viewController, animated: true) + } + } +} + +extension NCSelectableNavigationView where Self: UIViewController { + var viewController: UIViewController { + self + } +} diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift new file mode 100644 index 0000000000..7041b8eaa9 --- /dev/null +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -0,0 +1,319 @@ +// +// AppDelegate+Menu.swift +// Nextcloud +// +// Created by Philippe Weidmann on 24.01.20. +// Copyright © 2020 Philippe Weidmann. All rights reserved. +// Copyright © 2020 Marino Faggiana All rights reserved. +// +// Author Philippe Weidmann +// Author Marino Faggiana +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +import UIKit +import FloatingPanel +import NextcloudKit + +extension AppDelegate { + func toggleMenu(controller: NCMainTabBarController, sender: Any?) { + var actions: [NCMenuAction] = [] + let session = NCSession.shared.getSession(controller: controller) + let utilityFileSystem = NCUtilityFileSystem() + let serverUrl = controller.currentServerUrl() + let isDirectoryE2EE = NCUtilityFileSystem().isDirectoryE2EE(serverUrl: serverUrl, account: session.account) + let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)) + let utility = NCUtility() + let capabilities = NKCapabilities.shared.getCapabilitiesBlocking(for: session.account) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_upload_photos_videos_", comment: ""), + icon: utility.loadImage(named: "photo", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in + if hasPermission {NCPhotosPickerViewController(controller: controller, maxSelectedAssets: 0, singleSelectedMode: false) + } + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_upload_file_", comment: ""), + icon: utility.loadImage(named: "doc", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) + } + ) + ) + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "text" }), + !isDirectoryE2EE { + actions.append( + NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), + icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + Task { + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + creator.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + NCCreateDocument().createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "text", creatorId: creator.identifier, templateId: "document", account: session.account) + } +// let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! +// guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { +// return +// } +// navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorText +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.editorText +// viewController.serverUrl = appDelegate.activeServerUrl +// viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") +// appDelegate.window?.rootViewController?.present(navigationController, animated: true, completion: nil) +// } + }) + ) + } + + actions.append( + NCMenuAction( + title: NSLocalizedString("_scans_document_", comment: ""), + icon: utility.loadImage(named: "doc.text.viewfinder", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCDocumentCamera.shared.openScannerDocument(viewController: controller) + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_voice_memo_", comment: ""), + icon: utility.loadImage(named: "mic", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in + if hasPermission { + if let viewController = UIStoryboard(name: "NCAudioRecorderViewController", bundle: nil).instantiateInitialViewController() as? NCAudioRecorderViewController { + viewController.controller = controller + viewController.modalTransitionStyle = .crossDissolve + viewController.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext + controller.present(viewController, animated: true, completion: nil) + } + } + } + } + ) + ) + + if NCKeychain().isEndToEndEnabled(account: session.account) { + actions.append(.seperator(order: 0, sender: sender)) + } + + let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") + let imageCreateFolder = isDirectoryE2EE ? NCImageCache.shared.getFolderEncrypted(account: session.account) : NCImageCache.shared.getFolder(account: session.account) + actions.append( + NCMenuAction(title: titleCreateFolder, + icon: imageCreateFolder, + sender: sender, + action: { _ in + let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, sceneIdentifier: controller.sceneIdentifier) + controller.present(alertController, animated: true, completion: nil) + } + ) + ) + + // Folder encrypted + if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { + // Folder encrypted (ONLY ROOT) +// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: appDelegate.account) && (NCUtilityFileSystem().getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) == appDelegate.activeServerUrl) { + actions.append( + NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), + icon: NCImageCache.shared.getFolderEncrypted(account: session.account), + sender: sender, + action: { _ in + let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) + controller.present(alertController, animated: true, completion: nil) + }) + ) + } + + if NCKeychain().isEndToEndEnabled(account: session.account) { + actions.append(.seperator(order: 0, sender: sender)) + } + + if capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { + actions.append( + NCMenuAction( + title: NSLocalizedString("_add_folder_info_", comment: ""), + icon: NCUtility().loadImage(named: "list.dash.header.rectangle", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + let richWorkspaceCommon = NCRichWorkspaceCommon() + if let viewController = controller.currentViewController() { + if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", + session.account, + serverUrl, + NCGlobal.shared.fileNameRichWorkspace.lowercased())) == nil { + richWorkspaceCommon.createViewerNextcloudText(serverUrl: serverUrl, viewController: viewController, session: session) + } else { + richWorkspaceCommon.openViewerNextcloudText(serverUrl: serverUrl, viewController: viewController, session: session) + } + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_docx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_document_", comment: ""), + icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.documentIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_xlsx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), + icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_pptx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_presentation_", comment: ""), + icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if capabilities.richDocumentsEnabled { + if NextcloudKit.shared.isNetworkReachable() && !isDirectoryE2EE { + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_document_", comment: ""), + icon: utility.loadImage(named: "doc.richtext", colors: [NCBrandColor.shared.documentIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), + icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_presentation_", comment: ""), + icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + } + + controller.presentMenu(with: actions, controller: controller, sender: sender) + } +} From 400349e1cb9da1e3e64b1f704784898a7b609072 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 17/50] NMC 2161 - Menu option images and color theming and other changes --- Nextcloud.xcodeproj/project.pbxproj | 8 ++ .../File Provider Extension UI.xcscheme | 1 + .../WidgetDashboardIntentHandler.xcscheme | 1 + iOSClient/Menu/AppDelegate+Menu.swift | 127 ++++++++++++++---- 4 files changed, 112 insertions(+), 25 deletions(-) diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj index 8dd4c5545f..3072bcce21 100644 --- a/Nextcloud.xcodeproj/project.pbxproj +++ b/Nextcloud.xcodeproj/project.pbxproj @@ -85,6 +85,10 @@ AFCE353527E4ED5900FEA6C2 /* DateFormatter+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */; }; AFCE353727E4ED7B00FEA6C2 /* NCShareCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */; }; AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* Shareable.swift */; }; + AFCE353927E5DE0500FEA6C2 /* NCShare+Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */; }; + B52FAED52DA8F616001AB1BD /* NCSelectableNavigationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */; }; + C04E2F232A17BB4D001BAD85 /* FilesIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04E2F222A17BB4D001BAD85 /* FilesIntegrationTests.swift */; }; + D575039F27146F93008DC9DC /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extension.swift */; }; D5B6AA7827200C7200D49C24 /* NCActivityTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */; }; F310B1EF2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */; }; F321DA8A2B71205A00DDA0E6 /* NCTrashSelectTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F321DA892B71205A00DDA0E6 /* NCTrashSelectTabBar.swift */; }; @@ -1221,6 +1225,8 @@ AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+Extension.swift"; sourceTree = ""; }; AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareCells.swift; sourceTree = ""; }; AFCE353827E5DE0400FEA6C2 /* Shareable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shareable.swift; sourceTree = ""; }; + AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCShare+Helper.swift"; sourceTree = ""; }; + B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSelectableNavigationView.swift; sourceTree = ""; }; C0046CDA2A17B98400D87C9D /* NextcloudUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; C04E2F202A17BB4D001BAD85 /* NextcloudIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = ""; }; @@ -2464,6 +2470,7 @@ F7603298252F0E550015A421 /* Collection Common */ = { isa = PBXGroup; children = ( + B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */, F75FE06B2BB01D0D00A0EFEF /* Cell */, F78ACD50219046AC0088454D /* Section Header Footer */, F70D7C3525FFBF81002B9E34 /* NCCollectionViewCommon.swift */, @@ -4684,6 +4691,7 @@ F76882232C0DD1E7001CF441 /* NCCapabilitiesModel.swift in Sources */, F7E2B64F2DDCC5C30075B4D0 /* NCMedia+TransferDelegate.swift in Sources */, F7D68FCC28CB9051009139F3 /* NCManageDatabase+DashboardWidget.swift in Sources */, + B52FAED52DA8F616001AB1BD /* NCSelectableNavigationView.swift in Sources */, F76882292C0DD1E7001CF441 /* NCManageE2EEModel.swift in Sources */, F799DF8B2C4B84EB003410B5 /* NCCollectionViewCommon+EndToEndInitialize.swift in Sources */, F7CCAB512ECF316700F8E68B /* NCCollectionViewCommon+SyncMetadata.swift in Sources */, diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 6e1cc593fa..fd16f58a63 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index d912dd669b..485c4c3f00 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index 7041b8eaa9..a06680d3e9 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -41,7 +41,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_upload_photos_videos_", comment: ""), - icon: utility.loadImage(named: "photo", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in @@ -55,7 +55,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_upload_file_", comment: ""), - icon: utility.loadImage(named: "doc", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) @@ -68,7 +68,7 @@ extension AppDelegate { !isDirectoryE2EE { actions.append( NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), - icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in Task { @@ -86,9 +86,9 @@ extension AppDelegate { // viewController.editorId = NCGlobal.shared.editorText // viewController.creatorId = directEditingCreator.identifier // viewController.typeTemplate = NCGlobal.shared.editorText -// viewController.serverUrl = appDelegate.activeServerUrl +// viewController.serverUrl = serverUrl // viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") -// appDelegate.window?.rootViewController?.present(navigationController, animated: true, completion: nil) +// controller.present(navigationController, animated: true, completion: nil) // } }) ) @@ -97,7 +97,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_scans_document_", comment: ""), - icon: utility.loadImage(named: "doc.text.viewfinder", colors: [NCBrandColor.shared.iconImageColor]), + icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCDocumentCamera.shared.openScannerDocument(viewController: controller) @@ -108,7 +108,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_voice_memo_", comment: ""), - icon: utility.loadImage(named: "mic", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in @@ -130,7 +130,7 @@ extension AppDelegate { } let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") - let imageCreateFolder = isDirectoryE2EE ? NCImageCache.shared.getFolderEncrypted(account: session.account) : NCImageCache.shared.getFolder(account: session.account) + let imageCreateFolder = isDirectoryE2EE ? UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50) : UIImage(named: "addFolder")! actions.append( NCMenuAction(title: titleCreateFolder, icon: imageCreateFolder, @@ -145,10 +145,10 @@ extension AppDelegate { // Folder encrypted if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { // Folder encrypted (ONLY ROOT) -// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: appDelegate.account) && (NCUtilityFileSystem().getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) == appDelegate.activeServerUrl) { +// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { actions.append( NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), - icon: NCImageCache.shared.getFolderEncrypted(account: session.account), + icon: UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) @@ -165,7 +165,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_add_folder_info_", comment: ""), - icon: NCUtility().loadImage(named: "list.dash.header.rectangle", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in let richWorkspaceCommon = NCRichWorkspaceCommon() @@ -190,17 +190,30 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_document_", comment: ""), - icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.documentIconColor]), + icon: UIImage(named: "create_file_document")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + // if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + // viewController.editorId = NCGlobal.shared.editorOnlyoffice + // viewController.creatorId = directEditingCreator.identifier + // viewController.typeTemplate = NCGlobal.shared.templateDocument + // viewController.serverUrl = serverUrl + // viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") + // + // controller.present(navigationController, animated: true, completion: nil) + // } } } ) @@ -213,10 +226,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + icon: UIImage(named: "create_file_xls")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) @@ -224,6 +241,15 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorOnlyoffice +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -236,10 +262,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + icon: UIImage(named: "create_file_ppt")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) @@ -247,6 +277,15 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorOnlyoffice +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.templatePresentation +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -258,10 +297,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_document_", comment: ""), - icon: utility.loadImage(named: "doc.richtext", colors: [NCBrandColor.shared.documentIconColor]), + icon: UIImage(named: "create_file_document")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) @@ -269,6 +312,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templateDocument +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -277,10 +328,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + icon: UIImage(named: "create_file_xls")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) @@ -288,6 +343,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -296,10 +359,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + icon: UIImage(named: "create_file_ppt")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) @@ -307,6 +374,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templatePresentation +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -314,6 +389,8 @@ extension AppDelegate { } } - controller.presentMenu(with: actions, controller: controller, sender: sender) +// controller.presentMenu(with: actions, controller: controller, sender: sender) + AnalyticsHelper.shared.trackEvent(eventName: .EVENT__ACTION_BUTTON) + controller.presentMenu(with: actions) } } From 1a79041be55da5839401e808ab9d1d019f777977 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 18/50] NMC 2161 - Menu option changes --- .../NCSelectableNavigationView.swift | 22 +- iOSClient/Menu/AppDelegate+Menu.swift | 262 ++++++------------ 2 files changed, 94 insertions(+), 190 deletions(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 6f337e7f5a..94715d4e44 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,20 +40,17 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } - var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } - var selectOcId: [String] { get set } - var selectIndexPaths: [IndexPath] { get set } + var fileSelect: [String] { get set } var titleCurrentFolder: String { get } var navigationItem: UINavigationItem { get } var navigationController: UINavigationController? { get } var layoutKey: String { get } var serverUrl: String { get } - var tabBarSelect: NCSelectableViewTabBar? { get set } - func reloadDataSource(withQueryDB: Bool) +// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] @@ -76,8 +73,7 @@ extension NCSelectableNavigationView { func toggleSelect(isOn: Bool? = nil) { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode - self.selectOcId.removeAll() - self.selectIndexPaths.removeAll() + self.fileSelect.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -85,7 +81,8 @@ extension NCSelectableNavigationView { } func collectionViewSelectAll() { - selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) + + fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) } @@ -95,6 +92,15 @@ extension NCSelectableNavigationView { navigationController?.pushViewController(viewController, animated: true) } } + + func tapTransfer() { + if let navController = UIStoryboard(name: "NCTransfers", bundle: nil).instantiateInitialViewController() as? UINavigationController, + let viewController = navController.topViewController as? NCTransfers { + viewController.modalPresentationStyle = .pageSheet +// self.present(navigationController, animated: true, completion: nil) + navigationController?.present(navController, animated: true, completion: nil) + } + } } extension NCSelectableNavigationView where Self: UIViewController { diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index a06680d3e9..c2f3307daf 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -28,22 +28,18 @@ import FloatingPanel import NextcloudKit extension AppDelegate { - func toggleMenu(controller: NCMainTabBarController, sender: Any?) { + func toggleMenu(controller: NCMainTabBarController) { var actions: [NCMenuAction] = [] let session = NCSession.shared.getSession(controller: controller) - let utilityFileSystem = NCUtilityFileSystem() + let directEditingCreators = NCManageDatabase.shared.getDirectEditingCreators(account: session.account) let serverUrl = controller.currentServerUrl() let isDirectoryE2EE = NCUtilityFileSystem().isDirectoryE2EE(serverUrl: serverUrl, account: session.account) let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)) let utility = NCUtility() - let capabilities = NKCapabilities.shared.getCapabilitiesBlocking(for: session.account) actions.append( NCMenuAction( - title: NSLocalizedString("_upload_photos_videos_", comment: ""), - icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_upload_photos_videos_", comment: ""), icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in if hasPermission {NCPhotosPickerViewController(controller: controller, maxSelectedAssets: 0, singleSelectedMode: false) } @@ -54,52 +50,35 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_upload_file_", comment: ""), - icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_upload_file_", comment: ""), icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) } ) ) - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "text" }), - !isDirectoryE2EE { + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorText}) && !isDirectoryE2EE { actions.append( - NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), - icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in - Task { - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + creator.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - - NCCreateDocument().createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "text", creatorId: creator.identifier, templateId: "document", account: session.account) - } -// let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! -// guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { -// return -// } -// navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorText -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.editorText -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") -// controller.present(navigationController, animated: true, completion: nil) -// } + NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorText + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.editorText + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") + controller.present(navigationController, animated: true, completion: nil) + } }) ) } actions.append( NCMenuAction( - title: NSLocalizedString("_scans_document_", comment: ""), - icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_scans_document_", comment: ""), icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCDocumentCamera.shared.openScannerDocument(viewController: controller) } ) @@ -107,10 +86,7 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_voice_memo_", comment: ""), - icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_create_voice_memo_", comment: ""), icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in if hasPermission { if let viewController = UIStoryboard(name: "NCAudioRecorderViewController", bundle: nil).instantiateInitialViewController() as? NCAudioRecorderViewController { @@ -126,30 +102,25 @@ extension AppDelegate { ) if NCKeychain().isEndToEndEnabled(account: session.account) { - actions.append(.seperator(order: 0, sender: sender)) + actions.append(.seperator(order: 0)) } let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") let imageCreateFolder = isDirectoryE2EE ? UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50) : UIImage(named: "addFolder")! actions.append( NCMenuAction(title: titleCreateFolder, - icon: imageCreateFolder, - sender: sender, - action: { _ in + icon: imageCreateFolder, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, sceneIdentifier: controller.sceneIdentifier) controller.present(alertController, animated: true, completion: nil) } ) ) - // Folder encrypted - if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { // Folder encrypted (ONLY ROOT) -// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { + if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { actions.append( NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), icon: UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) controller.present(alertController, animated: true, completion: nil) @@ -158,16 +129,13 @@ extension AppDelegate { } if NCKeychain().isEndToEndEnabled(account: session.account) { - actions.append(.seperator(order: 0, sender: sender)) + actions.append(.seperator(order: 0)) } - if capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { + if NCCapabilities.shared.getCapabilities(account: session.account).capabilityServerVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { actions.append( NCMenuAction( - title: NSLocalizedString("_add_folder_info_", comment: ""), - icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_add_folder_info_", comment: ""), icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in let richWorkspaceCommon = NCRichWorkspaceCommon() if let viewController = controller.currentViewController() { if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", @@ -184,142 +152,95 @@ extension AppDelegate { ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_docx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeDocx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeDocx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_document_", comment: ""), - icon: UIImage(named: "create_file_document")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_document_", comment: ""), icon: UIImage(named: "create_file_document")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) - // if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { - // viewController.editorId = NCGlobal.shared.editorOnlyoffice - // viewController.creatorId = directEditingCreator.identifier - // viewController.typeTemplate = NCGlobal.shared.templateDocument - // viewController.serverUrl = serverUrl - // viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") - // - // controller.present(navigationController, animated: true, completion: nil) - // } + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templateDocument + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") + + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_xlsx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeXlsx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeXlsx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: UIImage(named: "create_file_xls")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), icon: UIImage(named: "create_file_xls")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorOnlyoffice -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_pptx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficePptx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficePptx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: UIImage(named: "create_file_ppt")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_presentation_", comment: ""), icon: UIImage(named: "create_file_ppt")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templatePresentation + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorOnlyoffice -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.templatePresentation -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if capabilities.richDocumentsEnabled { + if NCCapabilities.shared.getCapabilities(account: session.account).capabilityRichDocumentsEnabled { if NextcloudKit.shared.isNetworkReachable() && !isDirectoryE2EE { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_document_", comment: ""), - icon: UIImage(named: "create_file_document")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_document_", comment: ""), icon: UIImage(named: "create_file_document")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templateDocument + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templateDocument -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -327,30 +248,19 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: UIImage(named: "create_file_xls")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), icon: UIImage(named: "create_file_xls")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -358,30 +268,19 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: UIImage(named: "create_file_ppt")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_presentation_", comment: ""), icon: UIImage(named: "create_file_ppt")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templatePresentation + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templatePresentation -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -389,7 +288,6 @@ extension AppDelegate { } } -// controller.presentMenu(with: actions, controller: controller, sender: sender) AnalyticsHelper.shared.trackEvent(eventName: .EVENT__ACTION_BUTTON) controller.presentMenu(with: actions) } From 6a05092f834da18bafa3cb8e09ef0a6c1ff16ef7 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 13:56:34 +0530 Subject: [PATCH 19/50] Update nmc-custom-stables.yml for NC Stable 6.5.0 --- .github/workflows/nmc-custom-stables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index ac0f14243f..2ec6976ef2 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -33,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.6.0 + default: stable-6.5.0 jobs: backport-custom: From ac5c8c3aa14f5930371004dd376377ec6ecdbd46 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 15:23:20 +0530 Subject: [PATCH 20/50] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 2ec6976ef2..ac0f14243f 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -33,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.5.0 + default: stable-6.6.0 jobs: backport-custom: From c97a06ba60929d8678642e46ada78107bbe96656 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 21/50] NMC 2161 - Menu option images and color theming changes --- .../xcschemes/File Provider Extension UI.xcscheme | 1 - .../xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 - .../Main/Collection Common/NCSelectableNavigationView.swift | 5 +++++ iOSClient/Menu/AppDelegate+Menu.swift | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index fd16f58a63..6e1cc593fa 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 485c4c3f00..d912dd669b 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 94715d4e44..04b08c5606 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -44,6 +44,8 @@ protocol NCSelectableNavigationView: AnyObject { var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } + var appDelegate: AppDelegate { get } + var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } var navigationItem: UINavigationItem { get } var navigationController: UINavigationController? { get } @@ -51,6 +53,9 @@ protocol NCSelectableNavigationView: AnyObject { var serverUrl: String { get } // func reloadDataSource(withQueryDB: Bool) + var tabBarSelect: NCSelectableViewTabBar? { get set } + + func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index c2f3307daf..f228bdd55a 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,6 +170,7 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) + } } ) From 5dd84d2c67997d6b0b8b38c7adb0929a25e95d0c Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 22/50] NMC 2161 - Menu option images and color theming and other changes --- .../xcshareddata/xcschemes/File Provider Extension UI.xcscheme | 1 + .../xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 + iOSClient/Menu/AppDelegate+Menu.swift | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 6e1cc593fa..fd16f58a63 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index d912dd669b..485c4c3f00 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index f228bdd55a..c2f3307daf 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,7 +170,6 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) - } } ) From 7a41f9350d492ac2e7d196909c18393abc36bf76 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 23/50] NMC 2161 - Menu option changes --- .../Main/Collection Common/NCSelectableNavigationView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 04b08c5606..2e07da992e 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -55,7 +55,7 @@ protocol NCSelectableNavigationView: AnyObject { // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } - func reloadDataSource(withQueryDB: Bool) +// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] From 84575283a8e81df590ac2438e2fadb2c3a8cec86 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Tue, 16 Dec 2025 14:59:08 +0530 Subject: [PATCH 24/50] NMC 2161 - Menu option changes --- .../NCSelectableNavigationView.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 2e07da992e..17dbb04c03 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,10 +40,17 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } +// var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } +// var selectIndexPaths: [IndexPath] { get set } + var appDelegate: AppDelegate { get } + var selectableDataSource: [RealmSwiftObject] { get } + var collectionView: UICollectionView! { get set } + var isEditMode: Bool { get set } + var selectOcId: [String] { get set } var appDelegate: AppDelegate { get } var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } @@ -51,10 +58,13 @@ protocol NCSelectableNavigationView: AnyObject { var navigationController: UINavigationController? { get } var layoutKey: String { get } var serverUrl: String { get } +// var tabBarSelect: NCSelectableViewTabBar? { get set } +// var dataSource: NCCollectionViewDataSource { get set } // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } + func reloadDataSource(withQueryDB: Bool) // func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) @@ -79,6 +89,9 @@ extension NCSelectableNavigationView { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode self.fileSelect.removeAll() +// self.selectIndexPaths.removeAll() + self.selectOcId.removeAll() + self.selectIndexPaths.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -88,6 +101,8 @@ extension NCSelectableNavigationView { func collectionViewSelectAll() { fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) +// fileSelect = NCCollectionViewDataSource().getMetadataSourceForAllSections().compactMap({ $0.primaryKeyValue }) +// selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) } From e533e0f3de1ab083ed805fc02b4d7a46913affdc Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Sat, 27 Dec 2025 02:35:25 +0000 Subject: [PATCH 25/50] fix(l10n): Update translations from Transifex Signed-off-by: Nextcloud bot --- .../cs-CZ.lproj/Localizable.strings | Bin 94664 -> 94694 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings b/iOSClient/Supporting Files/cs-CZ.lproj/Localizable.strings index 01bfdce06e32bc76c8ff4388e5e1057c8e061de3..238493e1130c845679ac2dccc7833ee3df57c331 100644 GIT binary patch delta 83 zcmX@{nDyCX)(r>PrzZt4idg3|WHRIdaV|q5Lk^IxVkl+EVn}5u0b&IPeIN$ORA5ul N{E>b8M|Q^RnE>Pd7SsR$ delta 68 zcmaF%nDxYC)(r>PCqIy4(Jf$5U?^e82a>rAnGAVA45F(TQh_4+V9`W|3Ycg!KgV`{ I4#w-50J%~TzyJUM From bc7de9df37190f1bb089bf7000c985d81e08026f Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Mon, 29 Dec 2025 02:37:59 +0000 Subject: [PATCH 26/50] fix(l10n): Update translations from Transifex Signed-off-by: Nextcloud bot --- .../zh-Hans.lproj/Localizable.strings | Bin 65854 -> 65806 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/iOSClient/Supporting Files/zh-Hans.lproj/Localizable.strings b/iOSClient/Supporting Files/zh-Hans.lproj/Localizable.strings index 813b4ee44abb0f05b45a6e9a99ed5ab52385730e..a7f2a57fbffd2f37e72e79c6429139c96289e627 100644 GIT binary patch delta 104 zcmdnj#M0NqvSAv#$j*Y_flvJy()nY=g7p~~($yoyf+zbKOKg6`F0n@Nu75=Imo&>% z`Tt4`)(l(>N|XIh=}w*?EHF7@%M&Kvrpb0&4+*VEXek3JVvAYb!P~?f&tx!pfsVpv IqisCi0KRo4=Kufz delta 152 zcmeBcV%gWkvSAv#NeDwCLji*VLkUAZkj!PsWXJ6*Jf~C^1+wa4{%NmOrICxjtDIWj; From 9fc349be515fd2f3555920025b5b40130f4bacb8 Mon Sep 17 00:00:00 2001 From: "Bernd.Rederlechner@t-systems.com" Date: Wed, 31 Jan 2024 10:02:05 +0100 Subject: [PATCH 27/50] Add custom build for debugging merge --- .github/workflows/nmc-custom-client.yml | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/nmc-custom-client.yml diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml new file mode 100644 index 0000000000..71ce2a4f46 --- /dev/null +++ b/.github/workflows/nmc-custom-client.yml @@ -0,0 +1,37 @@ +### +# SPDX-License-Identifier: AGPL-3.0 +# +# Author: Bernd rederlechner +# +# Builds a stable release package based on a release assembly +# customisation-- +# +# As soon as a package is deployed to production, the tag and the branch +# MUST STAY FOR 2 years and not deleted. +# +# Release packages, tags and customisation branches not delivered to production should +# be deleted asap a newer release is available. +# + +name: MCLOUD custom client merge + +on: + workflow_dispatch: + inputs: + branch: + type: choice + description: Custom build from base branch + options: + - master + - stable-4.9.7 + # - v3.0.8 + default: master + +jobs: + assemble-custom: + uses: nextmcloud/.github/.github/workflows/nmc-custom-client.yml@master + with: + trunk: 'master' + stable: ${{ inputs.branch }} + result: ${{ format('customisation-{0}-{1}', github.actor, inputs.branch) }} + secrets: inherit \ No newline at end of file From 4402a8a533baecf31bfc80f255d405101e07da99 Mon Sep 17 00:00:00 2001 From: "Bernd.Rederlechner@t-systems.com" Date: Mon, 12 Feb 2024 16:37:32 +0100 Subject: [PATCH 28/50] Add script for automatic backport PR creation --- .github/workflows/nmc-custom-stables.yml | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/nmc-custom-stables.yml diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml new file mode 100644 index 0000000000..8062414c0f --- /dev/null +++ b/.github/workflows/nmc-custom-stables.yml @@ -0,0 +1,36 @@ +### +# SPDX-License-Identifier: AGPL-3.0 +# +# Author: Bernd rederlechner +# +# Builds a stable release package based on a release assembly +# customisation-- +# +# As soon as a package is deployed to production, the tag and the branch +# MUST STAY FOR 2 years and not deleted. +# +# Release packages, tags and customisation branches not delivered to production should +# be deleted asap a newer release is available. +# + +name: MCLOUD create stable backports + +on: + workflow_dispatch: + inputs: + branch: + type: choice + description: Custom build from base branch + options: + - stable-4.9.7 + - 4.9.6 + - 4.9.5 + default: stable-4.9.7 + +jobs: + backport-custom: + uses: nextmcloud/.github/.github/workflows/nmc-custom-stables.yml@master + with: + trunk: 'master' + stable: ${{ inputs.branch }} + secrets: inherit \ No newline at end of file From ca9a70ecc0fb2c24e0373eeccfa16ed14aeac5af Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:09:32 +0530 Subject: [PATCH 29/50] Update script for adding new stable branch --- .github/workflows/nmc-custom-stables.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 8062414c0f..9058d719ed 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,10 +22,11 @@ on: type: choice description: Custom build from base branch options: + - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-4.9.7 + default: stable-5.2.1 jobs: backport-custom: @@ -33,4 +34,4 @@ jobs: with: trunk: 'master' stable: ${{ inputs.branch }} - secrets: inherit \ No newline at end of file + secrets: inherit From d0203ccf6d00252f84a5858341e361efd85f94ec Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 15 Apr 2024 18:28:46 +0530 Subject: [PATCH 30/50] Update stable branch 5.2.7 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 9058d719ed..c1b444820d 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,11 +22,12 @@ on: type: choice description: Custom build from base branch options: + - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.2.1 + default: stable-5.2.7 jobs: backport-custom: From a4f8d5b540f9a72b4fe8ec9348b6e8e108cb6260 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 22 May 2024 12:27:39 +0530 Subject: [PATCH 31/50] Update new version 5.2.7 --- .github/workflows/nmc-custom-client.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 71ce2a4f46..bffac0f70b 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -24,6 +24,8 @@ on: options: - master - stable-4.9.7 + - stable-5.2.1 + - stable-5.2.7 # - v3.0.8 default: master @@ -34,4 +36,4 @@ jobs: trunk: 'master' stable: ${{ inputs.branch }} result: ${{ format('customisation-{0}-{1}', github.actor, inputs.branch) }} - secrets: inherit \ No newline at end of file + secrets: inherit From 095774d8c647526937cdd919d528af4a44055e00 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 26 Jul 2024 13:58:51 +0530 Subject: [PATCH 32/50] Update nmc-custom-client.yml --- .github/workflows/nmc-custom-client.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index bffac0f70b..42f6190758 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -26,6 +26,7 @@ on: - stable-4.9.7 - stable-5.2.1 - stable-5.2.7 + - stable-5.5.0 # - v3.0.8 default: master From 7bc7cafc8c56e94272ca48850ce447d04287ce94 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:07:07 +0530 Subject: [PATCH 33/50] Update nmc-custom-stables.yml Added new stable 5.5.4 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index c1b444820d..aa1b6ca733 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,12 +22,13 @@ on: type: choice description: Custom build from base branch options: + - stable-5.5.4 - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.2.7 + default: stable-5.5.4 jobs: backport-custom: From ac3344aab646d2c89e297b463592a58a8a809887 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:41:09 +0530 Subject: [PATCH 34/50] Update nmc-custom-stables.yml for NC stable 5.5.5 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index aa1b6ca733..a9c6fa2b9d 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,13 +22,14 @@ on: type: choice description: Custom build from base branch options: + - stable-5.5.5 - stable-5.5.4 - stable-5.2.7 - stable-5.2.1 - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.5.4 + default: stable-5.5.5 jobs: backport-custom: From 688faebf71057de8e18b2892c07143d4724653e1 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:42:57 +0530 Subject: [PATCH 35/50] Update nmc-custom-client.yml for NC Stable 5.5.5 --- .github/workflows/nmc-custom-client.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 42f6190758..1c140fefec 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -27,6 +27,7 @@ on: - stable-5.2.1 - stable-5.2.7 - stable-5.5.0 + - stable-5.5.5 # - v3.0.8 default: master From b8b58271c5c0f66fcc580449a7fd31021a89d41f Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 18 Nov 2024 14:57:36 +0530 Subject: [PATCH 36/50] Update nmc-custom-stables.yml for stable-6.1.3 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index a9c6fa2b9d..58cb823f28 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.1.3 - stable-5.5.5 - stable-5.5.4 - stable-5.2.7 @@ -29,7 +30,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-5.5.5 + default: stable-6.1.3 jobs: backport-custom: From 144b8cfe5ce14c2b4ea50a42213942d9a8c55c01 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 31 Mar 2025 14:56:50 +0530 Subject: [PATCH 37/50] Update nmc-custom-stables.yml Update nmc-custom-stables.yml for NC stable-6.2.7 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 58cb823f28..6494e6bb04 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 - stable-5.5.4 @@ -30,7 +31,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.1.3 + default: stable-6.2.7 jobs: backport-custom: From 8ce1dd52a4b623261593ba440819d01f08380b70 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Mon, 31 Mar 2025 14:59:30 +0530 Subject: [PATCH 38/50] Update nmc-custom-client.yml Update nmc-custom-client.yml for NC Stable 6.2.7 --- .github/workflows/nmc-custom-client.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nmc-custom-client.yml b/.github/workflows/nmc-custom-client.yml index 1c140fefec..d7f0c57da2 100644 --- a/.github/workflows/nmc-custom-client.yml +++ b/.github/workflows/nmc-custom-client.yml @@ -28,6 +28,8 @@ on: - stable-5.2.7 - stable-5.5.0 - stable-5.5.5 + - stable-6.1.3 + - stable-6.2.7 # - v3.0.8 default: master From d6ebc4bdd0603b89aa9e4675e45ca96543cac64d Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Wed, 16 Apr 2025 17:45:12 +0530 Subject: [PATCH 39/50] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 6494e6bb04..5ddb738302 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.6.0 - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 @@ -31,7 +32,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.2.7 + default: stable-6.6.0 jobs: backport-custom: From a0385a5fbad2f86d811b738fc9ff4879b053f0dd Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 13:56:34 +0530 Subject: [PATCH 40/50] Update nmc-custom-stables.yml for NC Stable 6.5.0 --- .github/workflows/nmc-custom-stables.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 5ddb738302..d418101a89 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,7 +22,7 @@ on: type: choice description: Custom build from base branch options: - - stable-6.6.0 + - stable-6.5.0 - stable-6.2.7 - stable-6.1.3 - stable-5.5.5 @@ -32,7 +32,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.6.0 + default: stable-6.5.0 jobs: backport-custom: From bbfba7bc7081bb20d9bc7d2f087a2623877de6bf Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 15:23:20 +0530 Subject: [PATCH 41/50] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index d418101a89..ac0f14243f 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -22,6 +22,7 @@ on: type: choice description: Custom build from base branch options: + - stable-6.6.0 - stable-6.5.0 - stable-6.2.7 - stable-6.1.3 @@ -32,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.5.0 + default: stable-6.6.0 jobs: backport-custom: From e50e7ee5338ec1788ecb04a3a5f062b106261a49 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 42/50] NMC 2161 - Menu option images and color theming changes --- .../File Provider Extension UI.xcscheme | 1 - .../WidgetDashboardIntentHandler.xcscheme | 1 - .../NCSelectableNavigationView.swift | 104 ++++++ iOSClient/Menu/AppDelegate+Menu.swift | 319 ++++++++++++++++++ 4 files changed, 423 insertions(+), 2 deletions(-) create mode 100644 iOSClient/Main/Collection Common/NCSelectableNavigationView.swift create mode 100644 iOSClient/Menu/AppDelegate+Menu.swift diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index fd16f58a63..6e1cc593fa 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 485c4c3f00..d912dd669b 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift new file mode 100644 index 0000000000..6f337e7f5a --- /dev/null +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -0,0 +1,104 @@ +// +// NCSelectableNavigationView.swift +// Nextcloud +// +// Created by Henrik Storch on 27.01.22. +// Copyright © 2022 Henrik Storch. All rights reserved. +// +// Author Marino Faggiana +// Author Henrik Storch +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +import NextcloudKit +import Realm +import UIKit + +extension RealmSwiftObject { + var primaryKeyValue: String? { + guard let primaryKeyName = self.objectSchema.primaryKeyProperty?.name else { return nil } + return value(forKey: primaryKeyName) as? String + } +} + +public protocol NCSelectableViewTabBar { + var tabBarController: UITabBarController? { get } + var hostingController: UIViewController? { get } +} + +protocol NCSelectableNavigationView: AnyObject { + var viewController: UIViewController { get } + var appDelegate: AppDelegate { get } + var selectableDataSource: [RealmSwiftObject] { get } + var collectionView: UICollectionView! { get set } + var isEditMode: Bool { get set } + var selectOcId: [String] { get set } + var selectIndexPaths: [IndexPath] { get set } + var titleCurrentFolder: String { get } + var navigationItem: UINavigationItem { get } + var navigationController: UINavigationController? { get } + var layoutKey: String { get } + var serverUrl: String { get } + var tabBarSelect: NCSelectableViewTabBar? { get set } + + func reloadDataSource(withQueryDB: Bool) + func setNavigationLeftItems() + func setNavigationRightItems(enableMenu: Bool) + func createMenuActions() -> [NCMenuAction] + + func toggleSelect(isOn: Bool?) + func onListSelected() + func onGridSelected() +} + +extension NCSelectableNavigationView { + func setNavigationLeftItems() {} + + func saveLayout(_ layoutForView: NCDBLayoutForView) { + NCManageDatabase.shared.setLayoutForView(layoutForView: layoutForView) + NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource) + setNavigationRightItems(enableMenu: false) + } + + /// If explicit `isOn` is not set, it will invert `isEditMode` + func toggleSelect(isOn: Bool? = nil) { + DispatchQueue.main.async { + self.isEditMode = isOn ?? !self.isEditMode + self.selectOcId.removeAll() + self.selectIndexPaths.removeAll() + self.setNavigationLeftItems() + self.setNavigationRightItems(enableMenu: true) + self.collectionView.reloadData() + } + } + + func collectionViewSelectAll() { + selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) + collectionView.reloadData() + setNavigationRightItems(enableMenu: false) + } + + func tapNotification() { + if let viewController = UIStoryboard(name: "NCNotification", bundle: nil).instantiateInitialViewController() as? NCNotification { + navigationController?.pushViewController(viewController, animated: true) + } + } +} + +extension NCSelectableNavigationView where Self: UIViewController { + var viewController: UIViewController { + self + } +} diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift new file mode 100644 index 0000000000..7041b8eaa9 --- /dev/null +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -0,0 +1,319 @@ +// +// AppDelegate+Menu.swift +// Nextcloud +// +// Created by Philippe Weidmann on 24.01.20. +// Copyright © 2020 Philippe Weidmann. All rights reserved. +// Copyright © 2020 Marino Faggiana All rights reserved. +// +// Author Philippe Weidmann +// Author Marino Faggiana +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +import UIKit +import FloatingPanel +import NextcloudKit + +extension AppDelegate { + func toggleMenu(controller: NCMainTabBarController, sender: Any?) { + var actions: [NCMenuAction] = [] + let session = NCSession.shared.getSession(controller: controller) + let utilityFileSystem = NCUtilityFileSystem() + let serverUrl = controller.currentServerUrl() + let isDirectoryE2EE = NCUtilityFileSystem().isDirectoryE2EE(serverUrl: serverUrl, account: session.account) + let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)) + let utility = NCUtility() + let capabilities = NKCapabilities.shared.getCapabilitiesBlocking(for: session.account) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_upload_photos_videos_", comment: ""), + icon: utility.loadImage(named: "photo", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in + if hasPermission {NCPhotosPickerViewController(controller: controller, maxSelectedAssets: 0, singleSelectedMode: false) + } + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_upload_file_", comment: ""), + icon: utility.loadImage(named: "doc", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) + } + ) + ) + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "text" }), + !isDirectoryE2EE { + actions.append( + NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), + icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + Task { + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + creator.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + NCCreateDocument().createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "text", creatorId: creator.identifier, templateId: "document", account: session.account) + } +// let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! +// guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { +// return +// } +// navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorText +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.editorText +// viewController.serverUrl = appDelegate.activeServerUrl +// viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") +// appDelegate.window?.rootViewController?.present(navigationController, animated: true, completion: nil) +// } + }) + ) + } + + actions.append( + NCMenuAction( + title: NSLocalizedString("_scans_document_", comment: ""), + icon: utility.loadImage(named: "doc.text.viewfinder", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCDocumentCamera.shared.openScannerDocument(viewController: controller) + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_voice_memo_", comment: ""), + icon: utility.loadImage(named: "mic", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in + if hasPermission { + if let viewController = UIStoryboard(name: "NCAudioRecorderViewController", bundle: nil).instantiateInitialViewController() as? NCAudioRecorderViewController { + viewController.controller = controller + viewController.modalTransitionStyle = .crossDissolve + viewController.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext + controller.present(viewController, animated: true, completion: nil) + } + } + } + } + ) + ) + + if NCKeychain().isEndToEndEnabled(account: session.account) { + actions.append(.seperator(order: 0, sender: sender)) + } + + let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") + let imageCreateFolder = isDirectoryE2EE ? NCImageCache.shared.getFolderEncrypted(account: session.account) : NCImageCache.shared.getFolder(account: session.account) + actions.append( + NCMenuAction(title: titleCreateFolder, + icon: imageCreateFolder, + sender: sender, + action: { _ in + let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, sceneIdentifier: controller.sceneIdentifier) + controller.present(alertController, animated: true, completion: nil) + } + ) + ) + + // Folder encrypted + if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { + // Folder encrypted (ONLY ROOT) +// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: appDelegate.account) && (NCUtilityFileSystem().getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) == appDelegate.activeServerUrl) { + actions.append( + NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), + icon: NCImageCache.shared.getFolderEncrypted(account: session.account), + sender: sender, + action: { _ in + let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) + controller.present(alertController, animated: true, completion: nil) + }) + ) + } + + if NCKeychain().isEndToEndEnabled(account: session.account) { + actions.append(.seperator(order: 0, sender: sender)) + } + + if capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { + actions.append( + NCMenuAction( + title: NSLocalizedString("_add_folder_info_", comment: ""), + icon: NCUtility().loadImage(named: "list.dash.header.rectangle", colors: [NCBrandColor.shared.iconImageColor]), + sender: sender, + action: { _ in + let richWorkspaceCommon = NCRichWorkspaceCommon() + if let viewController = controller.currentViewController() { + if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", + session.account, + serverUrl, + NCGlobal.shared.fileNameRichWorkspace.lowercased())) == nil { + richWorkspaceCommon.createViewerNextcloudText(serverUrl: serverUrl, viewController: viewController, session: session) + } else { + richWorkspaceCommon.openViewerNextcloudText(serverUrl: serverUrl, viewController: viewController, session: session) + } + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_docx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_document_", comment: ""), + icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.documentIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_xlsx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), + icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if NextcloudKit.shared.isNetworkReachable(), + let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_pptx"}) { + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_presentation_", comment: ""), + icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + + if capabilities.richDocumentsEnabled { + if NextcloudKit.shared.isNetworkReachable() && !isDirectoryE2EE { + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_document_", comment: ""), + icon: utility.loadImage(named: "doc.richtext", colors: [NCBrandColor.shared.documentIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), + icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_create_new_presentation_", comment: ""), + icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + sender: sender, + action: { _ in + let createDocument = NCCreateDocument() + + Task { + let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) + let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) + let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) + } + } + ) + ) + } + } + + controller.presentMenu(with: actions, controller: controller, sender: sender) + } +} From 6bcd932e8aad2ed891e63209aa21febdb8254e13 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 43/50] NMC 2161 - Menu option images and color theming and other changes --- Nextcloud.xcodeproj/project.pbxproj | 8 ++ .../File Provider Extension UI.xcscheme | 1 + .../WidgetDashboardIntentHandler.xcscheme | 1 + iOSClient/Menu/AppDelegate+Menu.swift | 127 ++++++++++++++---- 4 files changed, 112 insertions(+), 25 deletions(-) diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj index 8dd4c5545f..3072bcce21 100644 --- a/Nextcloud.xcodeproj/project.pbxproj +++ b/Nextcloud.xcodeproj/project.pbxproj @@ -85,6 +85,10 @@ AFCE353527E4ED5900FEA6C2 /* DateFormatter+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */; }; AFCE353727E4ED7B00FEA6C2 /* NCShareCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */; }; AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* Shareable.swift */; }; + AFCE353927E5DE0500FEA6C2 /* NCShare+Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */; }; + B52FAED52DA8F616001AB1BD /* NCSelectableNavigationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */; }; + C04E2F232A17BB4D001BAD85 /* FilesIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04E2F222A17BB4D001BAD85 /* FilesIntegrationTests.swift */; }; + D575039F27146F93008DC9DC /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extension.swift */; }; D5B6AA7827200C7200D49C24 /* NCActivityTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */; }; F310B1EF2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */; }; F321DA8A2B71205A00DDA0E6 /* NCTrashSelectTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F321DA892B71205A00DDA0E6 /* NCTrashSelectTabBar.swift */; }; @@ -1221,6 +1225,8 @@ AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+Extension.swift"; sourceTree = ""; }; AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareCells.swift; sourceTree = ""; }; AFCE353827E5DE0400FEA6C2 /* Shareable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shareable.swift; sourceTree = ""; }; + AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCShare+Helper.swift"; sourceTree = ""; }; + B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSelectableNavigationView.swift; sourceTree = ""; }; C0046CDA2A17B98400D87C9D /* NextcloudUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; C04E2F202A17BB4D001BAD85 /* NextcloudIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = ""; }; @@ -2464,6 +2470,7 @@ F7603298252F0E550015A421 /* Collection Common */ = { isa = PBXGroup; children = ( + B52FAED42DA8F616001AB1BD /* NCSelectableNavigationView.swift */, F75FE06B2BB01D0D00A0EFEF /* Cell */, F78ACD50219046AC0088454D /* Section Header Footer */, F70D7C3525FFBF81002B9E34 /* NCCollectionViewCommon.swift */, @@ -4684,6 +4691,7 @@ F76882232C0DD1E7001CF441 /* NCCapabilitiesModel.swift in Sources */, F7E2B64F2DDCC5C30075B4D0 /* NCMedia+TransferDelegate.swift in Sources */, F7D68FCC28CB9051009139F3 /* NCManageDatabase+DashboardWidget.swift in Sources */, + B52FAED52DA8F616001AB1BD /* NCSelectableNavigationView.swift in Sources */, F76882292C0DD1E7001CF441 /* NCManageE2EEModel.swift in Sources */, F799DF8B2C4B84EB003410B5 /* NCCollectionViewCommon+EndToEndInitialize.swift in Sources */, F7CCAB512ECF316700F8E68B /* NCCollectionViewCommon+SyncMetadata.swift in Sources */, diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 6e1cc593fa..fd16f58a63 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index d912dd669b..485c4c3f00 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index 7041b8eaa9..a06680d3e9 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -41,7 +41,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_upload_photos_videos_", comment: ""), - icon: utility.loadImage(named: "photo", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in @@ -55,7 +55,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_upload_file_", comment: ""), - icon: utility.loadImage(named: "doc", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) @@ -68,7 +68,7 @@ extension AppDelegate { !isDirectoryE2EE { actions.append( NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), - icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in Task { @@ -86,9 +86,9 @@ extension AppDelegate { // viewController.editorId = NCGlobal.shared.editorText // viewController.creatorId = directEditingCreator.identifier // viewController.typeTemplate = NCGlobal.shared.editorText -// viewController.serverUrl = appDelegate.activeServerUrl +// viewController.serverUrl = serverUrl // viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") -// appDelegate.window?.rootViewController?.present(navigationController, animated: true, completion: nil) +// controller.present(navigationController, animated: true, completion: nil) // } }) ) @@ -97,7 +97,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_scans_document_", comment: ""), - icon: utility.loadImage(named: "doc.text.viewfinder", colors: [NCBrandColor.shared.iconImageColor]), + icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCDocumentCamera.shared.openScannerDocument(viewController: controller) @@ -108,7 +108,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_voice_memo_", comment: ""), - icon: utility.loadImage(named: "mic", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in @@ -130,7 +130,7 @@ extension AppDelegate { } let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") - let imageCreateFolder = isDirectoryE2EE ? NCImageCache.shared.getFolderEncrypted(account: session.account) : NCImageCache.shared.getFolder(account: session.account) + let imageCreateFolder = isDirectoryE2EE ? UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50) : UIImage(named: "addFolder")! actions.append( NCMenuAction(title: titleCreateFolder, icon: imageCreateFolder, @@ -145,10 +145,10 @@ extension AppDelegate { // Folder encrypted if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { // Folder encrypted (ONLY ROOT) -// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: appDelegate.account) && (NCUtilityFileSystem().getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) == appDelegate.activeServerUrl) { +// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { actions.append( NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), - icon: NCImageCache.shared.getFolderEncrypted(account: session.account), + icon: UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) @@ -165,7 +165,7 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_add_folder_info_", comment: ""), - icon: NCUtility().loadImage(named: "list.dash.header.rectangle", colors: [NCBrandColor.shared.iconImageColor]), + icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), sender: sender, action: { _ in let richWorkspaceCommon = NCRichWorkspaceCommon() @@ -190,17 +190,30 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_document_", comment: ""), - icon: utility.loadImage(named: "doc.text", colors: [NCBrandColor.shared.documentIconColor]), + icon: UIImage(named: "create_file_document")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - + createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) + // if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + // viewController.editorId = NCGlobal.shared.editorOnlyoffice + // viewController.creatorId = directEditingCreator.identifier + // viewController.typeTemplate = NCGlobal.shared.templateDocument + // viewController.serverUrl = serverUrl + // viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") + // + // controller.present(navigationController, animated: true, completion: nil) + // } } } ) @@ -213,10 +226,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + icon: UIImage(named: "create_file_xls")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) @@ -224,6 +241,15 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorOnlyoffice +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -236,10 +262,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + icon: UIImage(named: "create_file_ppt")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) @@ -247,6 +277,15 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorOnlyoffice +// viewController.creatorId = directEditingCreator.identifier +// viewController.typeTemplate = NCGlobal.shared.templatePresentation +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -258,10 +297,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_document_", comment: ""), - icon: utility.loadImage(named: "doc.richtext", colors: [NCBrandColor.shared.documentIconColor]), + icon: UIImage(named: "create_file_document")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) @@ -269,6 +312,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templateDocument +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -277,10 +328,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: utility.loadImage(named: "tablecells", colors: [NCBrandColor.shared.spreadsheetIconColor]), + icon: UIImage(named: "create_file_xls")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) @@ -288,6 +343,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -296,10 +359,14 @@ extension AppDelegate { actions.append( NCMenuAction( title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: utility.loadImage(named: "play.rectangle", colors: [NCBrandColor.shared.presentationIconColor]), + icon: UIImage(named: "create_file_ppt")!, sender: sender, action: { _ in - let createDocument = NCCreateDocument() +// let createDocument = NCCreateDocument() + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet Task { let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) @@ -307,6 +374,14 @@ extension AppDelegate { let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) +// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { +// viewController.editorId = NCGlobal.shared.editorCollabora +// viewController.typeTemplate = NCGlobal.shared.templatePresentation +// viewController.serverUrl = serverUrl +// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") +// +// controller.present(navigationController, animated: true, completion: nil) +// } } } ) @@ -314,6 +389,8 @@ extension AppDelegate { } } - controller.presentMenu(with: actions, controller: controller, sender: sender) +// controller.presentMenu(with: actions, controller: controller, sender: sender) + AnalyticsHelper.shared.trackEvent(eventName: .EVENT__ACTION_BUTTON) + controller.presentMenu(with: actions) } } From 3a4440e760e1ef2f7c2c24d03c80d287a044e4f4 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 44/50] NMC 2161 - Menu option changes --- .../NCSelectableNavigationView.swift | 22 +- iOSClient/Menu/AppDelegate+Menu.swift | 262 ++++++------------ 2 files changed, 94 insertions(+), 190 deletions(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 6f337e7f5a..94715d4e44 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,20 +40,17 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } - var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } - var selectOcId: [String] { get set } - var selectIndexPaths: [IndexPath] { get set } + var fileSelect: [String] { get set } var titleCurrentFolder: String { get } var navigationItem: UINavigationItem { get } var navigationController: UINavigationController? { get } var layoutKey: String { get } var serverUrl: String { get } - var tabBarSelect: NCSelectableViewTabBar? { get set } - func reloadDataSource(withQueryDB: Bool) +// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] @@ -76,8 +73,7 @@ extension NCSelectableNavigationView { func toggleSelect(isOn: Bool? = nil) { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode - self.selectOcId.removeAll() - self.selectIndexPaths.removeAll() + self.fileSelect.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -85,7 +81,8 @@ extension NCSelectableNavigationView { } func collectionViewSelectAll() { - selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) + + fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) } @@ -95,6 +92,15 @@ extension NCSelectableNavigationView { navigationController?.pushViewController(viewController, animated: true) } } + + func tapTransfer() { + if let navController = UIStoryboard(name: "NCTransfers", bundle: nil).instantiateInitialViewController() as? UINavigationController, + let viewController = navController.topViewController as? NCTransfers { + viewController.modalPresentationStyle = .pageSheet +// self.present(navigationController, animated: true, completion: nil) + navigationController?.present(navController, animated: true, completion: nil) + } + } } extension NCSelectableNavigationView where Self: UIViewController { diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index a06680d3e9..c2f3307daf 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -28,22 +28,18 @@ import FloatingPanel import NextcloudKit extension AppDelegate { - func toggleMenu(controller: NCMainTabBarController, sender: Any?) { + func toggleMenu(controller: NCMainTabBarController) { var actions: [NCMenuAction] = [] let session = NCSession.shared.getSession(controller: controller) - let utilityFileSystem = NCUtilityFileSystem() + let directEditingCreators = NCManageDatabase.shared.getDirectEditingCreators(account: session.account) let serverUrl = controller.currentServerUrl() let isDirectoryE2EE = NCUtilityFileSystem().isDirectoryE2EE(serverUrl: serverUrl, account: session.account) let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)) let utility = NCUtility() - let capabilities = NKCapabilities.shared.getCapabilitiesBlocking(for: session.account) actions.append( NCMenuAction( - title: NSLocalizedString("_upload_photos_videos_", comment: ""), - icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_upload_photos_videos_", comment: ""), icon: UIImage(named: "file_photo_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCAskAuthorization().askAuthorizationPhotoLibrary(controller: controller) { hasPermission in if hasPermission {NCPhotosPickerViewController(controller: controller, maxSelectedAssets: 0, singleSelectedMode: false) } @@ -54,52 +50,35 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_upload_file_", comment: ""), - icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_upload_file_", comment: ""), icon: UIImage(named: "uploadFile")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in controller.documentPickerViewController = NCDocumentPickerViewController(controller: controller, isViewerMedia: false, allowsMultipleSelection: true) } ) ) - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "text" }), - !isDirectoryE2EE { + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorText}) && !isDirectoryE2EE { actions.append( - NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), - icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in - Task { - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + creator.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - - NCCreateDocument().createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "text", creatorId: creator.identifier, templateId: "document", account: session.account) - } -// let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! -// guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { -// return -// } -// navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorText -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.editorText -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") -// controller.present(navigationController, animated: true, completion: nil) -// } + NCMenuAction(title: NSLocalizedString("_create_nextcloudtext_document_", comment: ""), icon: UIImage(named: "file_txt_menu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorText})! + guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { + return + } + navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorText + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.editorText + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_nextcloudtext_document_", comment: "") + controller.present(navigationController, animated: true, completion: nil) + } }) ) } actions.append( NCMenuAction( - title: NSLocalizedString("_scans_document_", comment: ""), - icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_scans_document_", comment: ""), icon: NCUtility().loadImage(named: "scan").image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCDocumentCamera.shared.openScannerDocument(viewController: controller) } ) @@ -107,10 +86,7 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_voice_memo_", comment: ""), - icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_create_voice_memo_", comment: ""), icon: UIImage(named: "microphoneMenu")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in NCAskAuthorization().askAuthorizationAudioRecord(viewController: controller) { hasPermission in if hasPermission { if let viewController = UIStoryboard(name: "NCAudioRecorderViewController", bundle: nil).instantiateInitialViewController() as? NCAudioRecorderViewController { @@ -126,30 +102,25 @@ extension AppDelegate { ) if NCKeychain().isEndToEndEnabled(account: session.account) { - actions.append(.seperator(order: 0, sender: sender)) + actions.append(.seperator(order: 0)) } let titleCreateFolder = isDirectoryE2EE ? NSLocalizedString("_create_folder_e2ee_", comment: "") : NSLocalizedString("_create_folder_", comment: "") let imageCreateFolder = isDirectoryE2EE ? UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50) : UIImage(named: "addFolder")! actions.append( NCMenuAction(title: titleCreateFolder, - icon: imageCreateFolder, - sender: sender, - action: { _ in + icon: imageCreateFolder, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, sceneIdentifier: controller.sceneIdentifier) controller.present(alertController, animated: true, completion: nil) } ) ) - // Folder encrypted - if serverUrl == utilityFileSystem.getHomeServer(session: session) && NCKeychain().isEndToEndEnabled(account: session.account) { // Folder encrypted (ONLY ROOT) -// if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { + if !isDirectoryE2EE && NCKeychain().isEndToEndEnabled(account: session.account) && (NCUtilityFileSystem().getHomeServer(session: session) == serverUrl) { actions.append( NCMenuAction(title: NSLocalizedString("_create_folder_e2ee_", comment: ""), icon: UIImage(named: "encryptedfolder")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, action: { _ in let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, markE2ee: true, sceneIdentifier: controller.sceneIdentifier) controller.present(alertController, animated: true, completion: nil) @@ -158,16 +129,13 @@ extension AppDelegate { } if NCKeychain().isEndToEndEnabled(account: session.account) { - actions.append(.seperator(order: 0, sender: sender)) + actions.append(.seperator(order: 0)) } - if capabilities.serverVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { + if NCCapabilities.shared.getCapabilities(account: session.account).capabilityServerVersionMajor >= NCGlobal.shared.nextcloudVersion18 && directory?.richWorkspace == nil && !isDirectoryE2EE && NextcloudKit.shared.isNetworkReachable() { actions.append( NCMenuAction( - title: NSLocalizedString("_add_folder_info_", comment: ""), - icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), - sender: sender, - action: { _ in + title: NSLocalizedString("_add_folder_info_", comment: ""), icon: UIImage(named: "addFolderInfo")!.image(color: NCBrandColor.shared.iconColor, size: 50), action: { _ in let richWorkspaceCommon = NCRichWorkspaceCommon() if let viewController = controller.currentViewController() { if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", @@ -184,142 +152,95 @@ extension AppDelegate { ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_docx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeDocx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeDocx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_document_", comment: ""), - icon: UIImage(named: "create_file_document")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_document_", comment: ""), icon: UIImage(named: "create_file_document")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "document", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) - - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) - // if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { - // viewController.editorId = NCGlobal.shared.editorOnlyoffice - // viewController.creatorId = directEditingCreator.identifier - // viewController.typeTemplate = NCGlobal.shared.templateDocument - // viewController.serverUrl = serverUrl - // viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") - // - // controller.present(navigationController, animated: true, completion: nil) - // } + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templateDocument + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") + + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_xlsx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeXlsx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficeXlsx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: UIImage(named: "create_file_xls")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), icon: UIImage(named: "create_file_xls")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "spreadsheet", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorOnlyoffice -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if NextcloudKit.shared.isNetworkReachable(), - let creator = capabilities.directEditingCreators.first(where: { $0.editor == "onlyoffice" && $0.identifier == "onlyoffice_pptx"}) { - + if NextcloudKit.shared.isNetworkReachable() && directEditingCreators != nil && directEditingCreators!.contains(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficePptx}) && !isDirectoryE2EE { + let directEditingCreator = directEditingCreators!.first(where: { $0.editor == NCGlobal.shared.editorOnlyoffice && $0.identifier == NCGlobal.shared.onlyofficePptx})! actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: UIImage(named: "create_file_ppt")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_presentation_", comment: ""), icon: UIImage(named: "create_file_ppt")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "onlyoffice", templateId: "presentation", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorOnlyoffice + viewController.creatorId = directEditingCreator.identifier + viewController.typeTemplate = NCGlobal.shared.templatePresentation + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "onlyoffice", creatorId: creator.identifier, templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorOnlyoffice -// viewController.creatorId = directEditingCreator.identifier -// viewController.typeTemplate = NCGlobal.shared.templatePresentation -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) ) } - if capabilities.richDocumentsEnabled { + if NCCapabilities.shared.getCapabilities(account: session.account).capabilityRichDocumentsEnabled { if NextcloudKit.shared.isNetworkReachable() && !isDirectoryE2EE { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_document_", comment: ""), - icon: UIImage(named: "create_file_document")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_document_", comment: ""), icon: UIImage(named: "create_file_document")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "document", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templateDocument + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templateDocument -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -327,30 +248,19 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), - icon: UIImage(named: "create_file_xls")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_spreadsheet_", comment: ""), icon: UIImage(named: "create_file_xls")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "spreadsheet", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templateSpreadsheet -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_spreadsheet_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -358,30 +268,19 @@ extension AppDelegate { actions.append( NCMenuAction( - title: NSLocalizedString("_create_new_presentation_", comment: ""), - icon: UIImage(named: "create_file_ppt")!, - sender: sender, - action: { _ in -// let createDocument = NCCreateDocument() + title: NSLocalizedString("_create_new_presentation_", comment: ""), icon: UIImage(named: "create_file_ppt")!, action: { _ in guard let navigationController = UIStoryboard(name: "NCCreateFormUploadDocuments", bundle: nil).instantiateInitialViewController() else { return } navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet - Task { - let templates = await createDocument.getTemplate(editorId: "collabora", templateId: "presentation", account: session.account) - let fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + "." + templates.ext, account: session.account, serverUrl: serverUrl) - let fileNamePath = utilityFileSystem.getFileNamePath(String(describing: fileName), serverUrl: serverUrl, session: session) + if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { + viewController.editorId = NCGlobal.shared.editorCollabora + viewController.typeTemplate = NCGlobal.shared.templatePresentation + viewController.serverUrl = serverUrl + viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") - createDocument.createDocument(controller: controller, fileNamePath: fileNamePath, fileName: String(describing: fileName), editorId: "collabora", templateId: templates.selectedTemplate.identifier, account: session.account) -// if let viewController = (navigationController as? UINavigationController)?.topViewController as? NCCreateFormUploadDocuments { -// viewController.editorId = NCGlobal.shared.editorCollabora -// viewController.typeTemplate = NCGlobal.shared.templatePresentation -// viewController.serverUrl = serverUrl -// viewController.titleForm = NSLocalizedString("_create_new_presentation_", comment: "") -// -// controller.present(navigationController, animated: true, completion: nil) -// } + controller.present(navigationController, animated: true, completion: nil) } } ) @@ -389,7 +288,6 @@ extension AppDelegate { } } -// controller.presentMenu(with: actions, controller: controller, sender: sender) AnalyticsHelper.shared.trackEvent(eventName: .EVENT__ACTION_BUTTON) controller.presentMenu(with: actions) } From 1c17df8dd6d08178e1c6fccc8ba370cb7766e3e4 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 13:56:34 +0530 Subject: [PATCH 45/50] Update nmc-custom-stables.yml for NC Stable 6.5.0 --- .github/workflows/nmc-custom-stables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index ac0f14243f..2ec6976ef2 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -33,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.6.0 + default: stable-6.5.0 jobs: backport-custom: From 508ca1fad8a81c191eb6296316f18ee800cd3c44 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Thu, 17 Apr 2025 15:23:20 +0530 Subject: [PATCH 46/50] Update nmc-custom-stables.yml for NC stable-6.6.0 --- .github/workflows/nmc-custom-stables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nmc-custom-stables.yml b/.github/workflows/nmc-custom-stables.yml index 2ec6976ef2..ac0f14243f 100644 --- a/.github/workflows/nmc-custom-stables.yml +++ b/.github/workflows/nmc-custom-stables.yml @@ -33,7 +33,7 @@ on: - stable-4.9.7 - 4.9.6 - 4.9.5 - default: stable-6.5.0 + default: stable-6.6.0 jobs: backport-custom: From 0e4a363f8f525c7c85e984fcfad5614ccd22ce6a Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:46:53 +0530 Subject: [PATCH 47/50] NMC 2161 - Menu option images and color theming changes --- .../xcschemes/File Provider Extension UI.xcscheme | 1 - .../xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 - .../Main/Collection Common/NCSelectableNavigationView.swift | 5 +++++ iOSClient/Menu/AppDelegate+Menu.swift | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index fd16f58a63..6e1cc593fa 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index 485c4c3f00..d912dd669b 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,7 +73,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" - askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 94715d4e44..04b08c5606 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -44,6 +44,8 @@ protocol NCSelectableNavigationView: AnyObject { var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } + var appDelegate: AppDelegate { get } + var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } var navigationItem: UINavigationItem { get } var navigationController: UINavigationController? { get } @@ -51,6 +53,9 @@ protocol NCSelectableNavigationView: AnyObject { var serverUrl: String { get } // func reloadDataSource(withQueryDB: Bool) + var tabBarSelect: NCSelectableViewTabBar? { get set } + + func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index c2f3307daf..f228bdd55a 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,6 +170,7 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) + } } ) From 5cdd3b8e6777204b0369d2c2907d2e2ebb826cde Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 11 Apr 2025 15:11:29 +0530 Subject: [PATCH 48/50] NMC 2161 - Menu option images and color theming and other changes --- .../xcshareddata/xcschemes/File Provider Extension UI.xcscheme | 1 + .../xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme | 1 + iOSClient/Menu/AppDelegate+Menu.swift | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme index 6e1cc593fa..fd16f58a63 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/File Provider Extension UI.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme index d912dd669b..485c4c3f00 100644 --- a/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme +++ b/Nextcloud.xcodeproj/xcshareddata/xcschemes/WidgetDashboardIntentHandler.xcscheme @@ -73,6 +73,7 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES" + askForAppToLaunch = "Yes" launchAutomaticallySubstyle = "2"> diff --git a/iOSClient/Menu/AppDelegate+Menu.swift b/iOSClient/Menu/AppDelegate+Menu.swift index f228bdd55a..c2f3307daf 100644 --- a/iOSClient/Menu/AppDelegate+Menu.swift +++ b/iOSClient/Menu/AppDelegate+Menu.swift @@ -170,7 +170,6 @@ extension AppDelegate { viewController.titleForm = NSLocalizedString("_create_new_document_", comment: "") controller.present(navigationController, animated: true, completion: nil) - } } ) From 930aa1dfd764161010ec6e51a2a98b6eb1b52640 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Fri, 3 Oct 2025 12:07:52 +0530 Subject: [PATCH 49/50] NMC 2161 - Menu option changes --- .../Main/Collection Common/NCSelectableNavigationView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 04b08c5606..2e07da992e 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -55,7 +55,7 @@ protocol NCSelectableNavigationView: AnyObject { // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } - func reloadDataSource(withQueryDB: Bool) +// func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) func createMenuActions() -> [NCMenuAction] From 4d6b31e9545e8a332e4527e2198901aa6f0d64b8 Mon Sep 17 00:00:00 2001 From: harshada-15-tsys Date: Tue, 16 Dec 2025 14:59:08 +0530 Subject: [PATCH 50/50] NMC 2161 - Menu option changes --- .../NCSelectableNavigationView.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift index 2e07da992e..17dbb04c03 100644 --- a/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift +++ b/iOSClient/Main/Collection Common/NCSelectableNavigationView.swift @@ -40,10 +40,17 @@ public protocol NCSelectableViewTabBar { protocol NCSelectableNavigationView: AnyObject { var viewController: UIViewController { get } +// var appDelegate: AppDelegate { get } var selectableDataSource: [RealmSwiftObject] { get } var collectionView: UICollectionView! { get set } var isEditMode: Bool { get set } var fileSelect: [String] { get set } +// var selectIndexPaths: [IndexPath] { get set } + var appDelegate: AppDelegate { get } + var selectableDataSource: [RealmSwiftObject] { get } + var collectionView: UICollectionView! { get set } + var isEditMode: Bool { get set } + var selectOcId: [String] { get set } var appDelegate: AppDelegate { get } var selectIndexPaths: [IndexPath] { get set } var titleCurrentFolder: String { get } @@ -51,10 +58,13 @@ protocol NCSelectableNavigationView: AnyObject { var navigationController: UINavigationController? { get } var layoutKey: String { get } var serverUrl: String { get } +// var tabBarSelect: NCSelectableViewTabBar? { get set } +// var dataSource: NCCollectionViewDataSource { get set } // func reloadDataSource(withQueryDB: Bool) var tabBarSelect: NCSelectableViewTabBar? { get set } + func reloadDataSource(withQueryDB: Bool) // func reloadDataSource(withQueryDB: Bool) func setNavigationLeftItems() func setNavigationRightItems(enableMenu: Bool) @@ -79,6 +89,9 @@ extension NCSelectableNavigationView { DispatchQueue.main.async { self.isEditMode = isOn ?? !self.isEditMode self.fileSelect.removeAll() +// self.selectIndexPaths.removeAll() + self.selectOcId.removeAll() + self.selectIndexPaths.removeAll() self.setNavigationLeftItems() self.setNavigationRightItems(enableMenu: true) self.collectionView.reloadData() @@ -88,6 +101,8 @@ extension NCSelectableNavigationView { func collectionViewSelectAll() { fileSelect = selectableDataSource.compactMap({ $0.primaryKeyValue }) +// fileSelect = NCCollectionViewDataSource().getMetadataSourceForAllSections().compactMap({ $0.primaryKeyValue }) +// selectOcId = selectableDataSource.compactMap({ $0.primaryKeyValue }) collectionView.reloadData() setNavigationRightItems(enableMenu: false) }