Store file provider item identifiers in ShareViewController

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-02-21 17:58:39 +08:00
Родитель ce026dfd94
Коммит 7a9ca59734
2 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -27,7 +27,7 @@ class DocumentActionViewController: FPUIActionExtensionViewController {
Logger.actionViewController.info("Preparing for action: \(actionIdentifier)")
if actionIdentifier == "com.nextcloud.desktopclient.FileProviderUIExt.ShareAction" {
prepare(childViewController: ShareViewController())
prepare(childViewController: ShareViewController(itemIdentifiers))
}
}

Просмотреть файл

@ -6,8 +6,11 @@
//
import AppKit
import FileProvider
class ShareViewController: NSViewController {
let itemIdentifiers: [NSFileProviderItemIdentifier]
@IBOutlet weak var fileNameIcon: NSImageView!
@IBOutlet weak var fileNameLabel: NSTextField!
@IBOutlet weak var descriptionLabel: NSTextField!
@ -20,4 +23,13 @@ class ShareViewController: NSViewController {
var actionViewController: DocumentActionViewController! {
return parent as? DocumentActionViewController
}
init(_ itemIdentifiers: [NSFileProviderItemIdentifier]) {
self.itemIdentifiers = itemIdentifiers
super.init(nibName: nil, bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}