Fix XIB initialisation in LockViewController
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 31 Jul 2024 10:17:54 +0000 (18:17 +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 af24b5ea534e10e568778a3f3d0dbc78ccb6d9ed..4e033740a4474c3487496770024d1b2c012a4ed6 100644 (file)
@@ -22,6 +22,10 @@ class LockViewController: NSViewController {
     @IBOutlet weak var closeButton: NSButton!
     @IBOutlet weak var loadingIndicator: NSProgressIndicator!
 
+    public override var nibName: NSNib.Name? {
+        return NSNib.Name(self.className)
+    }
+
     var actionViewController: DocumentActionViewController! {
         return parent as? DocumentActionViewController
     }
@@ -30,22 +34,31 @@ class LockViewController: NSViewController {
         self.itemIdentifiers = itemIdentifiers
         self.locking = locking
         super.init(nibName: nil, bundle: nil)
+    }
+
+    required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
 
+    override func viewDidLoad() {
         guard let firstItem = itemIdentifiers.first else {
             Logger.shareViewController.error("called without items")
             closeAction(self)
             return
         }
 
+        Logger.lockViewController.info(
+            """
+            Locking \(self.locking ? "enabled" : "disabled", privacy: .public) for items:
+            \(firstItem.rawValue, privacy: .public)
+            """
+        )
+
         Task {
             await processItemIdentifier(firstItem)
         }
     }
 
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
     @IBAction func closeAction(_ sender: Any) {
         actionViewController.extensionContext.completeRequest()
     }
index 0a583a09c3f46eb7301e95fef877246fd65d6a99..33c88d33e328f6a5f15fd1407f0424af3670ca79 100644 (file)
@@ -14,6 +14,7 @@
                 <outlet property="fileNameIcon" destination="KlP-OW-SKo" id="Dey-vA-qIG"/>
                 <outlet property="fileNameLabel" destination="LDe-7m-hvL" id="AzB-UH-ndO"/>
                 <outlet property="loadingIndicator" destination="UWQ-uR-PJA" id="Swv-It-LT9"/>
+                <outlet property="view" destination="Ge9-bk-WPE" id="F9c-24-JAT"/>
             </connections>
         </customObject>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>