Browse Source

【APPCenter】编号:V4.0.1.31

lizhe 9 months ago
parent
commit
cbd5ac1142

+ 7 - 10
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -4147,24 +4147,21 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                 }
                 
                 if index == 1 {
-                    let controller = KMWatermarkWindowController(windowNibName: "KMWatermarkWindowController")
-                    self.currentWindowController = controller
-                    controller.pdfDocument = self.document
+                    self.watermarkWindowController = KMWatermarkWindowController(windowNibName: "KMWatermarkWindowController")
+                    self.watermarkWindowController!.pdfDocument = self.document
                     
-                    controller.cancelAction = { [unowned self] controller in
-                        self.view.window?.endSheet((self.currentWindowController.window)!)
-                        self.currentWindowController = nil
+                    self.watermarkWindowController!.cancelAction = { [unowned self] controller in
+                        self.view.window?.endSheet((self.watermarkWindowController!.window)!)
                     }
                     
-                    controller.operateCallBack = { [unowned self] controller, watermark, countType in
-                        self.view.window?.endSheet((self.currentWindowController.window)!)
-                        self.currentWindowController = nil
+                    self.watermarkWindowController!.operateCallBack = { [unowned self] controller, watermark, countType in
+                        self.view.window?.endSheet((self.watermarkWindowController!.window)!)
                         
                         let fpath = self.document?.documentURL?.path ?? ""
                         self.showBatchWindow(type: .AddWatermark, filepaths: [fpath])
                     }
 //                    NSWindow.currentWindow().beginSheet(controller.window!)
-                    NSWindow.currentWindow().beginSheet(controller.window!, completionHandler: nil)
+                    NSWindow.currentWindow().beginSheet(self.watermarkWindowController!.window!, completionHandler: nil)
                 } else if index == 2 {
                     let watermarks = self.listView.document.watermarks()
                     if (watermarks == nil || watermarks!.count <= 0) {

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

@@ -79,7 +79,8 @@ import Cocoa
     }
     //合并
     var mergeWindowController: KMMergeWindowController?
-    
+    //水印
+    var watermarkWindowController: KMWatermarkWindowController?
     //密码弹窗
     var passwordWindow: KMPasswordInputWindow?