Przeglądaj źródła

【综合】首页菜单栏安全功能修复无法关闭窗口的问题

tangchao 1 rok temu
rodzic
commit
6718d2d46f

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

@@ -951,18 +951,7 @@ extension KMHomeViewController {
     }
     
     func fastTool_MergePDF() {  // MergePDF
-//        Task { @MainActor in
-//            if await (KMLightMemberManager.manager.canPayFunction() == false) {
-//                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true, type: .merge) { isSubscribeSuccess, isWaterMarkExport, isClose in
-//                    if (isClose) {
-//                        return
-//                    }
-//                    self.km_open_pdf_merge()
-//                }
-//                return
-//            }
-            self.km_open_pdf_merge()
-//        }
+        self.km_open_pdf_merge()
     }
     
     func km_open_pdf_merge() {

+ 4 - 11
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+UI.swift

@@ -337,22 +337,15 @@ extension KMHomeViewController {
         if let _password = password {
             windowC.myDocument.unlock(withPassword: _password)
         }
-        self.currentWindowController = windowC
         
         let newDocument: CPDFDocument = CPDFDocument(url: url)
         windowC.itemClick = { [weak self] _ in
-            if let _currentWindow = self?.currentWindowController?.window {
-                self?.view.window?.endSheet(_currentWindow)
-            }
-            self?.currentWindowController = nil
+            self?.km_endSheet()
         }
         
         windowC.resultCallback = { [weak self] _ in
-            let windowController_secure: KMSecureEncryptWindowController = self?.currentWindowController as! KMSecureEncryptWindowController
-            if let _currentWindow = self?.currentWindowController?.window {
-                self?.view.window?.endSheet(_currentWindow)
-            }
-            self?.currentWindowController = nil
+            let windowController_secure: KMSecureEncryptWindowController = self?.kmCurrentWindowC as! KMSecureEncryptWindowController
+            self?.km_endSheet()
             if let _password = password {
                 newDocument.unlock(withPassword: _password)
             }
@@ -387,7 +380,7 @@ extension KMHomeViewController {
             }
         }
         
-        self.view.window?.beginSheet(windowC.window!)
+        self.km_beginSheet(windowC: windowC)
     }
 }