|
@@ -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") ||
|