Просмотр исходного кода

Merge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

niehaoyu 6 месяцев назад
Родитель
Сommit
0a3ac13689

+ 1 - 0
PDF Office/PDF Master/Class/AutoSave/Tools/AutoSaveManager.swift

@@ -31,6 +31,7 @@ public let KAutoSaveTimeValueChangedNoti = "KAutoSaveTimeValueChangedNoti"
     var autoSaveDidEndAction = false
     // /当前是否正在保存
     var isSaving = false
+    var isSaveNoti = false
     
     private var _autoSaveFolder: String = ""
     var autoSaveFolder: String {

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

@@ -2410,6 +2410,7 @@ extension KMMainViewController {
         if AutoSaveManager.manager.isSaving{
             return
         }
+        AutoSaveManager.manager.isSaveNoti = true
         var num = 0
         if self.listView.document != nil{
             num = Int(self.listView.document.pageCount)
@@ -2424,9 +2425,10 @@ extension KMMainViewController {
     }
     
     func pdfSaveFinishAlertView(_ sender: NSNotification) {
-        if AutoSaveManager.manager.isSaving{
+        if !AutoSaveManager.manager.isSaveNoti{
             return
         }
+        AutoSaveManager.manager.isSaveNoti = false
         if Thread.current.isMainThread {
             self.dismissProgressSheet()
         } else {

+ 3 - 4
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -1506,13 +1506,12 @@ import Cocoa
             DispatchQueue.main.asyncAfter(deadline: .now()+0.1) {
                 // 隐藏进度
                 self.hiddenProgressWindow()
-                
+                DispatchQueue.main.asyncAfter(deadline: .now()+1) {
+                    AutoSaveManager.manager.isSaving = false
+                }
                 // 回调
                 callback()
             }
-            DispatchQueue.main.asyncAfter(deadline: .now()+1) {
-                AutoSaveManager.manager.isSaving = false
-            }
         }
     }
     func SaveTempPDFDocumentToURLPath(tempPath: String) {