ソースを参照

【综合】试用界面&引导模块内存释放优化

niehaoyu 10 ヶ月 前
コミット
0163f0071b

+ 1 - 1
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIHeaderView/AIHeaderView.swift

@@ -76,7 +76,7 @@ class AIHeaderView: NSView, NibLoadable {
             
             
         }
         }
         
         
-        controller.guideHandle = {vc in
+        controller.guideHandle = {[unowned self] vc in
             if self.guideWindowVC == nil {
             if self.guideWindowVC == nil {
                 let guideWindowVC = KMFunctionGuideWindowController.init(windowNibName: "KMFunctionGuideWindowController")
                 let guideWindowVC = KMFunctionGuideWindowController.init(windowNibName: "KMFunctionGuideWindowController")
                 self.guideWindowVC = guideWindowVC
                 self.guideWindowVC = guideWindowVC

+ 1 - 1
PDF Office/PDF Master/Class/ChromiumTabs/Screen/KMScreenShotMaskViewController.swift

@@ -42,7 +42,7 @@ class KMScreenShotMaskViewController: NSViewController{
     func handlerCallBack() {
     func handlerCallBack() {
         self.screenShotMaskView.callBack = self.callBack
         self.screenShotMaskView.callBack = self.callBack
         
         
-        self.screenShotMaskView.frameCallBack = { rect in
+        self.screenShotMaskView.frameCallBack = {[unowned self] rect in
             if self.editViewController.view.isHidden {
             if self.editViewController.view.isHidden {
                 self.editViewController.view.isHidden = false
                 self.editViewController.view.isHidden = false
             }
             }

+ 1 - 1
PDF Office/PDF Master/Class/DigtalSignature/CPDFDigtalView/KMPDFDigitalSignViewController.swift

@@ -277,7 +277,7 @@ class KMPDFDigitalSignViewController: NSViewController, CPDFViewDelegate, CPDFDi
         configWindowVC.viewType = .fileList;
         configWindowVC.viewType = .fileList;
         configWindowVC.appearanceWidget = widget;
         configWindowVC.appearanceWidget = widget;
         configWindowVC.isCreatDS = false
         configWindowVC.isCreatDS = false
-        configWindowVC.complentionHandle = {isSign, dic, config, isLock in
+        configWindowVC.complentionHandle = {[unowned self] isSign, dic, config, isLock in
             widget.page.removeAnnotation(widget)
             widget.page.removeAnnotation(widget)
             if isSign {
             if isSign {
                 if (dic.object(forKey: SAVEFILEPATH_KEY) != nil) {
                 if (dic.object(forKey: SAVEFILEPATH_KEY) != nil) {

+ 1 - 1
PDF Office/PDF Master/Class/GuideInfo/Controllers/KMFunctionGuideMultiController.swift

@@ -119,7 +119,7 @@ class KMFunctionGuideMultiController: NSViewController {
             let nameItem: KMFunctionGuideNameItemView = KMFunctionGuideNameItemView.createFromNib()!
             let nameItem: KMFunctionGuideNameItemView = KMFunctionGuideNameItemView.createFromNib()!
             nameItem.frame = CGRectMake(0, viewHeight - offsetY - itemHeight, CGRectGetWidth(self.typeNameView.frame), itemHeight)
             nameItem.frame = CGRectMake(0, viewHeight - offsetY - itemHeight, CGRectGetWidth(self.typeNameView.frame), itemHeight)
             nameItem.infoDict = dict as! NSDictionary
             nameItem.infoDict = dict as! NSDictionary
-            nameItem.clickHandle = { view in
+            nameItem.clickHandle = {[unowned self] view in
                 self.currentNameKEY = view.infoDict["key"] as! String
                 self.currentNameKEY = view.infoDict["key"] as! String
                 self.reloadNameViewInfo()
                 self.reloadNameViewInfo()
                 self.reloadDescriptionInfo()
                 self.reloadDescriptionInfo()

+ 1 - 1
PDF Office/PDF Master/Class/GuideInfo/KMFunctionGuideWindowController.swift

@@ -91,7 +91,7 @@ class KMFunctionGuideWindowController: NSWindowController {
                 self.singleController = KMFunctionGuideSingleController.init()
                 self.singleController = KMFunctionGuideSingleController.init()
             } else if _type == .functionMulti {
             } else if _type == .functionMulti {
                 self.multiController = KMFunctionGuideMultiController.init()
                 self.multiController = KMFunctionGuideMultiController.init()
-                self.multiController.clickHandle = { controller in
+                self.multiController.clickHandle = {[unowned self] controller in
 #if VERSION_DMG
 #if VERSION_DMG
                     var url = URL(string:kAIStoreServerLink)!
                     var url = URL(string:kAIStoreServerLink)!
                     NSWorkspace.shared.open(url)
                     NSWorkspace.shared.open(url)

+ 7 - 7
PDF Office/PDF Master/Class/GuideInfo/KMGuideInfoWindowController.swift

@@ -199,7 +199,7 @@ 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 = { view, actionType in
+                self.openFileGuidePanel.clickHandle = {[unowned self] view, actionType in
                     if actionType == .skip {
                     if actionType == .skip {
                         //Skip->数字签名
                         //Skip->数字签名
                         //Skip->
                         //Skip->
@@ -244,7 +244,7 @@ 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 = { view, actionType in
+                self.openFileGuideProperty.clickHandle = {[unowned self] view, actionType in
                     if actionType == .skip {
                     if actionType == .skip {
                         //Skip->数字签名
                         //Skip->数字签名
                         //Skip->
                         //Skip->
@@ -297,7 +297,7 @@ 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 = { view, actionType in
+                self.openFileGuideToolbar.clickHandle = {[unowned self] view, actionType in
                     if actionType == .skip {
                     if actionType == .skip {
                         //Skip->数字签名
                         //Skip->数字签名
                         //Skip->
                         //Skip->
@@ -360,7 +360,7 @@ 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 = { view, actionType in
+                self.openFileFunctionView.clickHandle = {[unowned self] view, actionType in
                     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,7 @@ 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 = { view, actionType in
+                self.convertGuideView.clickHandle = {[unowned self] view, actionType in
                     if actionType == .skip {
                     if actionType == .skip {
                         self.closeAction()
                         self.closeAction()
                     } else if actionType == .purchase {
                     } else if actionType == .purchase {
@@ -404,7 +404,7 @@ class KMGuideInfoWindowController: NSWindowController {
                 }
                 }
                 self.customColorGuideView.frame = self.coverView.bounds
                 self.customColorGuideView.frame = self.coverView.bounds
                 self.customColorGuideView.autoresizingMask = [.width, .height]
                 self.customColorGuideView.autoresizingMask = [.width, .height]
-                self.customColorGuideView.clickHandle = { view, actionType in
+                self.customColorGuideView.clickHandle = {[unowned self] view, actionType in
                     if actionType == .getIt {
                     if actionType == .getIt {
                         self.closeAction()
                         self.closeAction()
                     }
                     }
@@ -419,7 +419,7 @@ 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 = { view, actionType in
+                self.aiIconGuideView.clickHandle = {[unowned self] view, actionType in
                     if actionType == .getIt {
                     if actionType == .getIt {
                         self.closeAction()
                         self.closeAction()
                     }
                     }

+ 1 - 1
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift

@@ -887,7 +887,7 @@ extension KMHomeViewController {
     
     
     func showAITypeChooseView() -> Void {
     func showAITypeChooseView() -> Void {
         let windowVC: AINewConfigWindowController = AINewConfigWindowController.currentWC()
         let windowVC: AINewConfigWindowController = AINewConfigWindowController.currentWC()
-        windowVC.chooseCurFileHandle = {windowVC in
+        windowVC.chooseCurFileHandle = {[unowned self] windowVC in
             if AIChatInfoManager.defaultManager.currentFilePath.isEmpty == false {
             if AIChatInfoManager.defaultManager.currentFilePath.isEmpty == false {
                 let documentArray = NSDocumentController.shared.documents
                 let documentArray = NSDocumentController.shared.documents
                 var didFileEdit: Bool = false
                 var didFileEdit: Bool = false

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/Compare/ViewController/ContentComplete/KMCompareContentWindowController.swift

@@ -38,11 +38,11 @@ class KMCompareContentWindowController: NSWindowController {
         contentView.oldDocument = pdfOldDocumnet
         contentView.oldDocument = pdfOldDocumnet
         contentView.document = pdfDocument
         contentView.document = pdfDocument
         contentView.compareResults = results
         contentView.compareResults = results
-        contentView.closeHandle = { view in
+        contentView.closeHandle = {[unowned self] view in
             self.closeHandle?(self)
             self.closeHandle?(self)
         }
         }
         
         
-        contentView.saveHandle = { view in
+        contentView.saveHandle = {[unowned self] view in
             self.saveHandle?(self)
             self.saveHandle?(self)
         }
         }
     }
     }

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -693,7 +693,7 @@ import Cocoa
             self.aiTipView.clickHandle = { [weak self] view in
             self.aiTipView.clickHandle = { [weak self] view in
 //                self?.showAITypeChooseView()
 //                self?.showAITypeChooseView()
             }
             }
-            self.aiTipView.rightClickHandle = { view in
+            self.aiTipView.rightClickHandle = {[unowned self] view in
                 AIInfoManager.default().showAIIcon = false
                 AIInfoManager.default().showAIIcon = false
                 NotificationCenter.default.post(name: NSNotification.Name(rawValue: "kAIIconShowStateChangeNotification"), object: nil)
                 NotificationCenter.default.post(name: NSNotification.Name(rawValue: "kAIIconShowStateChangeNotification"), object: nil)
             }
             }
@@ -732,7 +732,7 @@ import Cocoa
         }
         }
         
         
         let windowVC: AINewConfigWindowController = AINewConfigWindowController.currentWC()
         let windowVC: AINewConfigWindowController = AINewConfigWindowController.currentWC()
-        windowVC.chooseCurFileHandle = {windowVC in
+        windowVC.chooseCurFileHandle = {[unowned self] windowVC in
             if AIChatInfoManager.defaultManager.currentFilePath.isEmpty == false {
             if AIChatInfoManager.defaultManager.currentFilePath.isEmpty == false {
                 let documentArray = NSDocumentController.shared.documents
                 let documentArray = NSDocumentController.shared.documents
                 var didFileEdit: Bool = false
                 var didFileEdit: Bool = false

+ 24 - 24
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseFirstTrialWindowController.swift

@@ -7,7 +7,7 @@
 
 
 import Cocoa
 import Cocoa
 
 
-@objc class KMPurchaseFirstTrialWindowController: NSWindowController,NSTextFieldDelegate,NSTextViewDelegate {
+@objc class KMPurchaseFirstTrialWindowController: NSWindowController,NSTextFieldDelegate,NSTextViewDelegate, NSWindowDelegate {
     @IBOutlet weak var contentImageView: NSImageView!
     @IBOutlet weak var contentImageView: NSImageView!
     @IBOutlet weak var titleField: NSTextField!
     @IBOutlet weak var titleField: NSTextField!
     @IBOutlet weak var rView: NSView!
     @IBOutlet weak var rView: NSView!
@@ -49,27 +49,19 @@ import Cocoa
     @IBOutlet weak var enterLicenseBox: NSBox!
     @IBOutlet weak var enterLicenseBox: NSBox!
     @IBOutlet weak var enterLicenseBtn: HyperLinkButton!
     @IBOutlet weak var enterLicenseBtn: HyperLinkButton!
     
     
+    static var currentWindowController: KMPurchaseFirstTrialWindowController!
+    
     @objc var buttonActionBlock: ((_ firstTrialWinVC: KMPurchaseFirstTrialWindowController, _ btn: KMButton, _ email : String, _ name : String)->Void)?
     @objc var buttonActionBlock: ((_ firstTrialWinVC: KMPurchaseFirstTrialWindowController, _ btn: KMButton, _ email : String, _ name : String)->Void)?
     
     
     //MARK: 打开文件
     //MARK: 打开文件
    @objc static func currentFirstTrialWC() -> KMPurchaseFirstTrialWindowController {
    @objc static func currentFirstTrialWC() -> KMPurchaseFirstTrialWindowController {
-        if let controller: KMPurchaseFirstTrialWindowController = KMPurchaseFirstTrialWindowController.fetchSampleController() {
-            return controller
-        } else {
-            let purchaseLimitWC: KMPurchaseFirstTrialWindowController = KMPurchaseFirstTrialWindowController.init(windowNibName: "KMPurchaseFirstTrialWindowController")
-            return purchaseLimitWC
-        }
-    }
-    
-    static func fetchSampleController() -> KMPurchaseFirstTrialWindowController? {
-        for window in NSApp.windows {
-            let controller = window.windowController
-            if controller is KMPurchaseFirstTrialWindowController {
-                return controller as? KMPurchaseFirstTrialWindowController
-            }
-        }
-        
-        return nil
+       if currentWindowController != nil {
+           return currentWindowController
+       } else {
+           let configWC: KMPurchaseFirstTrialWindowController = KMPurchaseFirstTrialWindowController.init(windowNibName: "KMPurchaseFirstTrialWindowController")
+           currentWindowController = configWC;
+           return currentWindowController
+       }
     }
     }
     
     
     deinit {
     deinit {
@@ -79,8 +71,12 @@ import Cocoa
     
     
     override func windowDidLoad() {
     override func windowDidLoad() {
         super.windowDidLoad()
         super.windowDidLoad()
+        
         DistributedNotificationCenter.default.addObserver(self, selector: #selector(themeChanged(_:)), name: NSNotification.Name(rawValue:"AppleInterfaceThemeChangedNotification"), object: nil)
         DistributedNotificationCenter.default.addObserver(self, selector: #selector(themeChanged(_:)), name: NSNotification.Name(rawValue:"AppleInterfaceThemeChangedNotification"), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(windowDidBecomeVisible(_:)), name: NSWindow.didBecomeKeyNotification, object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(windowDidBecomeVisible(_:)), name: NSWindow.didBecomeKeyNotification, object: nil)
+        
+        self.window?.delegate = self
+        
         self.activateTrialNowBtn.tag = 10001
         self.activateTrialNowBtn.tag = 10001
         self.buyNowBtn.tag = 10002
         self.buyNowBtn.tag = 10002
         self.enterLicenseBtn.tag = 10003
         self.enterLicenseBtn.tag = 10003
@@ -234,7 +230,7 @@ import Cocoa
             self.btnBox.layer?.backgroundColor = NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1).cgColor
             self.btnBox.layer?.backgroundColor = NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1).cgColor
             self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1).cgColor
             self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1).cgColor
             self.activateTrialNowBtn.setTitleColor(NSColor(red: 7.0/255.0, green: 1.0/255.0, blue: 34.0/255.0, alpha: 1))
             self.activateTrialNowBtn.setTitleColor(NSColor(red: 7.0/255.0, green: 1.0/255.0, blue: 34.0/255.0, alpha: 1))
-            self.activateTrialNowBtn.mouseMoveCallback = { (mouseEntered) in
+            self.activateTrialNowBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                 if mouseEntered {
                     self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1).cgColor
                     self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1).cgColor
                     self.btnBox.fillColor = NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1)
                     self.btnBox.fillColor = NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1)
@@ -254,7 +250,7 @@ import Cocoa
             self.buyNowBtn.title = NSLocalizedString("Buy Now", comment: "")
             self.buyNowBtn.title = NSLocalizedString("Buy Now", comment: "")
             
             
             self.buyNowBtn.setTitleColor(NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1))
             self.buyNowBtn.setTitleColor(NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1))
-            self.buyNowBtn.mouseMoveCallback = { (mouseEntered) in
+            self.buyNowBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                 if mouseEntered {
                     self.buyNowBtn.setTitleColor(NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1))
                     self.buyNowBtn.setTitleColor(NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1))
                 } else {
                 } else {
@@ -264,7 +260,7 @@ import Cocoa
             
             
             self.enterLicenseBtn.title = NSLocalizedString("Enter License", comment: "")
             self.enterLicenseBtn.title = NSLocalizedString("Enter License", comment: "")
             self.enterLicenseBtn.setTitleColor(NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1))
             self.enterLicenseBtn.setTitleColor(NSColor(red: 181.0/255.0, green: 177.0/255.0, blue: 239.0/255.0, alpha: 1))
-            self.enterLicenseBtn.mouseMoveCallback = { (mouseEntered) in
+            self.enterLicenseBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                 if mouseEntered {
                     self.enterLicenseBtn.setTitleColor(NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1))
                     self.enterLicenseBtn.setTitleColor(NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1))
                 } else {
                 } else {
@@ -309,7 +305,7 @@ import Cocoa
             self.btnBox.layer?.backgroundColor = NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1).cgColor
             self.btnBox.layer?.backgroundColor = NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1).cgColor
             self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1).cgColor
             self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1).cgColor
             self.activateTrialNowBtn.setTitleColor(NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1))
             self.activateTrialNowBtn.setTitleColor(NSColor(red: 255.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1))
-            self.activateTrialNowBtn.mouseMoveCallback = { (mouseEntered) in
+            self.activateTrialNowBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                 if mouseEntered {
                     self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 0.0/255.0, green: 207.0/255.0, blue: 133.0/255.0, alpha: 1).cgColor
                     self.activateTrialNowBtn.layer?.backgroundColor = NSColor(red: 0.0/255.0, green: 207.0/255.0, blue: 133.0/255.0, alpha: 1).cgColor
                     self.btnBox.fillColor = NSColor(red: 0.0/255.0, green: 207.0/255.0, blue: 133.0/255.0, alpha: 1)
                     self.btnBox.fillColor = NSColor(red: 0.0/255.0, green: 207.0/255.0, blue: 133.0/255.0, alpha: 1)
@@ -326,7 +322,7 @@ import Cocoa
             
             
             self.buyNowBtn.title = NSLocalizedString("Buy Now", comment: "")
             self.buyNowBtn.title = NSLocalizedString("Buy Now", comment: "")
             self.buyNowBtn.setTitleColor(NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1))
             self.buyNowBtn.setTitleColor(NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1))
-            self.buyNowBtn.mouseMoveCallback = { (mouseEntered) in
+            self.buyNowBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                 if mouseEntered {
                     self.buyNowBtn.setTitleColor(NSColor(red: 8.0/255.0, green: 124.0/255.0, blue: 255.0/255.0, alpha: 1))
                     self.buyNowBtn.setTitleColor(NSColor(red: 8.0/255.0, green: 124.0/255.0, blue: 255.0/255.0, alpha: 1))
                 } else {
                 } else {
@@ -336,7 +332,7 @@ import Cocoa
             
             
             self.enterLicenseBtn.title = NSLocalizedString("Enter License", comment: "")
             self.enterLicenseBtn.title = NSLocalizedString("Enter License", comment: "")
             self.enterLicenseBtn.setTitleColor(NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1))
             self.enterLicenseBtn.setTitleColor(NSColor(red: 39.0/255.0, green: 60.0/255.0, blue: 98.0/255.0, alpha: 1))
-            self.enterLicenseBtn.mouseMoveCallback = { (mouseEntered) in
+            self.enterLicenseBtn.mouseMoveCallback = {[unowned self] (mouseEntered) in
                 if mouseEntered {
                 if mouseEntered {
                     self.enterLicenseBtn.setTitleColor(NSColor(red: 8.0/255.0, green: 124.0/255.0, blue: 255.0/255.0, alpha: 1))
                     self.enterLicenseBtn.setTitleColor(NSColor(red: 8.0/255.0, green: 124.0/255.0, blue: 255.0/255.0, alpha: 1))
                 } else {
                 } else {
@@ -529,4 +525,8 @@ import Cocoa
         
         
         return true
         return true
     }
     }
+    
+    func windowWillClose(_ notification: Notification) {
+        KMPurchaseFirstTrialWindowController.currentWindowController = nil
+    }
 }
 }

+ 5 - 4
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseFirstTrialWindowController.xib

@@ -7,7 +7,7 @@
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     </dependencies>
     <objects>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMPurchaseFirstTrialWindowController" customModule="PDF_Master" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMPurchaseFirstTrialWindowController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
             <connections>
                 <outlet property="activateTrialNowBtn" destination="IGp-1C-Tbg" id="ibx-WR-cwx"/>
                 <outlet property="activateTrialNowBtn" destination="IGp-1C-Tbg" id="ibx-WR-cwx"/>
                 <outlet property="bottomTextView" destination="6cO-55-aAM" id="hSV-mZ-ink"/>
                 <outlet property="bottomTextView" destination="6cO-55-aAM" id="hSV-mZ-ink"/>
@@ -313,7 +313,7 @@
                                             <rect key="frame" x="0.0" y="0.0" width="240" height="48"/>
                                             <rect key="frame" x="0.0" y="0.0" width="240" height="48"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                             <subviews>
                                             <subviews>
-                                                <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IGp-1C-Tbg" customClass="KMButton" customModule="PDF_Master" customModuleProvider="target">
+                                                <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IGp-1C-Tbg" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                     <rect key="frame" x="0.0" y="0.0" width="240" height="48"/>
                                                     <rect key="frame" x="0.0" y="0.0" width="240" height="48"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                                                     <buttonCell key="cell" type="bevel" title="Activate Trial Now" bezelStyle="rounded" imagePosition="overlaps" alignment="center" imageScaling="axesIndependently" inset="2" id="WSR-aq-hXl">
                                                     <buttonCell key="cell" type="bevel" title="Activate Trial Now" bezelStyle="rounded" imagePosition="overlaps" alignment="center" imageScaling="axesIndependently" inset="2" id="WSR-aq-hXl">
@@ -346,6 +346,7 @@
                                                     <color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                     <color key="backgroundColor" white="1" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                     <size key="minSize" width="404" height="68"/>
                                                     <size key="minSize" width="404" height="68"/>
                                                     <size key="maxSize" width="404" height="10000000"/>
                                                     <size key="maxSize" width="404" height="10000000"/>
+                                                    <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                                 </textView>
                                                 </textView>
                                             </subviews>
                                             </subviews>
                                             <color key="backgroundColor" red="1" green="1" blue="1" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
                                             <color key="backgroundColor" red="1" green="1" blue="1" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
@@ -368,7 +369,7 @@
                                                     <rect key="frame" x="0.0" y="0.0" width="65" height="21"/>
                                                     <rect key="frame" x="0.0" y="0.0" width="65" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <subviews>
                                                     <subviews>
-                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1Lk-iR-tGS" customClass="HyperLinkButton" customModule="PDF_Master" customModuleProvider="target">
+                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1Lk-iR-tGS" customClass="HyperLinkButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                             <rect key="frame" x="0.0" y="0.0" width="65" height="21"/>
                                                             <rect key="frame" x="0.0" y="0.0" width="65" height="21"/>
                                                             <buttonCell key="cell" type="bevel" title="Buy Now" bezelStyle="rounded" imagePosition="overlaps" alignment="center" imageScaling="axesIndependently" inset="2" id="veD-K9-dCw">
                                                             <buttonCell key="cell" type="bevel" title="Buy Now" bezelStyle="rounded" imagePosition="overlaps" alignment="center" imageScaling="axesIndependently" inset="2" id="veD-K9-dCw">
                                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -397,7 +398,7 @@
                                                     <rect key="frame" x="0.0" y="0.0" width="124" height="21"/>
                                                     <rect key="frame" x="0.0" y="0.0" width="124" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <subviews>
                                                     <subviews>
-                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="848-I0-ckh" customClass="HyperLinkButton" customModule="PDF_Master" customModuleProvider="target">
+                                                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="848-I0-ckh" customClass="HyperLinkButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                                             <rect key="frame" x="0.0" y="0.0" width="124" height="21"/>
                                                             <rect key="frame" x="0.0" y="0.0" width="124" height="21"/>
                                                             <buttonCell key="cell" type="bevel" title="Enter the License" bezelStyle="rounded" imagePosition="overlaps" alignment="center" imageScaling="axesIndependently" inset="2" id="orV-D8-Oxt">
                                                             <buttonCell key="cell" type="bevel" title="Enter the License" bezelStyle="rounded" imagePosition="overlaps" alignment="center" imageScaling="axesIndependently" inset="2" id="orV-D8-Oxt">
                                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>

+ 3 - 3
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseLimitWindowController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
     <dependencies>
         <deployment identifier="macosx"/>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     </dependencies>
     <objects>
     <objects>
@@ -28,7 +28,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="726" height="460"/>
             <rect key="contentRect" x="196" y="240" width="726" height="460"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
             <value key="minSize" type="size" width="726" height="460"/>
             <value key="minSize" type="size" width="726" height="460"/>
             <value key="maxSize" type="size" width="726" height="460"/>
             <value key="maxSize" type="size" width="726" height="460"/>
             <view key="contentView" id="se5-gp-TjO">
             <view key="contentView" id="se5-gp-TjO">