saveButton.isEnabled = enabled
deleteButton.isEnabled = enabled
}
+
+ @IBAction func save(_ sender: Any) {
+ Task { @MainActor in
+ let password = passwordProtectCheckbox.state == .on
+ ? passwordSecureField.stringValue
+ : ""
+ let expireDate = expirationDateCheckbox.state == .on
+ ? NKShare.formattedDateString(date: expirationDatePicker.dateValue)
+ : ""
+ let note = noteForRecipientCheckbox.state == .on
+ ? noteTextField.stringValue
+ : ""
+ let label = labelTextField.stringValue
+ let hideDownload = hideDownloadCheckbox.state == .on
+
+ setAllFields(enabled: false)
+ deleteButton.isEnabled = false
+ saveButton.isEnabled = false
+ _ = await controller?.save(
+ password: password,
+ expireDate: expireDate,
+ note: note,
+ label: label,
+ hideDownload: hideDownload
+ )
+ }
+ }
}
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
+ <connections>
+ <action selector="save:" target="EXb-m8-yzj" id="O4N-dj-SlN"/>
+ </connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Bmf-yY-Y7V">
<rect key="frame" x="227" y="-7" width="240" height="32"/>