1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- import Cocoa
- class KMCloseApplyWC: NSWindowController {
-
- @IBOutlet weak var titleLabel: NSTextField!
- @IBOutlet weak var subTitleLabel: NSTextField!
- @IBOutlet weak var yesButton: NSButton!
-
- var currentTime: String = "7"
- var logOffTime: String = "7"
- private var viewModel = KMUserInfoVCModel()
-
- static let shared: KMCloseApplyWC = {
- let windowC = KMCloseApplyWC(windowNibName: "KMCloseApplyWC")
- return windowC
- }()
- override func windowDidLoad() {
- super.windowDidLoad()
-
-
- languageLocalized()
- initializeUI()
-
- NotificationCenter.default.addObserver(self, selector: #selector(changeEffectiveAppearance), name: NSNotification.Name(rawValue: "kEffectiveAppearance"), object: nil)
- }
-
- @objc func changeEffectiveAppearance() {
- self.initializeUI()
- }
-
-
-
- private func languageLocalized() -> Void {
- self.window?.title = NSLocalizedString("Remove Account", tableName: "MemberCenterLocalizable", comment: "")
- titleLabel.stringValue = NSLocalizedString("Account cancellation application has been submitted", tableName: "MemberCenterLocalizable", comment: "")
- subTitleLabel.stringValue = String(format: NSLocalizedString("Your account will be automatically deleted in %@ days. Welcome to use PDF Reader Pro again!\nYou can log in with this account and choose to Undo Remove Account within %ld days, and continue to use. The benefits and product services you enjoy will be retained.", tableName: "MemberCenterLocalizable", comment: ""), logOffTime, logOffTime)
-
- yesButton.title = NSLocalizedString("Got it", tableName: "MemberCenterLocalizable", comment: "")
- }
-
- private func initializeUI() -> Void {
- self.window?.contentView?.wantsLayer = true
- let isDarkModel = KMAdvertisementConfig.isDarkModel()
- if isDarkModel {
- self.window?.contentView?.layer?.backgroundColor = NSColor(hex: "0E1114").cgColor;
- } else {
- self.window?.contentView?.layer?.backgroundColor = NSColor(hex: "FFFFFF").cgColor;
- }
- titleLabel.textColor = NSColor(named: "000000_0.85")
- titleLabel.font = NSFont.SFProTextSemiboldFont(13)
- subTitleLabel.textColor = NSColor(named: "000000_0.85")
- subTitleLabel.font = NSFont.SFProTextRegularFont(12)
- yesButton.setTitleColor(color: NSColor(named: "FFFFFF") ?? NSColor.white, font: NSFont.SFProTextRegularFont(13))
- }
-
-
-
-
- @IBAction func yesButtonAction(_ sender: NSButton) {
- KMUserInfoVCModel().refreshUserInfo { success, msg,dic in
- self.window?.close()
- }
- }
- }
|