Ver código fonte

【综合】AI功能完善,合并功能优化

niehaoyu 6 meses atrás
pai
commit
0687baca1e

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/Merge/MergeNew/KMMergeWindowController.swift

@@ -252,7 +252,6 @@ extension KMMergeWindowController {
         //                self.savePanelAccessoryViewController = savePanelAccessoryViewController;
                         savePanel.beginSheetModal(for: self.window!) { result in
                             if result == .OK {
-                                self.cancelAction?()
                                 var outputSavePanel = savePanel.url?.path ?? ""
                                 DispatchQueue.main.async {
                                     var success = false
@@ -278,6 +277,7 @@ extension KMMergeWindowController {
                                         alert.messageText = "\(String(describing: files.first?.filePath.lastPathComponent)) + \(NSLocalizedString("Failed to merge!", comment: ""))"
                                         alert.runModal()
                                     }
+                                    self.cancelAction?()
                                 }
                             }
                         }
@@ -294,7 +294,6 @@ extension KMMergeWindowController {
     //                self.savePanelAccessoryViewController = savePanelAccessoryViewController;
                     savePanel.beginSheetModal(for: self.window!) { result in
                         if result == .OK {
-                            self.cancelAction?()
                             var outputSavePanel = savePanel.url?.path
                             DispatchQueue.main.async {
                                 var success = self.oldPDFDocument.write(toFile: outputSavePanel!)
@@ -316,6 +315,7 @@ extension KMMergeWindowController {
                                     alert.messageText = "\(String(describing: files.first?.filePath.lastPathComponent)) + \(NSLocalizedString("Failed to merge!", comment: ""))"
                                     alert.runModal()
                                 }
+                                self.cancelAction?()
                             }
                         }
                     }

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

@@ -4698,6 +4698,8 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                 FMTrackEventManager.defaultManager.trackEvent(event: "Tbr", withProperties: ["Tbr_Btn": "Btn_Tbr_DigitalSignature"])
             }
             self.enterDigitalSign()
+        } else if itemId == KMDocumentAIToolsToolbarItemIdentifier {
+            self.showAITypeChooseView(aiConfigType: .none)
         }
     }
     

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

@@ -1363,10 +1363,12 @@ import Cocoa
             
             self.mergeWindowController!.cancelAction = { [unowned self] controller in
                 self.view.window?.endSheet(mergeWindowController!.window!)
+                self.mergeWindowController = nil
             }
             
             self.mergeWindowController!.mergeAction = { [unowned self] controller, filePath in
                 self.view.window?.endSheet(mergeWindowController!.window!)
+                self.mergeWindowController = nil;
             }
             self.toolbarController.cancelSelected(KMToolbarToolMergeItemIdentifier)