|
@@ -85,24 +85,20 @@ class KMGuideInfoWindowController: NSWindowController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ static var currentWindowController: KMGuideInfoWindowController!
|
|
|
|
+
|
|
@objc static func currentWC() -> KMGuideInfoWindowController {
|
|
@objc static func currentWC() -> KMGuideInfoWindowController {
|
|
- if let controller: KMGuideInfoWindowController = KMGuideInfoWindowController.fetchSampleController() {
|
|
|
|
- return controller
|
|
|
|
|
|
+ if currentWindowController != nil {
|
|
|
|
+ return currentWindowController
|
|
} else {
|
|
} else {
|
|
let guideInfoWC: KMGuideInfoWindowController = KMGuideInfoWindowController.init(windowNibName: "KMGuideInfoWindowController")
|
|
let guideInfoWC: KMGuideInfoWindowController = KMGuideInfoWindowController.init(windowNibName: "KMGuideInfoWindowController")
|
|
|
|
+ currentWindowController = guideInfoWC;
|
|
return guideInfoWC
|
|
return guideInfoWC
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- static func fetchSampleController() -> KMGuideInfoWindowController? {
|
|
|
|
- for window in NSApp.windows {
|
|
|
|
- let controller = window.windowController
|
|
|
|
- if controller is KMGuideInfoWindowController {
|
|
|
|
- return controller as? KMGuideInfoWindowController
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return nil
|
|
|
|
|
|
+ deinit {
|
|
|
|
+ print("deinit Action")
|
|
}
|
|
}
|
|
|
|
|
|
//MARK: SystemMethod
|
|
//MARK: SystemMethod
|
|
@@ -199,7 +195,8 @@ class KMGuideInfoWindowController: NSWindowController {
|
|
}
|
|
}
|
|
self.openFileGuidePanel.frame = self.coverView.bounds
|
|
self.openFileGuidePanel.frame = self.coverView.bounds
|
|
self.openFileGuidePanel.autoresizingMask = [.width, .height]
|
|
self.openFileGuidePanel.autoresizingMask = [.width, .height]
|
|
- self.openFileGuidePanel.clickHandle = {[unowned self] view, actionType in
|
|
|
|
|
|
+ self.openFileGuidePanel.clickHandle = {[weak self] view, actionType in
|
|
|
|
+ guard let self = self else { return }
|
|
if actionType == .skip {
|
|
if actionType == .skip {
|
|
//Skip->数字签名
|
|
//Skip->数字签名
|
|
//Skip->
|
|
//Skip->
|
|
@@ -244,7 +241,8 @@ class KMGuideInfoWindowController: NSWindowController {
|
|
}
|
|
}
|
|
self.openFileGuideProperty.frame = self.coverView.bounds
|
|
self.openFileGuideProperty.frame = self.coverView.bounds
|
|
self.openFileGuideProperty.autoresizingMask = [.width, .height]
|
|
self.openFileGuideProperty.autoresizingMask = [.width, .height]
|
|
- self.openFileGuideProperty.clickHandle = {[unowned self] view, actionType in
|
|
|
|
|
|
+ self.openFileGuideProperty.clickHandle = {[weak self] view, actionType in
|
|
|
|
+ guard let self = self else { return }
|
|
if actionType == .skip {
|
|
if actionType == .skip {
|
|
//Skip->数字签名
|
|
//Skip->数字签名
|
|
//Skip->
|
|
//Skip->
|
|
@@ -297,7 +295,8 @@ class KMGuideInfoWindowController: NSWindowController {
|
|
}
|
|
}
|
|
self.openFileGuideToolbar.frame = self.coverView.bounds
|
|
self.openFileGuideToolbar.frame = self.coverView.bounds
|
|
self.openFileGuideToolbar.autoresizingMask = [.width, .height]
|
|
self.openFileGuideToolbar.autoresizingMask = [.width, .height]
|
|
- self.openFileGuideToolbar.clickHandle = {[unowned self] view, actionType in
|
|
|
|
|
|
+ self.openFileGuideToolbar.clickHandle = {[weak self] view, actionType in
|
|
|
|
+ guard let self = self else { return }
|
|
if actionType == .skip {
|
|
if actionType == .skip {
|
|
//Skip->数字签名
|
|
//Skip->数字签名
|
|
//Skip->
|
|
//Skip->
|
|
@@ -360,7 +359,8 @@ class KMGuideInfoWindowController: NSWindowController {
|
|
self.openFileFunctionView.frame = self.coverView.bounds
|
|
self.openFileFunctionView.frame = self.coverView.bounds
|
|
self.openFileFunctionView.autoresizingMask = [.width, .height]
|
|
self.openFileFunctionView.autoresizingMask = [.width, .height]
|
|
self.openFileFunctionView.type = self.type
|
|
self.openFileFunctionView.type = self.type
|
|
- self.openFileFunctionView.clickHandle = {[unowned self] view, actionType in
|
|
|
|
|
|
+ self.openFileFunctionView.clickHandle = {[weak self] view, actionType in
|
|
|
|
+ guard let self = self else { return }
|
|
if self.type == .digitalSignGuide {
|
|
if self.type == .digitalSignGuide {
|
|
guard let callBack = self.finishHandle else {
|
|
guard let callBack = self.finishHandle else {
|
|
return
|
|
return
|
|
@@ -383,7 +383,8 @@ class KMGuideInfoWindowController: NSWindowController {
|
|
}
|
|
}
|
|
self.convertGuideView.frame = self.coverView.bounds
|
|
self.convertGuideView.frame = self.coverView.bounds
|
|
self.convertGuideView.autoresizingMask = [.width, .height]
|
|
self.convertGuideView.autoresizingMask = [.width, .height]
|
|
- self.convertGuideView.clickHandle = {[unowned self] view, actionType in
|
|
|
|
|
|
+ self.convertGuideView.clickHandle = {[weak self] view, actionType in
|
|
|
|
+ guard let self = self else { return }
|
|
if actionType == .skip {
|
|
if actionType == .skip {
|
|
self.closeAction()
|
|
self.closeAction()
|
|
} else if actionType == .purchase {
|
|
} else if actionType == .purchase {
|
|
@@ -419,7 +420,8 @@ class KMGuideInfoWindowController: NSWindowController {
|
|
}
|
|
}
|
|
self.aiIconGuideView.frame = self.coverView.bounds
|
|
self.aiIconGuideView.frame = self.coverView.bounds
|
|
self.aiIconGuideView.autoresizingMask = [.width, .height]
|
|
self.aiIconGuideView.autoresizingMask = [.width, .height]
|
|
- self.aiIconGuideView.clickHandle = {[unowned self] view, actionType in
|
|
|
|
|
|
+ self.aiIconGuideView.clickHandle = {[weak self] view, actionType in
|
|
|
|
+ guard let self = self else { return }
|
|
if actionType == .getIt {
|
|
if actionType == .getIt {
|
|
self.closeAction()
|
|
self.closeAction()
|
|
}
|
|
}
|