Sfoglia il codice sorgente

【综合】提取图片界面持有优化

niehaoyu 10 mesi fa
parent
commit
a5703abff3

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

@@ -2927,13 +2927,13 @@ extension KMMainViewController {
                 return
             }
         }
-        let extract = KMExtractImageWindowController(windowNibName: "KMExtractImageWindowController")
-        extract.docPath = fileURL?.path ?? ""
-        extract.password = document?.password ?? ""
-        extract.currentPage = self.listView.currentPageIndex
+        extract = KMExtractImageWindowController(windowNibName: "KMExtractImageWindowController")
+        extract?.docPath = fileURL?.path ?? ""
+        extract?.password = document?.password ?? ""
+        extract?.currentPage = self.listView.currentPageIndex
 //        extract.beginSheetModal(for: NSApp.mainWindow!, completionHandler: nil)
-        self.km_beginSheet(windowC: extract)
-        extract.selectCurrentPageBtn()
+        self.km_beginSheet(windowC: extract!)
+        extract?.selectCurrentPageBtn()
 //        self.showCreateStamp()
 //        self.showAddSignature()
     }

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

@@ -131,6 +131,8 @@ import Cocoa
     let CPDFOfficeLeftSidePaneWidthKey = "CPDFOfficeLeftSidePaneWidthKey"
     let CPDFOfficeRightSidePaneWidthKey = "CPDFOfficeRightSidePaneWidthKey"
     
+    var extract: KMExtractImageWindowController?
+    
     var functionWidth: Double {
         get {
             if self.isReadMode {