Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/disable-fileprovider] Disable access to File Provider via MDM #1158

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ lang_map = cs_CZ: cs, de_DE: de-DE, en_GB: en-GB, nb_NO: nb-NO, nn_NO: nn-NO, pt
source_file = fastlane/screenshots/en/title.strings
source_lang = en
type = STRINGS

46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
Changelog for ownCloud iOS Client [unreleased] (UNRELEASED)
=======================================
The following sections list the changes in ownCloud iOS Client unreleased relevant to
ownCloud admins and users.

[unreleased]: https://github.com/owncloud/ios-app/compare/milestone/11.10.1...master

Summary
-------

* Bugfix - Enabling Markup Mode on iOS 16, Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141)
* Bugfix - Share Extension Passcode Lock Interval: [#1156](https://github.com/owncloud/ios-app/issues/1156)
* Bugfix - Video Metadata Image: [#5296](https://github.com/owncloud/enterprise/issues/5296)
* Change - New Dark Mode Themes: [#1146](https://github.com/owncloud/ios-app/issues/1146)

Details
-------

* Bugfix - Enabling Markup Mode on iOS 16, Updating Theme: [#1141](https://github.com/owncloud/ios-app/issues/1141)

Enabling markup mode was broken on iOS 16 because of rearranged navigation bar and toolbar
items. Furthermore when a new theme was choosen, this causes that the UITabBar and UIToolbar
does not updates colours.

https://github.com/owncloud/ios-app/issues/1141

* Bugfix - Share Extension Passcode Lock Interval: [#1156](https://github.com/owncloud/ios-app/issues/1156)

The passcode lock interval was not taken into use in the share extension.

https://github.com/owncloud/ios-app/issues/1156

* Bugfix - Video Metadata Image: [#5296](https://github.com/owncloud/enterprise/issues/5296)

If a video file includes a metadata image, the video file was not visible, because the metadata
image was overlaying.

https://github.com/owncloud/enterprise/issues/5296

* Change - New Dark Mode Themes: [#1146](https://github.com/owncloud/ios-app/issues/1146)

Adds a new dark mode theme which is mostly equal to the web UI dark mode theme. Furthermore it adds
a black dark mode theme.

https://github.com/owncloud/ios-app/issues/1146

Changelog for ownCloud iOS Client [11.10.1] (2022-08-02)
=======================================
The following sections list the changes in ownCloud iOS Client 11.10.1 relevant to
Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/1141
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Enabling Markup Mode on iOS 16, Updating Theme

Enabling markup mode was broken on iOS 16 because of rearranged navigation bar and toolbar items.
Furthermore when a new theme was choosen, this causes that the UITabBar and UIToolbar does not updates colours.

https://github.com/owncloud/ios-app/issues/1141
5 changes: 5 additions & 0 deletions changelog/unreleased/1146
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Change: New Dark Mode Themes

Adds a new dark mode theme which is mostly equal to the web UI dark mode theme. Furthermore it adds a black dark mode theme.

https://github.com/owncloud/ios-app/issues/1146
5 changes: 5 additions & 0 deletions changelog/unreleased/1156
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Share Extension Passcode Lock Interval

The passcode lock interval was not taken into use in the share extension.

https://github.com/owncloud/ios-app/issues/1156
5 changes: 5 additions & 0 deletions changelog/unreleased/5296
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Video Metadata Image

If a video file includes a metadata image, the video file was not visible, because the metadata image was overlaying.

https://github.com/owncloud/enterprise/issues/5296
Binary file modified doc/images/el/keyword.strings
Binary file not shown.
Binary file modified doc/images/el/title.strings
Binary file not shown.
Binary file added doc/images/ko/keyword.strings
Binary file not shown.
Binary file added doc/images/ko/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/ar/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/ar/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/ca/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/de-DE/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/de-DE/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/de/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/de/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/de_CH/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/de_CH/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/el/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/el/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/en-GB/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/en-GB/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/es/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/es/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/et_EE/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/eu/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/eu/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/fr/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/gl/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/gl/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/he/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/he/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/km/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/ko/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/ko/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/lv/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/pt-BR/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/pt-BR/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/ru/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/ru/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/sq/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/sq/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/th-TH/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/th-TH/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/tr/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/tr/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/ur_PK/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/zh-Hans/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/zh-Hans/title.strings
Binary file not shown.
Binary file added fastlane/screenshots/zh_TW/keyword.strings
Binary file not shown.
Binary file added fastlane/screenshots/zh_TW/title.strings
Binary file not shown.
23 changes: 18 additions & 5 deletions ownCloud File Provider UI/DocumentActionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ class DocumentActionViewController: FPUIActionExtensionViewController {
}
}

func prepareNavigationController() {
if themeNavigationController == nil {
themeNavigationController = ThemeNavigationController()
if let themeNavigationController = themeNavigationController {
view.addSubview(themeNavigationController.view)
addChild(themeNavigationController)
}
}
}

override func prepare(forAction actionIdentifier: String, itemIdentifiers: [NSFileProviderItemIdentifier]) {

guard let identifier = itemIdentifiers.first else {
Expand All @@ -71,11 +81,7 @@ class DocumentActionViewController: FPUIActionExtensionViewController {
let collection = Theme.shared.activeCollection
self.view.backgroundColor = collection.toolbarColors.backgroundColor

themeNavigationController = ThemeNavigationController()
if let themeNavigationController = themeNavigationController {
view.addSubview(themeNavigationController.view)
addChild(themeNavigationController)
}
prepareNavigationController()

showCancelLabel(with: "Connecting…".localized)

Expand Down Expand Up @@ -151,6 +157,12 @@ class DocumentActionViewController: FPUIActionExtensionViewController {
}

override func prepare(forError error: Error) {
if !OCFileProviderSettings.browseable {
prepareNavigationController()
showCancelLabel(with: "File Provider access has been disabled by the administrator.\n\nPlease use the app to access your files.".localized)
return
}

if AppLockManager.supportedOnDevice {
AppLockManager.shared.passwordViewHostViewController = self
AppLockManager.shared.biometricCancelLabel = "Cancel".localized
Expand All @@ -163,6 +175,7 @@ class DocumentActionViewController: FPUIActionExtensionViewController {

AppLockManager.shared.showLockscreenIfNeeded()
} else {
prepareNavigationController()
showCancelLabel(with: "Passcode protection is not supported on this device.\nPlease disable passcode lock in the app settings.".localized)
}
}
Expand Down
22 changes: 22 additions & 0 deletions ownCloud File Provider/FileProviderExtension.m
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,12 @@ - (void)createDirectoryWithName:(NSString *)directoryName inParentItemIdentifier
NSError *error = nil;
OCItem *parentItem;

if (!OCFileProviderSettings.browseable)
{
completionHandler(nil, [OCErrorWithDescription(OCErrorInternal, OCLocalized(@"File Provider access has been disabled by the administrator. Please use the app to create new folders.")) translatedError]);
return;
}

FPLogCmdBegin(@"CreateDir", @"Start of createDirectoryWithName=%@, inParentItemIdentifier=%@", directoryName, parentItemIdentifier);

if ((parentItem = (OCItem *)[self itemForIdentifier:parentItemIdentifier error:&error]) != nil)
Expand Down Expand Up @@ -647,6 +653,12 @@ - (void)importDocumentAtURL:(NSURL *)fileURL toParentItemIdentifier:(NSFileProvi
NSError *error = nil;
BOOL stopAccess = NO;

if (!OCFileProviderSettings.browseable)
{
completionHandler(nil, [OCErrorWithDescription(OCErrorInternal, OCLocalized(@"File Provider access has been disabled by the administrator. Please use the share extension to import files.")) translatedError]);
return;
}

if (![Branding.sharedBranding isImportMethodAllowed:BrandingFileImportMethodFileProvider])
{
completionHandler(nil, [OCErrorWithDescription(OCErrorInternal, OCLocalized(@"Importing files through the File Provider is not allowed on this device.")) translatedError]);
Expand Down Expand Up @@ -871,6 +883,16 @@ - (void)setLastUsedDate:(NSDate *)lastUsedDate forItemIdentifier:(NSFileProvider
#pragma mark - Enumeration
- (nullable id<NSFileProviderEnumerator>)enumeratorForContainerItemIdentifier:(NSFileProviderItemIdentifier)containerItemIdentifier error:(NSError **)error
{
if (!OCFileProviderSettings.browseable)
{
if (error != NULL)
{
*error = [NSError errorWithDomain:NSFileProviderErrorDomain code:NSFileProviderErrorNotAuthenticated userInfo:nil];
}

return (nil);
}

if (AppLockSettings.sharedAppLockSettings.lockEnabled)
{
NSData *lockedDateData = [[[OCAppIdentity sharedAppIdentity] keychain] readDataFromKeychainItemForAccount:@"app.passcode" path:@"lockedDate"];
Expand Down
25 changes: 20 additions & 5 deletions ownCloud Share Extension/ShareViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ class ShareViewController: MoreStaticTableViewController {
// Share extension allowed
if !willAppearInitial {
willAppearInitial = true

if AppLockManager.supportedOnDevice {
AppLockManager.shared.showLockscreenIfNeeded()
}
if AppLockManager.supportedOnDevice {
AppLockManager.shared.showLockscreenIfNeeded()
}

if let appexNavigationController = self.navigationController as? AppExtensionNavigationController {
appexNavigationController.dismissalAction = { [weak self] (_) in
AppLockManager.shared.appDidEnterBackground()
self?.returnCores(completion: {
Log.debug("Returned all cores (share sheet was closed / dismissed)")
})
Expand Down Expand Up @@ -96,6 +97,18 @@ class ShareViewController: MoreStaticTableViewController {
didAppearInitial = true
}
}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
if didAppearInitial {
AppLockManager.shared.appDidEnterBackground()
}
}

@objc open override func dismissAnimated() {
AppLockManager.shared.appDidEnterBackground()
super.dismissAnimated()
}

private var requestedCoreBookmarks : [OCBookmark] = []

Expand Down Expand Up @@ -146,6 +159,7 @@ class ShareViewController: MoreStaticTableViewController {
}

@objc private func cancelAction () {
AppLockManager.shared.appDidEnterBackground()
self.returnCores(completion: {
let error = NSError(domain: NSErrorDomain.ShareViewErrorDomain, code: 0, userInfo: [NSLocalizedDescriptionKey: "Canceled by user"])
self.extensionContext?.cancelRequest(withError: error)
Expand All @@ -172,6 +186,7 @@ class ShareViewController: MoreStaticTableViewController {

for (bookmark) in bookmarks {
let row = StaticTableViewRow(buttonWithAction: { (_ row, _ sender) in
self.didAppearInitial = false
self.openDirectoryPicker(for: bookmark, withBackButton: true)
}, title: bookmark.shortName, style: .plain, image: UIImage(named: "bookmark-icon")?.scaledImageFitting(in: CGSize(width: 25.0, height: 25.0)), imageWidth: 25, alignment: .left)
actionsRows.append(row)
Expand Down Expand Up @@ -249,7 +264,7 @@ class ShareViewController: MoreStaticTableViewController {
func showAlert(title: String?, message: String? = nil, error: Error? = nil, decisionHandler: @escaping ((_ continue: Bool) -> Void)) {
OnMainThread {
let message = message ?? ((error != nil) ? error?.localizedDescription : nil)
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
let alert = ThemedAlertController(title: title, message: message, preferredStyle: .alert)

alert.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: { (_) in
decisionHandler(false)
Expand Down
16 changes: 12 additions & 4 deletions ownCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@
DC4FEAE7209E3A7700D4476B /* OCIssue+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4FEAE6209E3A7700D4476B /* OCIssue+Extension.swift */; };
DC51FD922475715F0069AB79 /* CellularSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC51FD912475715F0069AB79 /* CellularSettingsViewController.swift */; };
DC576EC022647A070087316D /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DC576EC222647A070087316D /* Localizable.strings */; };
DC6179E728E0578400C7C4E0 /* OCFileProviderSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = DC6179E528E0578400C7C4E0 /* OCFileProviderSettings.h */; settings = {ATTRIBUTES = (Public, ); }; };
DC6179E828E0578400C7C4E0 /* OCFileProviderSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = DC6179E628E0578400C7C4E0 /* OCFileProviderSettings.m */; };
DC625141225C904700736874 /* NSError+MessageResolution.m in Sources */ = {isa = PBXBuildFile; fileRef = DC625140225C904700736874 /* NSError+MessageResolution.m */; };
DC625148225CEB2C00736874 /* UploadFileAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC625147225CEB2C00736874 /* UploadFileAction.swift */; };
DC62514A225CEB4300736874 /* UploadMediaAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC625149225CEB4300736874 /* UploadMediaAction.swift */; };
Expand Down Expand Up @@ -1264,6 +1266,8 @@
DC51FD912475715F0069AB79 /* CellularSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CellularSettingsViewController.swift; sourceTree = "<group>"; };
DC576EC122647A070087316D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
DC5D9E742496512400BFFE8E /* MessageQueueExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageQueueExample.swift; sourceTree = "<group>"; };
DC6179E528E0578400C7C4E0 /* OCFileProviderSettings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OCFileProviderSettings.h; sourceTree = "<group>"; };
DC6179E628E0578400C7C4E0 /* OCFileProviderSettings.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OCFileProviderSettings.m; sourceTree = "<group>"; };
DC62513F225C904700736874 /* NSError+MessageResolution.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSError+MessageResolution.h"; sourceTree = "<group>"; };
DC625140225C904700736874 /* NSError+MessageResolution.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSError+MessageResolution.m"; sourceTree = "<group>"; };
DC625147225CEB2C00736874 /* UploadFileAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadFileAction.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2987,6 +2991,8 @@
DCF2DA7524C82C9F0026D790 /* OCFileProviderService.h */,
DC049155258C00C400DEDC27 /* OCFileProviderServiceStandby.m */,
DC049154258C00C400DEDC27 /* OCFileProviderServiceStandby.h */,
DC6179E628E0578400C7C4E0 /* OCFileProviderSettings.m */,
DC6179E528E0578400C7C4E0 /* OCFileProviderSettings.h */,
);
path = "File Provider Services";
sourceTree = "<group>";
Expand Down Expand Up @@ -3189,6 +3195,7 @@
DCC832F1242CC27B00153F8C /* NotificationMessagePresenter.h in Headers */,
DC080CF2238C8DF70044C5D2 /* OCLicenseAppStoreItem.h in Headers */,
DCD9B87B2379612B00691929 /* OCLicenseManager+Internal.h in Headers */,
DC6179E728E0578400C7C4E0 /* OCFileProviderSettings.h in Headers */,
DC774E6322F44E6D000B11A1 /* OCCore+BundleImport.h in Headers */,
DCDBB60A2525305600FAD707 /* NotificationAuthErrorForwarder.h in Headers */,
DC080CE6238AE3F40044C5D2 /* OCLicenseAppStoreProvider.h in Headers */,
Expand Down Expand Up @@ -4294,6 +4301,7 @@
DC24B29825BA2A34005783E2 /* Branding.m in Sources */,
DCFEFE3E236877B7009A142F /* OCLicenseProduct.m in Sources */,
DC774E6422F44E6D000B11A1 /* OCCore+BundleImport.m in Sources */,
DC6179E828E0578400C7C4E0 /* OCFileProviderSettings.m in Sources */,
DCF2DA7E24C835BF0026D790 /* OCVault+FPServices.m in Sources */,
DCDC208D239912DC003CFF5B /* OCLicenseTransaction.m in Sources */,
DC23D1D9238F390A00423F62 /* OCLicenseAppStoreReceipt.m in Sources */,
Expand Down Expand Up @@ -4686,8 +4694,8 @@
APP_BUILD_FLAGS = "$(inherited)";
APP_BUILD_FLAGS_SWIFT = "$(APP_BUILD_FLAGS)";
APP_PRODUCT_NAME = ownCloud;
APP_SHORT_VERSION = 11.10.1;
APP_VERSION = 226;
APP_SHORT_VERSION = 11.11.0;
APP_VERSION = 229;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -4755,8 +4763,8 @@
APP_BUILD_FLAGS = "$(inherited)";
APP_BUILD_FLAGS_SWIFT = "$(APP_BUILD_FLAGS)";
APP_PRODUCT_NAME = ownCloud;
APP_SHORT_VERSION = 11.10.1;
APP_VERSION = 226;
APP_SHORT_VERSION = 11.11.0;
APP_VERSION = 229;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PresentationModeAction: Action {
}

if !DisplaySleepPreventer.shared.isPreventing(for: PresentationModeAction.reason) {
let alertController = UIAlertController(title: "Presentation Mode".localized, message: "Enabling presentation mode will prevent the display from sleep mode until the view is closed.".localized, preferredStyle: .alert)
let alertController = ThemedAlertController(title: "Presentation Mode".localized, message: "Enabling presentation mode will prevent the display from sleep mode until the view is closed.".localized, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil))
alertController.addAction(UIAlertAction(title: "Enable".localized, style: .default, handler: { (_) in
DisplaySleepPreventer.shared.startPreventingDisplaySleep(for: PresentationModeAction.reason)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class UploadMediaAction: UploadBaseAction {
if granted {
self.presentImageGalleryPicker()
} else {
let alert = UIAlertController.alertControllerForPhotoLibraryAuthorizationInSettings()
let alert = ThemedAlertController.alertControllerForPhotoLibraryAuthorizationInSettings()
viewController.present(alert, animated: true)
self.completed()
}
Expand Down
13 changes: 12 additions & 1 deletion ownCloud/Client/Actions/EditDocumentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,18 @@ class EditDocumentViewController: QLPreviewController, Themeable {

@objc func enableEditingMode() {
// Activate editing mode by performing the action on pencil icon. Unfortunately that's the only way to do it apparently
if #available(iOS 15.0, *) {
if #available(iOS 16.0, *) {
if self.navigationItem.rightBarButtonItems?.count ?? 0 > 3 {
guard let markupButton = self.navigationItem.rightBarButtonItems?[0] else { return }
_ = markupButton.target?.perform(markupButton.action, with: markupButton)
} else if self.toolbarItems?.count ?? 0 > 4 {
guard let markupButton = self.toolbarItems?[4] else { return }
_ = markupButton.target?.perform(markupButton.action, with: markupButton)
} else if self.toolbarItems?.count ?? 0 < 4 {
guard let markupButton = self.toolbarItems?[2] else { return }
_ = markupButton.target?.perform(markupButton.action, with: markupButton)
}
} else if #available(iOS 15.0, *) {
if self.navigationItem.rightBarButtonItems?.count ?? 0 > 2 {
guard let markupButton = self.navigationItem.rightBarButtonItems?[1] else { return }
_ = markupButton.target?.perform(markupButton.action, with: markupButton)
Expand Down
3 changes: 1 addition & 2 deletions ownCloud/Client/ClientRootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,7 @@ class ClientRootViewController: UITabBarController, BookmarkContainer, ToolAndTa
extension ClientRootViewController : Themeable {
func applyThemeCollection(theme: Theme, collection: ThemeCollection, event: ThemeEvent) {
self.tabBar.applyThemeCollection(collection)

self.toolbar?.applyThemeCollection(Theme.shared.activeCollection)
self.toolbar?.applyThemeCollection(collection)

self.view.backgroundColor = collection.tableBackgroundColor
}
Expand Down
2 changes: 1 addition & 1 deletion ownCloud/Client/Viewer/DisplayViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ class DisplayViewController: UIViewController, Themeable, OCQueryDelegate {
switch updateStrategy {
case .ask:
OnMainThread {
let alert = UIAlertController(title: NSString(format: "%@ was updated".localized as NSString, item.name ?? "File".localized) as String, message: "Would you like to view the updated version?".localized, preferredStyle: .alert)
let alert = ThemedAlertController(title: NSString(format: "%@ was updated".localized as NSString, item.name ?? "File".localized) as String, message: "Would you like to view the updated version?".localized, preferredStyle: .alert)

alert.addAction(UIAlertAction(title: "Show new version".localized, style: .default, handler: { [weak self] (_) in
self?.updateStrategy = .ask
Expand Down
Loading