-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* - Made the Copy action. - Fix some UI Color scheme inconsistencies. * - Made the 'Copy here' button respect the original title * - SDK Update * - Fix for a lint warning
- Loading branch information
1 parent
8e0776b
commit 330f7be
Showing
8 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
Submodule ios-sdk
updated
31 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
ownCloud/Client/Actions/Actions+Extensions/CopyAction.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// CopyAction.swift | ||
// ownCloud | ||
// | ||
// Created by Pablo Carrascal on 14/01/2019. | ||
// Copyright © 2019 ownCloud GmbH. All rights reserved. | ||
// | ||
|
||
/* | ||
* Copyright (C) 2018, ownCloud GmbH. | ||
* | ||
* This code is covered by the GNU Public License Version 3. | ||
* | ||
* For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/ | ||
* You should have received a copy of this license along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>. | ||
* | ||
*/ | ||
|
||
import Foundation | ||
import ownCloudSDK | ||
|
||
class CopyAction : Action { | ||
override class var identifier : OCExtensionIdentifier? { return OCExtensionIdentifier("com.owncloud.action.copy") } | ||
override class var category : ActionCategory? { return .normal } | ||
override class var name : String? { return "Copy".localized } | ||
override class var locations : [OCExtensionLocationIdentifier]? { return [.moreItem, .moreFolder] } | ||
|
||
// MARK: - Extension matching | ||
override class func applicablePosition(forContext: ActionContext) -> ActionPosition { | ||
// Examine items in context | ||
return .middle | ||
} | ||
|
||
// MARK: - Action implementation | ||
override func run() { | ||
guard context.items.count > 0, let viewController = context.viewController, let core = self.core else { | ||
completionHandler?(NSError(ocError: .insufficientParameters)) | ||
return | ||
} | ||
|
||
let items = context.items | ||
|
||
let directoryPickerViewController = ClientDirectoryPickerViewController(core: core, path: "/", selectButtonTitle: "Copy here", completion: { (selectedDirectory) in | ||
items.forEach({ (item) in | ||
|
||
if let progress = self.core?.copy(item, to: selectedDirectory!, withName: item.name!, options: nil, resultHandler: { (error, _, _, _) in | ||
if error != nil { | ||
self.completed(with: error) | ||
} else { | ||
self.completed() | ||
} | ||
|
||
}) { | ||
self.publish(progress: progress) | ||
} | ||
}) | ||
}) | ||
|
||
let pickerNavigationController = ThemeNavigationController(rootViewController: directoryPickerViewController) | ||
viewController.present(pickerNavigationController, animated: true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters