|
@@ -1975,7 +1975,7 @@ struct KMNMWCFlags {
|
|
|
func reloadPopUIActiveAnnotations(activeAnnotations:[CPDFAnnotation]) {
|
|
|
let annotationMode = KMNAnnotationPopMode(pdfAnnotations: activeAnnotations )
|
|
|
let popWindow = KMNPopAnnotationWindowController.shared
|
|
|
- if annotationMode.popType == .popTypeNone {
|
|
|
+ if annotationMode.popType == .popTypeNone || !SettingsManager.sharedInstance.showQuickActionBar {
|
|
|
closeAnnotationPopWindow()
|
|
|
} else {
|
|
|
if popWindow.window?.isVisible == false {
|
|
@@ -2006,7 +2006,7 @@ struct KMNMWCFlags {
|
|
|
let editingAreas = listView.km_EditingAreas()
|
|
|
let editMode = KMNEditContentPopMode(currentEditAreas: editingAreas)
|
|
|
let popWindow = KMNPopContentEditWindowController.shared
|
|
|
- if editMode.popType == .editNone {
|
|
|
+ if editMode.popType == .editNone || !SettingsManager.sharedInstance.showQuickActionBar {
|
|
|
closePopContentEditWindow()
|
|
|
} else {
|
|
|
listView.window?.addChildWindow(popWindow.window ?? NSWindow(), ordered: .above)
|
|
@@ -3184,48 +3184,49 @@ struct KMNMWCFlags {
|
|
|
|
|
|
//MARK: - 转档
|
|
|
func showConvertWindow(_ convertType: KMPDFConvertType) {
|
|
|
-
|
|
|
+
|
|
|
+ var winC: KMConvertBaseWindowController = KMConvertBaseWindowController()
|
|
|
if convertType == .word {
|
|
|
- let winC = KMConvertWordWindowController()
|
|
|
+ winC = KMConvertWordWindowController()
|
|
|
let model = KMDocumentModel(url: listView.document.documentURL)
|
|
|
winC.documentModel = model
|
|
|
winC.own_beginSheetModal(for: self.view.window, completionHandler: nil)
|
|
|
} else if convertType == .ppt {
|
|
|
- let winC = KMConvertPPTsWindowController()
|
|
|
+ winC = KMConvertPPTsWindowController()
|
|
|
winC.subType = 1
|
|
|
let model = KMDocumentModel(url: listView.document.documentURL)
|
|
|
winC.documentModel = model
|
|
|
winC.own_beginSheetModal(for: self.view.window, completionHandler: nil)
|
|
|
} else if convertType == .rtf {
|
|
|
- let winC = KMConvertPPTsWindowController()
|
|
|
+ winC = KMConvertPPTsWindowController()
|
|
|
winC.subType = 2
|
|
|
let model = KMDocumentModel(url: listView.document.documentURL)
|
|
|
winC.documentModel = model
|
|
|
winC.own_beginSheetModal(for: self.view.window, completionHandler: nil)
|
|
|
} else if convertType == .text {
|
|
|
- let winC = KMConvertPPTsWindowController()
|
|
|
+ winC = KMConvertPPTsWindowController()
|
|
|
winC.subType = 4
|
|
|
let model = KMDocumentModel(url: listView.document.documentURL)
|
|
|
winC.documentModel = model
|
|
|
winC.own_beginSheetModal(for: self.view.window, completionHandler: nil)
|
|
|
} else if convertType == .csv {
|
|
|
- let winC = KMConvertPPTsWindowController()
|
|
|
+ winC = KMConvertPPTsWindowController()
|
|
|
winC.subType = 5
|
|
|
let model = KMDocumentModel(url: listView.document.documentURL)
|
|
|
winC.documentModel = model
|
|
|
winC.own_beginSheetModal(for: self.view.window, completionHandler: nil)
|
|
|
} else if convertType == .excel {
|
|
|
- let winC = KMConvertExcelWindowController()
|
|
|
+ winC = KMConvertExcelWindowController()
|
|
|
let model = KMDocumentModel(url: listView.document.documentURL)
|
|
|
winC.documentModel = model
|
|
|
winC.own_beginSheetModal(for: self.view.window, completionHandler: nil)
|
|
|
} else if convertType == .html {
|
|
|
- let winC = KMConvertHtmlWindowController()
|
|
|
+ winC = KMConvertHtmlWindowController()
|
|
|
let model = KMDocumentModel(url: listView.document.documentURL)
|
|
|
winC.documentModel = model
|
|
|
winC.own_beginSheetModal(for: self.view.window, completionHandler: nil)
|
|
|
} else if convertType == .json {
|
|
|
- let winC = KMConvertJsonWindowController()
|
|
|
+ winC = KMConvertJsonWindowController()
|
|
|
let model = KMDocumentModel(url: listView.document.documentURL)
|
|
|
winC.documentModel = model
|
|
|
winC.own_beginSheetModal(for: view.window, completionHandler: nil)
|
|
@@ -3237,7 +3238,7 @@ struct KMNMWCFlags {
|
|
|
convertType == .tga ||
|
|
|
convertType == .bmp ||
|
|
|
convertType == .jp2{
|
|
|
- let winC = KMConvertImageWindowController()
|
|
|
+ winC = KMConvertImageWindowController()
|
|
|
let model = KMDocumentModel(url: listView.document.documentURL)
|
|
|
winC.documentModel = model
|
|
|
winC.own_beginSheetModal(for: view.window, completionHandler: nil)
|
|
@@ -3245,6 +3246,10 @@ struct KMNMWCFlags {
|
|
|
settingView.selectConvertType(convertType: convertType)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ winC.batchAction = { [unowned self] in
|
|
|
+ self.showBatchWindow(type: .convertPDF, subType: convertType.rawValue, files: [listView.document.documentURL])
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//MARK: - 选择Form注释
|
|
@@ -3620,9 +3625,13 @@ extension KMMainViewController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//Batch
|
|
|
+//MARK: Batch
|
|
|
extension KMMainViewController {
|
|
|
func showBatchWindow(type: KMBatchCollectionViewType, files: [URL]?) {
|
|
|
+ self.showBatchWindow(type: type, subType: 0, files: files)
|
|
|
+ }
|
|
|
+
|
|
|
+ func showBatchWindow(type: KMBatchCollectionViewType, subType: Int = 0, files: [URL]?) {
|
|
|
let batchWindowController = KMBatchWindowController.init(windowNibName: "KMBatchWindowController")
|
|
|
batchWindowController.window?.makeKeyAndOrderFront("")
|
|
|
|
|
@@ -3633,16 +3642,7 @@ extension KMMainViewController {
|
|
|
// }
|
|
|
batchWindowController.inputData = files ?? []
|
|
|
batchWindowController.type = type
|
|
|
-
|
|
|
-// let batchWindowController = KMBatchOperateWindowController.sharedWindowController
|
|
|
-//
|
|
|
-// var array: [KMBatchOperateFile] = []
|
|
|
-// for fpath in filepaths ?? [] {
|
|
|
-// let batchOperateFile = KMBatchOperateFile(filePath: fpath, type: type)
|
|
|
-// array.append(batchOperateFile)
|
|
|
-// }
|
|
|
-// batchWindowController.switchToOperateType(type, files: array)
|
|
|
-// batchWindowController.window?.makeKeyAndOrderFront("")
|
|
|
+ batchWindowController.inputSubType = subType
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -5363,7 +5363,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
|
|
|
var pagePoint = CGPoint.zero
|
|
|
let point = theEvent.locationInWindow
|
|
|
|
|
|
- let isShowPopUI:Bool = false
|
|
|
+ let isShowPopUI:Bool = !SettingsManager.sharedInstance.showQuickActionBar
|
|
|
|
|
|
if let page = pdfListView.pageAndPoint(&pagePoint, for: theEvent, nearest: false) {
|
|
|
if view.window?.interactionMode == .presentation {
|
|
@@ -5652,7 +5652,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
|
|
|
|
|
|
groupListMenuGroup?.showWithPoint(CGPoint(x: windowPoint.x, y: windowPoint.y - menuStruct.viewHeight), relativeTo: listView)
|
|
|
} else {
|
|
|
- let isShowPopUI:Bool = false
|
|
|
+ let isShowPopUI:Bool = !SettingsManager.sharedInstance.showQuickActionBar
|
|
|
var menuStringArr: [String] = []
|
|
|
let editingAreas = listView.km_EditingAreas()
|
|
|
let firstEditingArea = editingAreas.first
|
|
@@ -6575,6 +6575,8 @@ extension KMMainViewController: ComponentGroupDelegate {
|
|
|
listView.delete(nil)
|
|
|
}
|
|
|
} else if(menuItemProperty?.identifier == PDFViewMenuIdentifier_Normal_ShowPopUI) {
|
|
|
+ UserDefaults.standard.setValue(true, forKey: settingsShowQuickActionBarKey)
|
|
|
+ SettingsManager.sharedInstance.showQuickActionBar = true
|
|
|
reloadPopUIWindow()
|
|
|
} else if(menuItemProperty?.identifier == PDFViewMenuIdentifier_Normal_LinkReade) {
|
|
|
|