|
@@ -1224,40 +1224,47 @@ extension KMHomeViewController {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
|
|
|
- let controller = KMCompareWindowController(windowNibName: "KMCompareWindowController")
|
|
|
- self.currentWindowController = controller
|
|
|
-
|
|
|
- controller.filePath = openPanel.url!.path
|
|
|
-
|
|
|
- controller.cancelAction = { [unowned self] contr in
|
|
|
- self.view.window?.endSheet((controller.window)!)
|
|
|
-// self.currentWindowController = nil
|
|
|
- }
|
|
|
-
|
|
|
- controller.contentComplete = { [unowned self] controller, pdfCompareContent, result, oldDocument, document in
|
|
|
- DispatchQueue.main.async {
|
|
|
- self.view.window?.endSheet((controller.window)!)
|
|
|
-// self.currentWindowController = nil
|
|
|
+ KMBaseWindowController.checkPassword(url: URL(fileURLWithPath: openPanel.url!.path)) { [unowned self] success, resultPassword in
|
|
|
+ if success {
|
|
|
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
|
|
|
+ let controller = KMCompareWindowController(windowNibName: "KMCompareWindowController")
|
|
|
+ self.currentWindowController = controller
|
|
|
+
|
|
|
+ controller.password = resultPassword
|
|
|
+ controller.filePath = openPanel.url!.path
|
|
|
+
|
|
|
+ controller.cancelAction = { [unowned self] contr in
|
|
|
+ self.view.window?.endSheet((controller.window)!)
|
|
|
+ // self.currentWindowController = nil
|
|
|
+ }
|
|
|
+
|
|
|
+ controller.contentComplete = { [unowned self] controller, pdfCompareContent, result, oldDocument, document in
|
|
|
+ DispatchQueue.main.async {
|
|
|
+ self.view.window?.endSheet((controller.window)!)
|
|
|
+ // self.currentWindowController = nil
|
|
|
+
|
|
|
+ self.openContentCompareVC(with: pdfCompareContent, results: result, oldDocument: oldDocument, document: document)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- self.openContentCompareVC(with: pdfCompareContent, results: result, oldDocument: oldDocument, document: document)
|
|
|
+ controller.coveringComplete = { [unowned self] controller, document in
|
|
|
+ self.view.window?.endSheet((controller.window)!)
|
|
|
+ // self.currentWindowController = nil
|
|
|
+
|
|
|
+ self.openCoveringCompareVC(with: document)
|
|
|
+ }
|
|
|
+
|
|
|
+ // if index == 1 {
|
|
|
+ controller.fileType = .content
|
|
|
+ // } else {
|
|
|
+ // controller.fileType = .coverting
|
|
|
+ // }
|
|
|
+
|
|
|
+ NSWindow.currentWindow().beginSheet(controller.window!)
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- controller.coveringComplete = { [unowned self] controller, document in
|
|
|
- self.view.window?.endSheet((controller.window)!)
|
|
|
-// self.currentWindowController = nil
|
|
|
+ } else {
|
|
|
|
|
|
- self.openCoveringCompareVC(with: document)
|
|
|
}
|
|
|
-
|
|
|
-// if index == 1 {
|
|
|
- controller.fileType = .content
|
|
|
-// } else {
|
|
|
-// controller.fileType = .coverting
|
|
|
-// }
|
|
|
-
|
|
|
- NSWindow.currentWindow().beginSheet(controller.window!)
|
|
|
}
|
|
|
}
|
|
|
}
|