|
@@ -1034,21 +1034,21 @@ extension KMHomeViewController {
|
|
|
}
|
|
|
|
|
|
func fastTool_Insert() { // 插入
|
|
|
- let openPanel = NSOpenPanel()
|
|
|
- openPanel.prompt = "插入"
|
|
|
- openPanel.allowsMultipleSelection = false
|
|
|
- openPanel.allowedFileTypes = ["pdf"]
|
|
|
-
|
|
|
- openPanel.beginSheetModal(for: NSApp.mainWindow!) { result in
|
|
|
- if result == .OK {
|
|
|
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
|
|
|
- let insertWindowController: KMPDFInsertPageWindow = KMPDFInsertPageWindow.init(documentPath: openPanel.url!, toolType: .Insert)
|
|
|
- insertWindowController.beginSheetModal(for: self.view.window!) { pdfDocument, password, pages, indexPage in
|
|
|
- self.insertPageAction(pdfDocument, password, pages, indexPage)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// let openPanel = NSOpenPanel()
|
|
|
+// openPanel.prompt = "插入"
|
|
|
+// openPanel.allowsMultipleSelection = false
|
|
|
+// openPanel.allowedFileTypes = ["pdf"]
|
|
|
+//
|
|
|
+// openPanel.beginSheetModal(for: NSApp.mainWindow!) { result in
|
|
|
+// if result == .OK {
|
|
|
+// DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
|
|
|
+// let insertWindowController: KMPDFInsertPageWindow = KMPDFInsertPageWindow.init(documentPath: openPanel.url!, toolType: .Insert)
|
|
|
+// insertWindowController.beginSheetModal(for: self.view.window!) { pdfDocument, password, pages, indexPage in
|
|
|
+// self.insertPageAction(pdfDocument, password, pages, indexPage)
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
func fastTool_BreakUp() { // 拆分
|
|
@@ -1060,31 +1060,31 @@ extension KMHomeViewController {
|
|
|
// if result == .OK {
|
|
|
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
|
|
|
// let document = CPDFDocument(url: openPanel.url)
|
|
|
-//
|
|
|
+//
|
|
|
// let model = KMPageEditSplitSettingModel()
|
|
|
// model.documentURL = openPanel.url
|
|
|
// model.fileName = model.documentURL.lastPathComponent
|
|
|
// model.pathExtension = model.fileName.components(separatedBy: ".").last
|
|
|
-//
|
|
|
+//
|
|
|
// let windowController = KMPageEditSplitWindowController(model)
|
|
|
// windowController.hasPreView = true
|
|
|
// self.view.window?.beginSheet(windowController.window!)
|
|
|
// self.currentWindowController = windowController
|
|
|
-//
|
|
|
+//
|
|
|
// windowController.itemClick = { [weak self] index, value in
|
|
|
// if (index == 1) { /// 取消
|
|
|
// self?.view.window?.endSheet((self?.currentWindowController!.window)!)
|
|
|
// self?.currentWindowController = nil
|
|
|
// return
|
|
|
// }
|
|
|
-//
|
|
|
+//
|
|
|
// /// 拆分
|
|
|
// let windowController_split: KMPageEditSplitWindowController = self?.currentWindowController as! KMPageEditSplitWindowController
|
|
|
// let outputModel: KMPageEditSplitSettingModel = windowController_split.model! as! KMPageEditSplitSettingModel
|
|
|
-//
|
|
|
+//
|
|
|
// self?.view.window?.endSheet((self?.currentWindowController!.window)!)
|
|
|
// self?.currentWindowController = nil
|
|
|
-//
|
|
|
+//
|
|
|
// let panel = NSOpenPanel()
|
|
|
// panel.canChooseFiles = false
|
|
|
// panel.canChooseDirectories = true
|
|
@@ -1092,7 +1092,7 @@ extension KMHomeViewController {
|
|
|
// panel.beginSheetModal(for: (self?.view.window)!) { response in
|
|
|
// KMPageEditTools.split(document!, outputModel, panel.url!.path, outputModel.outputFileNameDeletePathExtension) { result, outputDocuments, error in
|
|
|
// if (result) {
|
|
|
-//
|
|
|
+//
|
|
|
// }
|
|
|
// }
|
|
|
// }
|