|
@@ -43,37 +43,12 @@ class KMLoginWindowController: NSWindowController {
|
|
|
|
|
|
//MARK: 打开文件
|
|
//MARK: 打开文件
|
|
static func show(window: NSWindow, _ type: DataNavigationViewButtonActionType = .Batch, _ logType: KMRegisterLogType = .login) -> KMLoginWindowController? {
|
|
static func show(window: NSWindow, _ type: DataNavigationViewButtonActionType = .Batch, _ logType: KMRegisterLogType = .login) -> KMLoginWindowController? {
|
|
- if KMLightMemberManager.manager.isLogOff() {
|
|
|
|
- let alert = NSAlert()
|
|
|
|
- alert.messageText = NSLocalizedString("Unable to log", comment: "")
|
|
|
|
- alert.informativeText = NSLocalizedString("Your account is currently being logged out and cannot be logged in.If you have questions, you can contact customer service", comment: "")
|
|
|
|
- alert.addButton(withTitle: NSLocalizedString("Contact Customer", comment: ""))
|
|
|
|
- alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
|
|
|
|
- alert.beginSheetModal(for: window) { result in
|
|
|
|
- if (result == .alertFirstButtonReturn) {
|
|
|
|
-// KMMailHelper.newEmail(withContacts: "support@pdfreaderpro.com", andSubjects: "")
|
|
|
|
-// NSWorkspace.shared.launchApplication("Mailto:support@pdfreaderpro.com")
|
|
|
|
-// NSWorkspace.shared.open(URL(string: "mailto:support@pdfreaderpro.com")!)
|
|
|
|
-
|
|
|
|
-// let service = NSSharingService(named: NSSharingService.Name.composeEmail)
|
|
|
|
-// service?.recipients = ["support@pdfreaderpro.com"]
|
|
|
|
-// service?.subject = "Test Mail"
|
|
|
|
-// service?.perform(withItems: ["Test Mail body"])
|
|
|
|
- } else if result == .alertSecondButtonReturn {
|
|
|
|
- return
|
|
|
|
- // NSApp.mainWindow!.endSheet(view.window!)
|
|
|
|
- // view.window?.close()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return nil
|
|
|
|
- } else {
|
|
|
|
- let controller: KMLoginWindowController = KMLoginWindowController.init(windowNibName: "KMLoginWindowController")
|
|
|
|
- controller.inputType = type
|
|
|
|
- controller.logType = logType
|
|
|
|
- window.beginSheet(controller.window!)
|
|
|
|
-
|
|
|
|
- return controller
|
|
|
|
- }
|
|
|
|
|
|
+ let controller: KMLoginWindowController = KMLoginWindowController.init(windowNibName: "KMLoginWindowController")
|
|
|
|
+ controller.inputType = type
|
|
|
|
+ controller.logType = logType
|
|
|
|
+ window.beginSheet(controller.window!)
|
|
|
|
+
|
|
|
|
+ return controller
|
|
}
|
|
}
|
|
|
|
|
|
override func mouseDown(with event: NSEvent) {
|
|
override func mouseDown(with event: NSEvent) {
|
|
@@ -190,6 +165,27 @@ class KMLoginWindowController: NSWindowController {
|
|
if success {
|
|
if success {
|
|
NSApp.mainWindow!.endSheet(self.window!)
|
|
NSApp.mainWindow!.endSheet(self.window!)
|
|
view.window!.close()
|
|
view.window!.close()
|
|
|
|
+ } else if result?.code == 318 {
|
|
|
|
+ let alert = NSAlert()
|
|
|
|
+ alert.messageText = NSLocalizedString("Unable to log", comment: "")
|
|
|
|
+ alert.informativeText = NSLocalizedString("Your account is currently being logged out and cannot be logged in.If you have questions, you can contact customer service", comment: "")
|
|
|
|
+ alert.addButton(withTitle: NSLocalizedString("Contact Customer", comment: ""))
|
|
|
|
+ alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
|
|
|
|
+ alert.beginSheetModal(for: NSApp.mainWindow!) { result in
|
|
|
|
+ if (result == .alertFirstButtonReturn) {
|
|
|
|
+ // KMMailHelper.newEmail(withContacts: "support@pdfreaderpro.com", andSubjects: "")
|
|
|
|
+ // NSWorkspace.shared.launchApplication("Mailto:support@pdfreaderpro.com")
|
|
|
|
+ NSWorkspace.shared.open(URL(string: "mailto:support@pdfreaderpro.com")!)
|
|
|
|
+
|
|
|
|
+ // let service = NSSharingService(named: NSSharingService.Name.composeEmail)
|
|
|
|
+ // service?.recipients = ["support@pdfreaderpro.com"]
|
|
|
|
+ // service?.subject = "Test Mail"
|
|
|
|
+ // service?.perform(withItems: ["Test Mail body"])
|
|
|
|
+ } else if result == .alertSecondButtonReturn {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return
|
|
} else {
|
|
} else {
|
|
self.loginInputPasswordView.showAlert(result: result)
|
|
self.loginInputPasswordView.showAlert(result: result)
|
|
}
|
|
}
|