|
@@ -19,6 +19,8 @@ class KMLoginWindowsController: NSWindowController {
|
|
|
|
|
|
var memberInfo: KMMemberInfo = KMMemberInfo.shared
|
|
|
|
|
|
+ var signUpView: KMSignUpView?
|
|
|
+
|
|
|
var loginResult: LoginResultComplete!
|
|
|
|
|
|
static let shared: KMLoginWindowsController = {
|
|
@@ -37,6 +39,8 @@ class KMLoginWindowsController: NSWindowController {
|
|
|
initializeUI()
|
|
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccessNotification), name: NSNotification.Name(rawValue: "MemberCenterLoginSuccess"), object: nil)
|
|
|
+
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccessNotification), name: NSNotification.Name(rawValue: "MemberCenterLogoutSuccess"), object: nil)
|
|
|
}
|
|
|
|
|
|
|
|
@@ -48,9 +52,11 @@ class KMLoginWindowsController: NSWindowController {
|
|
|
} else {
|
|
|
leftImageView.image = NSImage(named: "WelcomePDFReaderPro1")
|
|
|
|
|
|
- let signUpView = KMSignUpView()
|
|
|
- signUpView.frame = rightBox.frame
|
|
|
- rightBox.contentView = signUpView
|
|
|
+ signUpView = KMSignUpView()
|
|
|
+ if(signUpView != nil) {
|
|
|
+ signUpView?.frame = rightBox.frame
|
|
|
+ rightBox.contentView = signUpView!
|
|
|
+ }
|
|
|
rightBox.fillColor = NSColor(named: "membercentercolor") ?? NSColor.white
|
|
|
}
|
|
|
}
|
|
@@ -64,6 +70,10 @@ class KMLoginWindowsController: NSWindowController {
|
|
|
window?.close()
|
|
|
}
|
|
|
|
|
|
+ @objc func logoutSuccessNotification() -> Void {
|
|
|
+ signUpView?.resetTextFileData()
|
|
|
+ }
|
|
|
+
|
|
|
func openWindow(_ complete: @escaping LoginResultComplete) -> Void {
|
|
|
KMLoginWindowsController.shared.showWindow(nil)
|
|
|
loginResult = complete
|