|
@@ -81,6 +81,9 @@ import Cocoa
|
|
|
self.toolbarController.updataItemVisible()
|
|
|
}
|
|
|
}
|
|
|
+ //合并
|
|
|
+ var mergeWindowController: KMMergeWindowController?
|
|
|
+
|
|
|
//密码弹窗
|
|
|
var passwordWindow: KMPasswordInputWindow?
|
|
|
|
|
@@ -1296,31 +1299,20 @@ import Cocoa
|
|
|
guard let _url = documentURL else { return }
|
|
|
guard let document = PDFDocument(url: _url) else { return }
|
|
|
|
|
|
- let windowController = KMMergeWindowController(document: document, password: password ?? "")
|
|
|
- windowController.oriDucumentUrl = self.listView.document.documentURL
|
|
|
- windowController.pageIndex = self.listView.currentPageIndex
|
|
|
- self.currentWindowController = windowController
|
|
|
+ self.mergeWindowController = KMMergeWindowController(document: document, password: password ?? "")
|
|
|
+ self.mergeWindowController!.oriDucumentUrl = self.listView.document.documentURL
|
|
|
+ self.mergeWindowController!.pageIndex = self.listView.currentPageIndex
|
|
|
|
|
|
- windowController.cancelAction = { [unowned self] controller in
|
|
|
- self.view.window?.endSheet((self.currentWindowController.window)!)
|
|
|
- self.currentWindowController = nil
|
|
|
+ self.mergeWindowController!.cancelAction = { [unowned self] controller in
|
|
|
+ self.view.window?.endSheet(mergeWindowController!.window!)
|
|
|
}
|
|
|
|
|
|
- windowController.mergeAction = { [unowned self] controller, filePath in
|
|
|
- self.view.window?.endSheet((self.currentWindowController.window)!)
|
|
|
- self.currentWindowController = nil
|
|
|
-
|
|
|
-// let newDocument = CPDFDocument(url: NSURL(fileURLWithPath: filePath) as URL)
|
|
|
-// if let data = newDocument?.isLocked, data {
|
|
|
-// newDocument?.unlock(withPassword: self.listView.document.password ?? "")
|
|
|
-// }
|
|
|
-//
|
|
|
-// self.setDocument = newDocument
|
|
|
-// self.leftSideViewController.refreshUIForDocumentChanged()
|
|
|
+ self.mergeWindowController!.mergeAction = { [unowned self] controller, filePath in
|
|
|
+ self.view.window?.endSheet(mergeWindowController!.window!)
|
|
|
}
|
|
|
self.toolbarController.cancelSelected(KMToolbarToolMergeItemIdentifier)
|
|
|
|
|
|
- self.view.window?.beginSheet(windowController.window!)
|
|
|
+ self.view.window?.beginSheet(self.mergeWindowController!.window!)
|
|
|
}
|
|
|
}
|
|
|
|