KMSavePanelAccessoryController.swift 982 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // KMSavePanelAccessoryController.swift
  3. // PDF Master
  4. //
  5. // Created by wanjun on 2023/10/10.
  6. //
  7. import Cocoa
  8. @objcMembers
  9. class KMSavePanelAccessoryController: NSViewController {
  10. @IBOutlet weak var openAutomaticButton: NSButton!
  11. var _needOpen: Bool = false
  12. override init(nibName nibNameOrNil: NSNib.Name?, bundle nibBundleOrNil: Bundle?) {
  13. super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
  14. }
  15. required init?(coder: NSCoder) {
  16. super.init(coder: coder)
  17. }
  18. override func awakeFromNib() {
  19. super.awakeFromNib()
  20. openAutomaticButton.title = NSLocalizedString("Open the document after saving", comment: "")
  21. openAutomaticButton.state = NSControl.StateValue.off
  22. }
  23. @IBAction func buttonClickedOpenAutomatic(_ sender: NSButton) {
  24. _needOpen = sender.state == NSControl.StateValue.on
  25. }
  26. //MARK: Get、Set
  27. var needOpen: Bool {
  28. return _needOpen
  29. }
  30. }