KMTextHintWindowController.swift 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // KMTextHintWindowController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by kdanmobile on 2023/11/2.
  6. //
  7. import Cocoa
  8. class KMTextHintWindowController: NSWindowController{
  9. @IBOutlet var headerTextField: NSTextField!
  10. @IBOutlet var detailTextfield: NSTextField!
  11. @IBOutlet var actionButton: NSButton!
  12. override func windowDidLoad() {
  13. super.windowDidLoad()
  14. self.actionButton.title = NSLocalizedString("OK", comment: "")
  15. self.headerTextField.stringValue = NSLocalizedString("Cannot add conversion tasks.", comment: "")
  16. self.detailTextfield.stringValue = NSLocalizedString("The conversion is in progress... Please wait for the conversion to be completed before proceeding.", comment: "")
  17. }
  18. @IBAction func buttonClicked_Action(_ sender: NSButton) {
  19. if #available(macOS 10.13, *) {
  20. self.window?.endSheet(sender.window!)
  21. } else {
  22. NSApp.endSheet(self.window!)
  23. }
  24. self.window?.orderOut(self)
  25. }
  26. func updateTitleString(titleString: String, detailString: String) {
  27. self.headerTextField.stringValue = titleString
  28. self.detailTextfield.stringValue = detailString
  29. }
  30. }