Browse Source

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

liujiajie 10 months ago
parent
commit
2d1a3b8614

+ 2 - 0
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.swift

@@ -561,6 +561,8 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController,NSCo
     func collectionView(_ collectionView: NSCollectionView, viewForSupplementaryElementOfKind kind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) -> NSView {
         let view = collectionView.makeSupplementaryView(ofKind: kind, withIdentifier:NSUserInterfaceItemIdentifier(rawValue: "convertHeader") , for: indexPath) as? KMConvertCollectionViewHeader
         
+        view?.refreshData()
+        
         view?.convertHeaderClickedCallBack = { [weak self] in
             self?.moreConvertInfoAction()
         }

+ 19 - 17
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -480,23 +480,25 @@ extension KMHomeViewController {
     func openFile(withFilePath path: URL) -> Void {
         let type = path.pathExtension.lowercased()
         if (type == "pdf") {
-            if !path.path.isPDFValid() {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = NSLocalizedString("This file format is not supported, please drag in PDF, picture, Office format files", comment: "")
-                alert.runModal()
-                return
-            }
-            if needShowTabbingHintWindow() {
-                showTabbingHintWindow()
-                return
-            }
-            NSDocumentController.shared.openDocument(withContentsOf: path, display: true) { document, documentWasAlreadyOpen, error in
-                if error != nil {
-                    NSApp.presentError(error!)
-                    return
-                }
-            }
+//            if !path.path.isPDFValid() {
+//                let alert = NSAlert()
+//                alert.alertStyle = .critical
+//                alert.messageText = NSLocalizedString("This file format is not supported, please drag in PDF, picture, Office format files", comment: "")
+//                alert.runModal()
+//                return
+//            }
+//            if needShowTabbingHintWindow() {
+//                showTabbingHintWindow()
+//                return
+//            }
+//            NSDocumentController.shared.openDocument(withContentsOf: path, display: true) { document, documentWasAlreadyOpen, error in
+//                if error != nil {
+//                    NSApp.presentError(error!)
+//                    return
+//                }
+//            }
+            
+            self.openHistoryFilePath(url: path)
         } else if (type == "jpg") ||
                   (type == "cur") ||
                   (type == "bmp") ||