diff options
author | marinofaggiana <marino@marinofaggiana.com> | 2020-10-04 14:55:06 +0300 |
---|---|---|
committer | marinofaggiana <marino@marinofaggiana.com> | 2020-10-04 14:55:06 +0300 |
commit | 77a12c8dfebcb58a4cbd783ec5c1b066c8b33d88 (patch) | |
tree | c38872229ce8a23da775b2245fb597835580feb5 /iOSClient | |
parent | 27265187e727d5b681619d6a7a70310dc4f035c4 (diff) |
coding
Diffstat (limited to 'iOSClient')
-rw-r--r-- | iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift | 2 | ||||
-rw-r--r-- | iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift | 2 | ||||
-rw-r--r-- | iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift | 2 | ||||
-rw-r--r-- | iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift | 2 | ||||
-rw-r--r-- | iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift | 4 | ||||
-rw-r--r-- | iOSClient/Main/NCCollectionCommon.swift | 14 | ||||
-rw-r--r-- | iOSClient/Main/NCCollectionViewCommon.swift | 4 | ||||
-rw-r--r-- | iOSClient/Main/NCDetailViewController.swift | 2 | ||||
-rw-r--r-- | iOSClient/Media/NCMedia.swift | 2 | ||||
-rw-r--r-- | iOSClient/Select/NCSelect.swift | 14 | ||||
-rw-r--r-- | iOSClient/Settings/CCManageAutoUpload.m | 2 | ||||
-rw-r--r-- | iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m | 2 | ||||
-rw-r--r-- | iOSClient/Viewer/NCViewerRichdocument.swift | 2 |
13 files changed, 31 insertions, 23 deletions
diff --git a/iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift b/iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift index 892b0c1be..82e46ca8f 100644 --- a/iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift +++ b/iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift @@ -301,7 +301,7 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate { // MARK: - Action - func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, array: [Any], buttonType: String, overwrite: Bool) { + func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, items: [Any], buttonType: String, overwrite: Bool) { if serverUrl != nil { diff --git a/iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift b/iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift index b0fedea23..928002727 100644 --- a/iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift +++ b/iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift @@ -211,7 +211,7 @@ import NCCommunication // MARK: - Action - func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, array: [Any], buttonType: String, overwrite: Bool) { + func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, items: [Any], buttonType: String, overwrite: Bool) { guard let serverUrl = serverUrl else { return diff --git a/iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift b/iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift index f5079d50c..92a9bf0bf 100644 --- a/iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift +++ b/iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift @@ -373,7 +373,7 @@ class NCCreateFormUploadScanDocument: XLFormViewController, NCSelectDelegate, NC // MARK: - Action - func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, array: [Any], buttonType: String, overwrite: Bool) { + func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, items: [Any], buttonType: String, overwrite: Bool) { if serverUrl != nil { diff --git a/iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift b/iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift index 40baabbb2..666f37832 100644 --- a/iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift +++ b/iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift @@ -195,7 +195,7 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud // MARK: - Action - func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, array: [Any], buttonType: String, overwrite: Bool) { + func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, items: [Any], buttonType: String, overwrite: Bool) { if serverUrl != nil { diff --git a/iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift b/iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift index 52b6c1bf2..adb63f487 100644 --- a/iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift +++ b/iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift @@ -179,7 +179,7 @@ extension NCCollectionViewCommon { title: NSLocalizedString("_move_or_copy_", comment: ""), icon: CCGraphics.changeThemingColorImage(UIImage(named: "move"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon), action: { menuAction in - NCCollectionCommon.shared.openSelectView(viewController: viewController, array: [metadata]) + NCCollectionCommon.shared.openSelectView(viewController: viewController, items: [metadata]) } ) ) @@ -345,7 +345,7 @@ extension NCCollectionViewCommon { } } if meradatasSelect.count > 0 { - NCCollectionCommon.shared.openSelectView(viewController: viewController, array: meradatasSelect) + NCCollectionCommon.shared.openSelectView(viewController: viewController, items: meradatasSelect) } self.tapSelect(sender: self) } diff --git a/iOSClient/Main/NCCollectionCommon.swift b/iOSClient/Main/NCCollectionCommon.swift index 5065a95d9..9f07f7ac3 100644 --- a/iOSClient/Main/NCCollectionCommon.swift +++ b/iOSClient/Main/NCCollectionCommon.swift @@ -91,21 +91,25 @@ class NCCollectionCommon: NSObject, NCSelectDelegate { // MARK: - NCSelect + Delegate - func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, array: [Any], buttonType: String, overwrite: Bool) { - if (serverUrl != nil && array.count > 0) { + func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, items: [Any], buttonType: String, overwrite: Bool) { + if (serverUrl != nil && items.count > 0) { var move = true if buttonType == "done1" { move = false } - for metadata in array as! [tableMetadata] { + for metadata in items as! [tableMetadata] { NCOperationQueue.shared.copyMove(metadata: metadata, serverUrl: serverUrl!, overwrite: overwrite, move: move) } } } - func openSelectView(viewController: UIViewController, array: [Any]) { + func openSelectView(viewController: UIViewController, items: [Any]) { let navigationController = UIStoryboard.init(name: "NCSelect", bundle: nil).instantiateInitialViewController() as! UINavigationController let vc = navigationController.topViewController as! NCSelect + var copyItems: [Any] = [] + for item in items { + copyItems.append(item) + } vc.delegate = self vc.hideButtonCreateFolder = false @@ -117,7 +121,7 @@ class NCCollectionCommon: NSObject, NCSelectDelegate { vc.titleButtonDone1 = NSLocalizedString("_copy_",comment: "") vc.isButtonDone1Hide = false vc.isOverwriteHide = false - vc.array = array + vc.items = copyItems navigationController.modalPresentationStyle = .fullScreen viewController.present(navigationController, animated: true, completion: nil) diff --git a/iOSClient/Main/NCCollectionViewCommon.swift b/iOSClient/Main/NCCollectionViewCommon.swift index 1586b3fc9..6180213a2 100644 --- a/iOSClient/Main/NCCollectionViewCommon.swift +++ b/iOSClient/Main/NCCollectionViewCommon.swift @@ -658,12 +658,16 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS func tapShareListItem(with objectId: String, sender: Any) { + if isEditMode { return } guard let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(objectId) else { return } + NCNetworkingNotificationCenter.shared.openShare(ViewController: self, metadata: metadata, indexPage: 2) } func tapMoreGridItem(with objectId: String, namedButtonMore: String, sender: Any) { + if isEditMode { return } + guard let metadata = NCManageDatabase.sharedInstance.getMetadataFromOcId(objectId) else { return } if namedButtonMore == k_buttonMoreMore { diff --git a/iOSClient/Main/NCDetailViewController.swift b/iOSClient/Main/NCDetailViewController.swift index 1be817126..433965fbf 100644 --- a/iOSClient/Main/NCDetailViewController.swift +++ b/iOSClient/Main/NCDetailViewController.swift @@ -831,7 +831,7 @@ extension NCDetailViewController: NCViewerImageViewControllerDelegate, NCViewerI extension NCDetailViewController: NCSelectDelegate { - func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, array: [Any], buttonType: String, overwrite: Bool) { + func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, items: [Any], buttonType: String, overwrite: Bool) { if let metadata = self.metadata, let serverUrl = serverUrl { if buttonType == "done" { NCNetworking.shared.moveMetadata(metadata, serverUrlTo: serverUrl, overwrite: overwrite) { (errorCode, errorDescription) in diff --git a/iOSClient/Media/NCMedia.swift b/iOSClient/Media/NCMedia.swift index 021b0c3ab..6f1b42c4a 100644 --- a/iOSClient/Media/NCMedia.swift +++ b/iOSClient/Media/NCMedia.swift @@ -345,7 +345,7 @@ class NCMedia: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate, // MARK: Select Path - func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, array: [Any], buttonType: String, overwrite: Bool) { + func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, items: [Any], buttonType: String, overwrite: Bool) { if serverUrl != nil { let path = CCUtility.returnPathfromServerUrl(serverUrl, urlBase: appDelegate.urlBase, account: appDelegate.account) ?? "" NCManageDatabase.sharedInstance.setAccountMediaPath(path, account: appDelegate.account) diff --git a/iOSClient/Select/NCSelect.swift b/iOSClient/Select/NCSelect.swift index a0a5a9938..682720a94 100644 --- a/iOSClient/Select/NCSelect.swift +++ b/iOSClient/Select/NCSelect.swift @@ -25,7 +25,7 @@ import Foundation import NCCommunication @objc protocol NCSelectDelegate { - @objc func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, array: [Any], buttonType: String, overwrite: Bool) + @objc func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, items: [Any], buttonType: String, overwrite: Bool) } class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegate, NCGridCellDelegate, NCSectionHeaderMenuDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate { @@ -56,7 +56,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat @objc var titleButtonDone1 = NSLocalizedString("_copy_", comment: "") @objc var isButtonDone1Hide = true @objc var isOverwriteHide = true - @objc var array: [Any] = [] + @objc var items: [Any] = [] var titleCurrentFolder = NCBrandOptions.sharedInstance.brand var serverUrl = "" @@ -247,17 +247,17 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat // MARK: ACTION @IBAction func actionCancel(_ sender: Any) { - delegate?.dismissSelect(serverUrl: nil, metadata: nil, type: type, array: array, buttonType: "cancel", overwrite: overwrite) + delegate?.dismissSelect(serverUrl: nil, metadata: nil, type: type, items: items, buttonType: "cancel", overwrite: overwrite) self.dismiss(animated: true, completion: nil) } @IBAction func actionDone(_ sender: Any) { - delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadataFolder, type: type, array: array, buttonType: "done", overwrite: overwrite) + delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadataFolder, type: type, items: items, buttonType: "done", overwrite: overwrite) self.dismiss(animated: true, completion: nil) } @IBAction func actionDone1(_ sender: Any) { - delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadataFolder, type: type, array: array, buttonType: "done1", overwrite: overwrite) + delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadataFolder, type: type, items: items, buttonType: "done1", overwrite: overwrite) self.dismiss(animated: true, completion: nil) } @@ -393,7 +393,7 @@ extension NCSelect: UICollectionViewDelegate { visualController.isButtonDone1Hide = isButtonDone1Hide visualController.isOverwriteHide = isOverwriteHide visualController.overwrite = overwrite - visualController.array = array + visualController.items = items visualController.titleCurrentFolder = metadataTouch!.fileNameView visualController.serverUrl = serverUrlPush @@ -402,7 +402,7 @@ extension NCSelect: UICollectionViewDelegate { } else { - delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadata, type: type, array: array, buttonType: "select", overwrite: overwrite) + delegate?.dismissSelect(serverUrl: serverUrl, metadata: metadata, type: type, items: items, buttonType: "select", overwrite: overwrite) self.dismiss(animated: true, completion: nil) } } diff --git a/iOSClient/Settings/CCManageAutoUpload.m b/iOSClient/Settings/CCManageAutoUpload.m index 33fc92e8c..d081ef10a 100644 --- a/iOSClient/Settings/CCManageAutoUpload.m +++ b/iOSClient/Settings/CCManageAutoUpload.m @@ -482,7 +482,7 @@ return sectionName; } -- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type array:(NSArray *)array buttonType:(NSString *)buttonType overwrite:(BOOL)overwrite +- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type items:(NSArray *)items buttonType:(NSString *)buttonType overwrite:(BOOL)overwrite { if (serverUrl != nil) { diff --git a/iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m b/iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m index d53afe1a4..5b8351e49 100644 --- a/iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m +++ b/iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m @@ -139,7 +139,7 @@ #pragma mark == IBAction == #pragma -------------------------------------------------------------------------------------------- -- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type array:(NSArray *)array buttonType:(NSString *)buttonType overwrite:(BOOL)overwrite +- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type items:(NSArray *)items buttonType:(NSString *)buttonType overwrite:(BOOL)overwrite { if (serverUrl) { serverUrlLocal = serverUrl; diff --git a/iOSClient/Viewer/NCViewerRichdocument.swift b/iOSClient/Viewer/NCViewerRichdocument.swift index d60d89ae1..73be80261 100644 --- a/iOSClient/Viewer/NCViewerRichdocument.swift +++ b/iOSClient/Viewer/NCViewerRichdocument.swift @@ -213,7 +213,7 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand //MARK: - - func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, array: [Any], buttonType: String, overwrite: Bool) { + func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, items: [Any], buttonType: String, overwrite: Bool) { if serverUrl != nil && metadata != nil { |