Add close action to lock view controller
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 30 Jul 2024 09:43:39 +0000 (17:43 +0800)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Thu, 12 Sep 2024 08:15:58 +0000 (10:15 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Locking/LockViewController.swift
shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/Locking/LockViewController.xib

index 03a7b184af0264f3d5fe84a2035bf9ac625c7efc..2d7b4735798edbc4dba1c7ace56bb56bb3384627 100644 (file)
@@ -21,6 +21,10 @@ class LockViewController: NSViewController {
     @IBOutlet weak var closeButton: NSButton!
     @IBOutlet weak var loadingIndicator: NSProgressIndicator!
 
+    var actionViewController: DocumentActionViewController! {
+        return parent as? DocumentActionViewController
+    }
+
     init(_ itemIdentifiers: [NSFileProviderItemIdentifier], locking: Bool) {
         self.itemIdentifiers = itemIdentifiers
         self.locking = locking
@@ -30,4 +34,8 @@ class LockViewController: NSViewController {
     required init?(coder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
     }
+
+    @IBAction func closeAction(_ sender: Any) {
+        actionViewController.extensionContext.completeRequest()
+    }
 }
index 61843b01c13dd760811912f7784b215cd5ebf5b1..0a583a09c3f46eb7301e95fef877246fd65d6a99 100644 (file)
@@ -80,6 +80,9 @@
                         <constraint firstAttribute="width" secondItem="7qN-mr-hAh" secondAttribute="height" multiplier="1:1" id="K00-Bi-dEy"/>
                         <constraint firstAttribute="width" constant="32" id="zVJ-h1-QXJ"/>
                     </constraints>
+                    <connections>
+                        <action selector="closeAction:" target="-2" id="E6h-U9-2eB"/>
+                    </connections>
                 </button>
             </subviews>
             <edgeInsets key="edgeInsets" left="10" right="10" top="10" bottom="10"/>