|
@@ -22,7 +22,7 @@ typealias KMPasswordInputWindowItemClick = (Int, String) -> ()
|
|
private var passwordInputWindow: KMPasswordInputWindow?
|
|
private var passwordInputWindow: KMPasswordInputWindow?
|
|
private var passwordInputWindow_private: KMPasswordInputWindow?
|
|
private var passwordInputWindow_private: KMPasswordInputWindow?
|
|
|
|
|
|
-@objcMembers class KMPasswordInputWindow: NSWindow {
|
|
|
|
|
|
+@objcMembers class KMPasswordInputWindow: NSWindow, NibLoadable {
|
|
@IBOutlet weak var titleLabel: NSTextField!
|
|
@IBOutlet weak var titleLabel: NSTextField!
|
|
|
|
|
|
@IBOutlet weak var despLabel: NSTextField!
|
|
@IBOutlet weak var despLabel: NSTextField!
|
|
@@ -100,6 +100,23 @@ private var passwordInputWindow_private: KMPasswordInputWindow?
|
|
KMPrint("KMPasswordInputWindow 已释放了")
|
|
KMPrint("KMPasswordInputWindow 已释放了")
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ static var nibName: String? {
|
|
|
|
+ return "KMPasswordInputWindow"
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ static func createFromNib(in bundle: Bundle) -> Self? {
|
|
|
|
+ guard let nibName = self.nibName else {
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+ var topLevelArray: NSArray? = nil
|
|
|
|
+ bundle.loadNibNamed(NSNib.Name(nibName), owner: self, topLevelObjects: &topLevelArray)
|
|
|
|
+ guard let results = topLevelArray else {
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+ let views = Array<Any>(results).filter { $0 is Self }
|
|
|
|
+ return views.last as? Self
|
|
|
|
+ }
|
|
|
|
+
|
|
override init(contentRect: NSRect, styleMask style: NSWindow.StyleMask, backing backingStoreType: NSWindow.BackingStoreType, defer flag: Bool) {
|
|
override init(contentRect: NSRect, styleMask style: NSWindow.StyleMask, backing backingStoreType: NSWindow.BackingStoreType, defer flag: Bool) {
|
|
super.init(contentRect: contentRect, styleMask: style, backing: backingStoreType, defer: flag)
|
|
super.init(contentRect: contentRect, styleMask: style, backing: backingStoreType, defer: flag)
|
|
}
|
|
}
|
|
@@ -107,102 +124,90 @@ private var passwordInputWindow_private: KMPasswordInputWindow?
|
|
override func awakeFromNib() {
|
|
override func awakeFromNib() {
|
|
super.awakeFromNib()
|
|
super.awakeFromNib()
|
|
|
|
|
|
- if (titleLabel != nil) {
|
|
|
|
- passwordInputWindow_private = self
|
|
|
|
|
|
+ passwordInputWindow_private = self
|
|
|
|
|
|
- titleLabel.stringValue = NSLocalizedString("Permission Password", comment: "")
|
|
|
|
- self.titleLabel.textColor = KMAppearance.Layout.h0Color()
|
|
|
|
- titleLabel.font = NSFont.SFProTextRegularFont(16)
|
|
|
|
-// self.titleLabel.window?.appearance = NSAppearance(named: .aqua)
|
|
|
|
- }
|
|
|
|
|
|
+ self.titleLabel.stringValue = NSLocalizedString("Permission Password", comment: "")
|
|
|
|
+ self.titleLabel.textColor = KMAppearance.Layout.h0Color()
|
|
|
|
+ self.titleLabel.font = NSFont.SFProTextRegularFont(16)
|
|
|
|
|
|
- if despLabel != nil {
|
|
|
|
- despLabel.stringValue = NSLocalizedString("This PDF is password protected. Please enter the password below to access this PDF.", comment: "")
|
|
|
|
- self.despLabel.textColor = KMAppearance.Layout.h0Color()
|
|
|
|
- despLabel.font = NSFont.SFProTextRegularFont(14)
|
|
|
|
- despLabel.isSelectable = false
|
|
|
|
- let ps = NSMutableParagraphStyle()
|
|
|
|
- ps.lineSpacing = 5
|
|
|
|
- despLabel.maximumNumberOfLines = 2
|
|
|
|
- despLabel.lineBreakMode = .byTruncatingTail
|
|
|
|
|
|
+ self.despLabel.stringValue = NSLocalizedString("This PDF is password protected. Please enter the password below to access this PDF.", comment: "")
|
|
|
|
+ self.despLabel.textColor = KMAppearance.Layout.h0Color()
|
|
|
|
+ self.despLabel.font = NSFont.SFProTextRegularFont(14)
|
|
|
|
+ self.despLabel.isSelectable = false
|
|
|
|
+ let ps = NSMutableParagraphStyle()
|
|
|
|
+ ps.lineSpacing = 5
|
|
|
|
+ self.despLabel.maximumNumberOfLines = 2
|
|
|
|
+ self.despLabel.lineBreakMode = .byTruncatingTail
|
|
ps.lineBreakMode = .byTruncatingTail
|
|
ps.lineBreakMode = .byTruncatingTail
|
|
- despLabel.attributedStringValue = NSAttributedString(string: despLabel.stringValue, attributes: [.foregroundColor : KMAppearance.Layout.h0Color(), .font : NSFont.SFProTextRegularFont(14), .paragraphStyle : ps])
|
|
|
|
- }
|
|
|
|
|
|
+ self.despLabel.attributedStringValue = NSAttributedString(string: despLabel.stringValue, attributes: [.foregroundColor : KMAppearance.Layout.h0Color(), .font : NSFont.SFProTextRegularFont(14), .paragraphStyle : ps])
|
|
|
|
|
|
- if (iconImageView != nil) {
|
|
|
|
- self.iconImageView.image = NSImage(named: "KMImageNameSecureIcon")
|
|
|
|
- }
|
|
|
|
|
|
+ self.iconImageView.image = NSImage(named: "KMImageNameSecureIcon")
|
|
|
|
|
|
- if secureTextFiled != nil {
|
|
|
|
- secureTextFiled.backgroundView.wantsLayer = true
|
|
|
|
- secureTextFiled.backgroundView.layer?.borderWidth = 1
|
|
|
|
- secureTextFiled.backgroundView.layer?.borderColor = NSColor.buttonBorderColor().cgColor
|
|
|
|
- secureTextFiled.backgroundView.layer?.cornerRadius = 4
|
|
|
|
- secureTextFiled.placeholderString = NSLocalizedString("Password", comment: "")
|
|
|
|
|
|
+ self.secureTextFiled.backgroundView.wantsLayer = true
|
|
|
|
+ self.secureTextFiled.backgroundView.layer?.borderWidth = 1
|
|
|
|
+ self.secureTextFiled.backgroundView.layer?.borderColor = NSColor.buttonBorderColor().cgColor
|
|
|
|
+ self.secureTextFiled.backgroundView.layer?.cornerRadius = 4
|
|
|
|
+ self.secureTextFiled.placeholderString = NSLocalizedString("Password", comment: "")
|
|
|
|
|
|
- let rightView = NSView()
|
|
|
|
- rightView.frame = NSMakeRect(0, 0, 40, 32);
|
|
|
|
- secureTextFiled.rightView = rightView
|
|
|
|
- let clearButton = NSButton()
|
|
|
|
- rightView.addSubview(clearButton)
|
|
|
|
- clearButton.frame = NSMakeRect(10, 6, 20, 20)
|
|
|
|
- clearButton.wantsLayer = true
|
|
|
|
- clearButton.image = NSImage(named: "KMImageNameSecureClearIcon")
|
|
|
|
- clearButton.isBordered = false
|
|
|
|
- clearButton.target = self
|
|
|
|
- clearButton.action = #selector(clearButtonAction)
|
|
|
|
- rightView.isHidden = true
|
|
|
|
|
|
+ let rightView = NSView()
|
|
|
|
+ rightView.frame = NSMakeRect(0, 0, 40, 32);
|
|
|
|
+ self.secureTextFiled.rightView = rightView
|
|
|
|
+ let clearButton = NSButton()
|
|
|
|
+ rightView.addSubview(clearButton)
|
|
|
|
+ clearButton.frame = NSMakeRect(10, 6, 20, 20)
|
|
|
|
+ clearButton.wantsLayer = true
|
|
|
|
+ clearButton.image = NSImage(named: "KMImageNameSecureClearIcon")
|
|
|
|
+ clearButton.isBordered = false
|
|
|
|
+ clearButton.target = self
|
|
|
|
+ clearButton.action = #selector(clearButtonAction)
|
|
|
|
+ rightView.isHidden = true
|
|
|
|
|
|
- secureTextFiled.becomeFirstResponderHandler = { [unowned self] securetextFiled in
|
|
|
|
- let mySecureTextField: KMSecureTextFiled = securetextFiled as! KMSecureTextFiled
|
|
|
|
- mySecureTextField.backgroundView.wantsLayer = true
|
|
|
|
- mySecureTextField.backgroundView.layer?.borderColor = NSColor.km_init(hex: "#1770F4").cgColor
|
|
|
|
|
|
+ self.secureTextFiled.becomeFirstResponderHandler = { [unowned self] securetextFiled in
|
|
|
|
+ let mySecureTextField: KMSecureTextFiled = securetextFiled as! KMSecureTextFiled
|
|
|
|
+ mySecureTextField.backgroundView.wantsLayer = true
|
|
|
|
+ mySecureTextField.backgroundView.layer?.borderColor = NSColor.km_init(hex: "#1770F4").cgColor
|
|
|
|
|
|
- if mySecureTextField.password().isEmpty {
|
|
|
|
- self.secureTextFiled.rightView?.isHidden = true
|
|
|
|
- } else {
|
|
|
|
- self.secureTextFiled.rightView?.isHidden = false
|
|
|
|
- }
|
|
|
|
- if self.passwordErrorLabel != nil {
|
|
|
|
- self.passwordErrorLabel.isHidden = true
|
|
|
|
- }
|
|
|
|
|
|
+ if mySecureTextField.password().isEmpty {
|
|
|
|
+ self.secureTextFiled.rightView?.isHidden = true
|
|
|
|
+ } else {
|
|
|
|
+ self.secureTextFiled.rightView?.isHidden = false
|
|
}
|
|
}
|
|
- secureTextFiled.valueDidChange = { [unowned self] view, string in
|
|
|
|
- view.backgroundView.layer?.borderColor = NSColor.km_init(hex: "#1770F4").cgColor
|
|
|
|
- if self.passwordErrorLabel != nil {
|
|
|
|
- self.passwordErrorLabel.isHidden = true
|
|
|
|
- }
|
|
|
|
- if string.isEmpty {
|
|
|
|
- view.rightView?.isHidden = true
|
|
|
|
- self.dealConfirmButtonEnabledState(enabled: false)
|
|
|
|
- } else {
|
|
|
|
- view.rightView?.isHidden = false
|
|
|
|
- self.dealConfirmButtonEnabledState(enabled: true)
|
|
|
|
- }
|
|
|
|
|
|
+ if self.passwordErrorLabel != nil {
|
|
|
|
+ self.passwordErrorLabel.isHidden = true
|
|
}
|
|
}
|
|
-
|
|
|
|
- secureTextFiled.enterAction = { [unowned self] in
|
|
|
|
- self.confirmButtonAction()
|
|
|
|
|
|
+ }
|
|
|
|
+ self.secureTextFiled.valueDidChange = { [unowned self] view, string in
|
|
|
|
+ view.backgroundView.layer?.borderColor = NSColor.km_init(hex: "#1770F4").cgColor
|
|
|
|
+ if self.passwordErrorLabel != nil {
|
|
|
|
+ self.passwordErrorLabel.isHidden = true
|
|
|
|
+ }
|
|
|
|
+ if string.isEmpty {
|
|
|
|
+ view.rightView?.isHidden = true
|
|
|
|
+ self.dealConfirmButtonEnabledState(enabled: false)
|
|
|
|
+ } else {
|
|
|
|
+ view.rightView?.isHidden = false
|
|
|
|
+ self.dealConfirmButtonEnabledState(enabled: true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- if passwordErrorLabel != nil {
|
|
|
|
- passwordErrorLabel.stringValue = NSLocalizedString("Incorrect password. Please try again.", comment: "")
|
|
|
|
- passwordErrorLabel.font = NSFont.systemFont(ofSize: 12)
|
|
|
|
- passwordErrorLabel.wantsLayer = true
|
|
|
|
- passwordErrorLabel.textColor = NSColor.km_init(hex: "#F3465B")
|
|
|
|
- passwordErrorLabel.isHidden = true
|
|
|
|
|
|
+
|
|
|
|
+ self.secureTextFiled.enterAction = { [unowned self] in
|
|
|
|
+ self.confirmButtonAction()
|
|
}
|
|
}
|
|
|
|
|
|
- if cancelButton != nil {
|
|
|
|
- for button in [cancelButton, confirmButton] {
|
|
|
|
|
|
+ self.passwordErrorLabel.stringValue = NSLocalizedString("Incorrect password. Please try again.", comment: "")
|
|
|
|
+ self.passwordErrorLabel.font = NSFont.systemFont(ofSize: 12)
|
|
|
|
+ self.passwordErrorLabel.wantsLayer = true
|
|
|
|
+ self.passwordErrorLabel.textColor = NSColor.km_init(hex: "#F3465B")
|
|
|
|
+ self.passwordErrorLabel.isHidden = true
|
|
|
|
+
|
|
|
|
+ for button in [cancelButton, confirmButton] {
|
|
// button?.wantsLayer = true
|
|
// button?.wantsLayer = true
|
|
// button?.layer?.cornerRadius = 4
|
|
// button?.layer?.cornerRadius = 4
|
|
// button?.bezelStyle = .roundRect
|
|
// button?.bezelStyle = .roundRect
|
|
// button?.setButtonType(.momentaryPushIn)
|
|
// button?.setButtonType(.momentaryPushIn)
|
|
|
|
|
|
- button!.target = self
|
|
|
|
- if ((button?.isEqual(to: cancelButton))!) {
|
|
|
|
|
|
+ button!.target = self
|
|
|
|
+ if ((button?.isEqual(to: cancelButton))!) {
|
|
// button?.layer?.borderWidth = 1
|
|
// button?.layer?.borderWidth = 1
|
|
// button?.layer?.borderColor = NSColor.buttonBorderColor().cgColor
|
|
// button?.layer?.borderColor = NSColor.buttonBorderColor().cgColor
|
|
// button?.title = NSLocalizedString("Cancel", comment: "")
|
|
// button?.title = NSLocalizedString("Cancel", comment: "")
|
|
@@ -210,68 +215,74 @@ private var passwordInputWindow_private: KMPasswordInputWindow?
|
|
// button?.setTitleColor(NSColor.buttonTitleColor())
|
|
// button?.setTitleColor(NSColor.buttonTitleColor())
|
|
// button?.font = NSFont.SFProTextRegularFont(14)
|
|
// button?.font = NSFont.SFProTextRegularFont(14)
|
|
// button?.action = #selector(cancelButtonAction)
|
|
// button?.action = #selector(cancelButtonAction)
|
|
- } else {
|
|
|
|
|
|
+ } else {
|
|
// button?.title = NSLocalizedString("Open", comment: "")
|
|
// button?.title = NSLocalizedString("Open", comment: "")
|
|
// button?.attributedTitle = NSMutableAttributedString(string: button!.title, attributes: [.foregroundColor : NSColor.white])
|
|
// button?.attributedTitle = NSMutableAttributedString(string: button!.title, attributes: [.foregroundColor : NSColor.white])
|
|
// button?.font = NSFont.SFProTextRegularFont(14)
|
|
// button?.font = NSFont.SFProTextRegularFont(14)
|
|
// button?.action = #selector(confirmButtonAction)
|
|
// button?.action = #selector(confirmButtonAction)
|
|
// button?.title = ""
|
|
// button?.title = ""
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
- let cancelButtonVC = KMDesignButton(withType: .Text)
|
|
|
|
|
|
+ let cancelButtonVC = KMDesignButton(withType: .Text)
|
|
// self.cancelButton.addSubview(cancelButtonVC.view)
|
|
// self.cancelButton.addSubview(cancelButtonVC.view)
|
|
- cancelButtonVC.view.frame = self.cancelButton.bounds
|
|
|
|
- cancelButtonVC.view.autoresizingMask = [.width, .height]
|
|
|
|
- cancelButtonVC.stringValue = NSLocalizedString("Cancel", comment: "")
|
|
|
|
- cancelButtonVC.button(type: .Sec_Icon, size: .m)
|
|
|
|
- cancelButtonVC.target = self
|
|
|
|
- cancelButtonVC.action = #selector(cancelButtonAction)
|
|
|
|
- cancelButtonVC.button.keyEquivalent = KMKeyEquivalent.esc.string()
|
|
|
|
- self.cancelButton.title = NSLocalizedString("Cancel", comment: "")
|
|
|
|
- self.cancelButton.action = #selector(cancelButtonAction)
|
|
|
|
|
|
+ cancelButtonVC.view.frame = self.cancelButton.bounds
|
|
|
|
+ cancelButtonVC.view.autoresizingMask = [.width, .height]
|
|
|
|
+ cancelButtonVC.stringValue = NSLocalizedString("Cancel", comment: "")
|
|
|
|
+ cancelButtonVC.button(type: .Sec_Icon, size: .m)
|
|
|
|
+ cancelButtonVC.target = self
|
|
|
|
+ cancelButtonVC.action = #selector(cancelButtonAction)
|
|
|
|
+ cancelButtonVC.button.keyEquivalent = KMKeyEquivalent.esc.string()
|
|
|
|
+ self.cancelButton.title = NSLocalizedString("Cancel", comment: "")
|
|
|
|
+ self.cancelButton.action = #selector(cancelButtonAction)
|
|
|
|
|
|
- let confirmButtonVC = KMDesignButton(withType: .Text)
|
|
|
|
|
|
+ let confirmButtonVC = KMDesignButton(withType: .Text)
|
|
// self.confirmButton.addSubview(confirmButtonVC.view)
|
|
// self.confirmButton.addSubview(confirmButtonVC.view)
|
|
- confirmButtonVC.view.frame = self.confirmButton.bounds
|
|
|
|
- confirmButtonVC.view.autoresizingMask = [.width, .height]
|
|
|
|
- confirmButtonVC.stringValue = NSLocalizedString("Open", comment: "")
|
|
|
|
- confirmButtonVC.button(type: .Cta, size: .m)
|
|
|
|
- confirmButtonVC.target = self
|
|
|
|
- confirmButtonVC.action = #selector(confirmButtonAction)
|
|
|
|
- self.confirmButtonVC = confirmButtonVC
|
|
|
|
- self.confirmButtonVC?.button.keyEquivalent = KMKeyEquivalent.enter
|
|
|
|
- self.confirmButton.title = NSLocalizedString("Open", comment: "")
|
|
|
|
- self.confirmButton.action = #selector(confirmButtonAction)
|
|
|
|
-
|
|
|
|
- dealConfirmButtonEnabledState(enabled: false)
|
|
|
|
- }
|
|
|
|
|
|
+ confirmButtonVC.view.frame = self.confirmButton.bounds
|
|
|
|
+ confirmButtonVC.view.autoresizingMask = [.width, .height]
|
|
|
|
+ confirmButtonVC.stringValue = NSLocalizedString("Open", comment: "")
|
|
|
|
+ confirmButtonVC.button(type: .Cta, size: .m)
|
|
|
|
+ confirmButtonVC.target = self
|
|
|
|
+ confirmButtonVC.action = #selector(confirmButtonAction)
|
|
|
|
+ self.confirmButtonVC = confirmButtonVC
|
|
|
|
+ self.confirmButtonVC?.button.keyEquivalent = KMKeyEquivalent.enter
|
|
|
|
+ self.confirmButton.title = NSLocalizedString("Open", comment: "")
|
|
|
|
+ self.confirmButton.action = #selector(confirmButtonAction)
|
|
|
|
+
|
|
|
|
+ self.dealConfirmButtonEnabledState(enabled: false)
|
|
}
|
|
}
|
|
|
|
|
|
- func window() -> Self? {
|
|
|
|
|
|
+ class func createWindow() -> Self? {
|
|
KMPasswordInputWindow.canEncrpty = false
|
|
KMPasswordInputWindow.canEncrpty = false
|
|
KMPasswordInputWindow.permissionsStatus = .none
|
|
KMPasswordInputWindow.permissionsStatus = .none
|
|
|
|
|
|
- var topLevelArray: NSArray? = nil
|
|
|
|
- Bundle.main.loadNibNamed(NSNib.Name("KMPasswordInputWindow"), owner: self, topLevelObjects: &topLevelArray)
|
|
|
|
- guard let results = topLevelArray else {
|
|
|
|
- return nil
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- var passwordInputWindow: KMPasswordInputWindow!
|
|
|
|
- for object in results {
|
|
|
|
- let window: NSObject = object as! NSObject
|
|
|
|
- if window.isKind(of: KMPasswordInputWindow.self) {
|
|
|
|
- passwordInputWindow = window as! KMPasswordInputWindow?
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- guard let myWindow = passwordInputWindow else {
|
|
|
|
- return nil
|
|
|
|
- }
|
|
|
|
- return myWindow as? Self
|
|
|
|
|
|
+ return self.createFromNib(in: MainBundle)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// func window() -> Self? {
|
|
|
|
+// KMPasswordInputWindow.canEncrpty = false
|
|
|
|
+// KMPasswordInputWindow.permissionsStatus = .none
|
|
|
|
+//
|
|
|
|
+// var topLevelArray: NSArray? = nil
|
|
|
|
+// Bundle.main.loadNibNamed(NSNib.Name("KMPasswordInputWindow"), owner: self, topLevelObjects: &topLevelArray)
|
|
|
|
+// guard let results = topLevelArray else {
|
|
|
|
+// return nil
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// var passwordInputWindow: KMPasswordInputWindow!
|
|
|
|
+// for object in results {
|
|
|
|
+// let window: NSObject = object as! NSObject
|
|
|
|
+// if window.isKind(of: KMPasswordInputWindow.self) {
|
|
|
|
+// passwordInputWindow = window as! KMPasswordInputWindow?
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// guard let myWindow = passwordInputWindow else {
|
|
|
|
+// return nil
|
|
|
|
+// }
|
|
|
|
+// return myWindow as? Self
|
|
|
|
+// }
|
|
|
|
+
|
|
@objc func cancelButtonAction() {
|
|
@objc func cancelButtonAction() {
|
|
guard let callback = KMPasswordInputWindow.myItemClick else {
|
|
guard let callback = KMPasswordInputWindow.myItemClick else {
|
|
return
|
|
return
|
|
@@ -465,7 +476,7 @@ extension KMPasswordInputWindow {
|
|
}
|
|
}
|
|
|
|
|
|
@objc class func openWindow(window: NSWindow, type: KMPasswordInputWindowType = .open, url: URL, callback: @escaping (KMPasswordInputWindowResult, String?)->Void) -> KMPasswordInputWindow {
|
|
@objc class func openWindow(window: NSWindow, type: KMPasswordInputWindowType = .open, url: URL, callback: @escaping (KMPasswordInputWindowResult, String?)->Void) -> KMPasswordInputWindow {
|
|
- let passwordWindow = KMPasswordInputWindow().window()
|
|
|
|
|
|
+ let passwordWindow = KMPasswordInputWindow.createWindow()
|
|
passwordWindow?.documentURL = url
|
|
passwordWindow?.documentURL = url
|
|
passwordWindow?.type = type
|
|
passwordWindow?.type = type
|
|
|
|
|
|
@@ -490,7 +501,7 @@ extension KMPasswordInputWindow {
|
|
}
|
|
}
|
|
|
|
|
|
@objc class func success_openWindow(window: NSWindow, type: KMPasswordInputWindowType = .open, url: URL, callback: @escaping (String)->Void) {
|
|
@objc class func success_openWindow(window: NSWindow, type: KMPasswordInputWindowType = .open, url: URL, callback: @escaping (String)->Void) {
|
|
- let passwordWindow = KMPasswordInputWindow().window()
|
|
|
|
|
|
+ let passwordWindow = KMPasswordInputWindow.createWindow()
|
|
passwordWindow?.documentURL = url
|
|
passwordWindow?.documentURL = url
|
|
passwordWindow?.type = type
|
|
passwordWindow?.type = type
|
|
|
|
|
|
@@ -513,7 +524,7 @@ extension KMPasswordInputWindow {
|
|
}
|
|
}
|
|
|
|
|
|
@objc class func openWindow(window: NSWindow, url: URL, needOwner: Bool, callback: @escaping (KMPasswordInputWindowResult, String?)->Void) {
|
|
@objc class func openWindow(window: NSWindow, url: URL, needOwner: Bool, callback: @escaping (KMPasswordInputWindowResult, String?)->Void) {
|
|
- let passwordWindow = KMPasswordInputWindow().window()
|
|
|
|
|
|
+ let passwordWindow = KMPasswordInputWindow.createWindow()
|
|
passwordWindow?.documentURL = url
|
|
passwordWindow?.documentURL = url
|
|
|
|
|
|
let document = CPDFDocument(url: url)
|
|
let document = CPDFDocument(url: url)
|