Browse Source

【对比文档】添加旧文档后,点击对比按钮,弹出错误提示,再添加新文档,此时对比按钮是置灰的 -- 修复

lizhe 10 months ago
parent
commit
6c1b267a96

+ 3 - 1
PDF Office/PDF Master/Class/PDFTools/Compare/KMCompareWindowController.swift

@@ -61,7 +61,6 @@ class KMCompareWindowController: KMBaseWindowController {
     }
     
     func compareAction(config: KMCompareFilesConfig) {
-        compareView.doneButton.isEnabled = false
         self.showWaitting()
 
         guard let pdfOldDocument = config.fileOldAttribute.pdfDocument, let pdfNewDocument = config.fileNewAttribute.pdfDocument else {
@@ -251,6 +250,7 @@ class KMCompareWindowController: KMBaseWindowController {
 
 extension KMCompareWindowController {
     func showWaitting() {
+        compareView.doneButton.isEnabled = false
         if self.maskView == nil {
             self.maskView = KMBookletMaskView(frame: CGRect(x: 0, y: 0, width: self.window?.frame.size.width ?? 0, height: self.window?.frame.size.height ?? 0))
         }
@@ -271,6 +271,8 @@ extension KMCompareWindowController {
         self.window?.beginSheet(progress.window!)
     }
     func hideWaitting() {
+        compareView.doneButton.isEnabled = true
+        
         DispatchQueue.main.async {
             self.progressController?.doubleValue = 99.0
         }