KMCloseApplyWC.swift 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // KMCloseApplyWC.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by wanjun on 2024/11/5.
  6. // 手动撤销申请WindowController
  7. //
  8. import Cocoa
  9. class KMCloseApplyWC: NSWindowController {
  10. @IBOutlet weak var titleLabel: NSTextField!
  11. @IBOutlet weak var subTitleLabel: NSTextField!
  12. @IBOutlet weak var yesButton: NSButton!
  13. var currentTime: String = ""
  14. var logOffTime: String = ""
  15. private var viewModel = KMUserInfoVCModel()
  16. static let shared: KMCloseApplyWC = {
  17. let windowC = KMCloseApplyWC(windowNibName: "KMCloseApplyWC")
  18. return windowC
  19. }()
  20. override func windowDidLoad() {
  21. super.windowDidLoad()
  22. // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
  23. languageLocalized()
  24. initializeUI()
  25. }
  26. // MARK: Private Method
  27. private func languageLocalized() -> Void {
  28. titleLabel.stringValue = NSLocalizedString("账号注销申请已提交", tableName: "MemberCenterLocalizable", comment: "")
  29. subTitleLabel.stringValue = String(format: NSLocalizedString("您的帐户将于%@自动注销。欢迎您再次使用PDF Reader Pro的产品与服务!\n在%@之前,您可以使用此帐户登入并选择撤销「注销帐户」,然后继续使用帐户,您享有的权益与产品服务将会保留。", tableName: "MemberCenterLocalizable", comment: ""), logOffTime, logOffTime)
  30. yesButton.title = NSLocalizedString("知道了", tableName: "MemberCenterLocalizable", comment: "")
  31. }
  32. private func initializeUI() -> Void {
  33. titleLabel.textColor = NSColor(named: "000000_0.85")
  34. titleLabel.font = NSFont.SFProTextSemiboldFont(13)
  35. subTitleLabel.textColor = NSColor(named: "000000_0.85")
  36. subTitleLabel.font = NSFont.SFProTextRegularFont(12)
  37. yesButton.setTitleColor(color: NSColor(named: "FFFFFF") ?? NSColor.white, font: NSFont.SFProTextRegularFont(13))
  38. }
  39. // MARK: Button Action
  40. @IBAction func yesButtonAction(_ sender: NSButton) {
  41. KMUserInfoVCModel().refreshUserInfo { success, msg in
  42. self.window?.close()
  43. }
  44. }
  45. }