Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'iOSClient/Diagnostics/NCCapabilitiesViewController.swift')
-rw-r--r--iOSClient/Diagnostics/NCCapabilitiesViewController.swift63
1 files changed, 32 insertions, 31 deletions
diff --git a/iOSClient/Diagnostics/NCCapabilitiesViewController.swift b/iOSClient/Diagnostics/NCCapabilitiesViewController.swift
index 7451affac..3e5bde1bd 100644
--- a/iOSClient/Diagnostics/NCCapabilitiesViewController.swift
+++ b/iOSClient/Diagnostics/NCCapabilitiesViewController.swift
@@ -22,7 +22,7 @@
//
import UIKit
-import NCCommunication
+import NextcloudKit
class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionControllerDelegate {
@@ -86,79 +86,79 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
textView.layer.cornerRadius = 15
textView.layer.masksToBounds = true
- textView.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ textView.backgroundColor = .secondarySystemBackground
statusFileSharing.layer.cornerRadius = 12.5
statusFileSharing.layer.borderWidth = 0.5
- statusFileSharing.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusFileSharing.layer.borderColor = UIColor.systemGray.cgColor
statusFileSharing.layer.masksToBounds = true
- statusFileSharing.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusFileSharing.backgroundColor = .secondarySystemBackground
statusExternalSite.layer.cornerRadius = 12.5
statusExternalSite.layer.borderWidth = 0.5
- statusExternalSite.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusExternalSite.layer.borderColor = UIColor.systemGray.cgColor
statusExternalSite.layer.masksToBounds = true
- statusExternalSite.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusExternalSite.backgroundColor = .secondarySystemBackground
statusEndToEndEncryption.layer.cornerRadius = 12.5
statusEndToEndEncryption.layer.borderWidth = 0.5
- statusEndToEndEncryption.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusEndToEndEncryption.layer.borderColor = UIColor.systemGray.cgColor
statusEndToEndEncryption.layer.masksToBounds = true
- statusEndToEndEncryption.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusEndToEndEncryption.backgroundColor = .secondarySystemBackground
statusActivity.layer.cornerRadius = 12.5
statusActivity.layer.borderWidth = 0.5
- statusActivity.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusActivity.layer.borderColor = UIColor.systemGray.cgColor
statusActivity.layer.masksToBounds = true
- statusActivity.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusActivity.backgroundColor = .secondarySystemBackground
statusNotification.layer.cornerRadius = 12.5
statusNotification.layer.borderWidth = 0.5
- statusNotification.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusNotification.layer.borderColor = UIColor.systemGray.cgColor
statusNotification.layer.masksToBounds = true
- statusNotification.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusNotification.backgroundColor = .secondarySystemBackground
statusDeletedFiles.layer.cornerRadius = 12.5
statusDeletedFiles.layer.borderWidth = 0.5
- statusDeletedFiles.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusDeletedFiles.layer.borderColor = UIColor.systemGray.cgColor
statusDeletedFiles.layer.masksToBounds = true
- statusDeletedFiles.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusDeletedFiles.backgroundColor = .secondarySystemBackground
statusText.layer.cornerRadius = 12.5
statusText.layer.borderWidth = 0.5
- statusText.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusText.layer.borderColor = UIColor.systemGray.cgColor
statusText.layer.masksToBounds = true
- statusText.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusText.backgroundColor = .secondarySystemBackground
statusCollabora.layer.cornerRadius = 12.5
statusCollabora.layer.borderWidth = 0.5
- statusCollabora.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusCollabora.layer.borderColor = UIColor.systemGray.cgColor
statusCollabora.layer.masksToBounds = true
- statusCollabora.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusCollabora.backgroundColor = .secondarySystemBackground
statusOnlyOffice.layer.cornerRadius = 12.5
statusOnlyOffice.layer.borderWidth = 0.5
- statusOnlyOffice.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusOnlyOffice.layer.borderColor = UIColor.systemGray.cgColor
statusOnlyOffice.layer.masksToBounds = true
- statusOnlyOffice.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusOnlyOffice.backgroundColor = .secondarySystemBackground
statusUserStatus.layer.cornerRadius = 12.5
statusUserStatus.layer.borderWidth = 0.5
- statusUserStatus.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusUserStatus.layer.borderColor = UIColor.systemGray.cgColor
statusUserStatus.layer.masksToBounds = true
- statusUserStatus.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusUserStatus.backgroundColor = .secondarySystemBackground
statusComments.layer.cornerRadius = 12.5
statusComments.layer.borderWidth = 0.5
- statusComments.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusComments.layer.borderColor = UIColor.systemGray.cgColor
statusComments.layer.masksToBounds = true
- statusComments.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusComments.backgroundColor = .secondarySystemBackground
statusLockFile.layer.cornerRadius = 12.5
statusLockFile.layer.borderWidth = 0.5
- statusLockFile.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+ statusLockFile.layer.borderColor = UIColor.systemGray.cgColor
statusLockFile.layer.masksToBounds = true
- statusLockFile.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+ statusLockFile.backgroundColor = .secondarySystemBackground
imageFileSharing.image = UIImage(named: "share")!.image(color: NCBrandColor.shared.gray, size: 50)
imageExternalSite.image = NCUtility.shared.loadImage(named: "network", color: NCBrandColor.shared.gray)
@@ -180,7 +180,8 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
capabilitiesText = text
updateCapabilities()
} else {
- NCContentPresenter.shared.messageNotification("_error_", description: "_no_capabilities_found_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.info, errorCode: NCGlobal.shared.errorInternalError, priority: .max)
+ let error = NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: "_no_capabilities_found_")
+ NCContentPresenter.shared.showError(error: error, priority: .max)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
self.dismiss(animated: true, completion: nil)
@@ -193,15 +194,15 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
@objc func updateCapabilities() {
- NCCommunication.shared.getCapabilities { account, data, errorCode, _ in
- if errorCode == 0 && data != nil {
+ NextcloudKit.shared.getCapabilities { account, data, error in
+ if error == .success && data != nil {
NCManageDatabase.shared.addCapabilitiesJSon(data!, account: account)
// EDITORS
let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
if serverVersionMajor >= NCGlobal.shared.nextcloudVersion18 {
- NCCommunication.shared.NCTextObtainEditorDetails { account, editors, creators, errorCode, _ in
- if errorCode == 0 && account == self.appDelegate.account {
+ NextcloudKit.shared.NCTextObtainEditorDetails { account, editors, creators, data, error in
+ if error == .success && account == self.appDelegate.account {
NCManageDatabase.shared.addDirectEditing(account: account, editors: editors, creators: creators)
self.readCapabilities()
}