|
@@ -3114,16 +3114,20 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
self.closeRightPane()
|
|
self.closeRightPane()
|
|
return
|
|
return
|
|
} else if index == 3 {
|
|
} else if index == 3 {
|
|
|
|
+ let file = KMFileAttribute()
|
|
|
|
+ file.filePath = (self.document?.documentURL.path)!
|
|
if type == .bates {
|
|
if type == .bates {
|
|
- self.showBatchWindow(type: .AddBates, files: [])
|
|
|
|
|
|
+ self.showBatchWindow(type: .AddBates, files: [file])
|
|
} else {
|
|
} else {
|
|
- self.showBatchWindow(type: .AddHeaderFooter, files: [])
|
|
|
|
|
|
+ self.showBatchWindow(type: .AddHeaderFooter, files: [file])
|
|
}
|
|
}
|
|
} else if index == 4 {
|
|
} else if index == 4 {
|
|
|
|
+ let file = KMFileAttribute()
|
|
|
|
+ file.filePath = (self.document?.documentURL.path)!
|
|
if type == .bates {
|
|
if type == .bates {
|
|
- self.showBatchWindow(type: .RemoveBates, files: [])
|
|
|
|
|
|
+ self.showBatchWindow(type: .RemoveBates, files: [file])
|
|
} else {
|
|
} else {
|
|
- self.showBatchWindow(type: .RemoveHeaderFooter, files: [])
|
|
|
|
|
|
+ self.showBatchWindow(type: .RemoveHeaderFooter, files: [file])
|
|
}
|
|
}
|
|
} else if (index == 2) { //// 移除
|
|
} else if (index == 2) { //// 移除
|
|
if type == .headerAndFooter {
|
|
if type == .headerAndFooter {
|
|
@@ -3458,9 +3462,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if index == 3 {
|
|
} else if index == 3 {
|
|
- self.showBatchWindow(type: .AddWatermark, files: [])
|
|
|
|
|
|
+ let file = KMFileAttribute()
|
|
|
|
+ file.filePath = (self.document?.documentURL.path)!
|
|
|
|
+ self.showBatchWindow(type: .AddWatermark, files: [file])
|
|
} else if index == 4 {
|
|
} else if index == 4 {
|
|
- self.showBatchWindow(type: .RemoveWatermark, files: [])
|
|
|
|
|
|
+ let file = KMFileAttribute()
|
|
|
|
+ file.filePath = (self.document?.documentURL.path)!
|
|
|
|
+ self.showBatchWindow(type: .RemoveWatermark, files: [file])
|
|
} else if index == 5 {
|
|
} else if index == 5 {
|
|
self.rightSideViewController.isHidden = false
|
|
self.rightSideViewController.isHidden = false
|
|
self.rightSideViewController.subViewType = KMWatermarkAdjectiveTools.KMToolBarTypeToRightSubViewType(type)
|
|
self.rightSideViewController.subViewType = KMWatermarkAdjectiveTools.KMToolBarTypeToRightSubViewType(type)
|
|
@@ -3511,9 +3519,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
} else if index == 3 {
|
|
} else if index == 3 {
|
|
- self.showBatchWindow(type: .AddBackground, files: [])
|
|
|
|
|
|
+ let file = KMFileAttribute()
|
|
|
|
+ file.filePath = (self.document?.documentURL.path)!
|
|
|
|
+ self.showBatchWindow(type: .AddBackground, files: [file])
|
|
} else if index == 4 {
|
|
} else if index == 4 {
|
|
- self.showBatchWindow(type: .RemoveBackground, files: [])
|
|
|
|
|
|
+ let file = KMFileAttribute()
|
|
|
|
+ file.filePath = (self.document?.documentURL.path)!
|
|
|
|
+ self.showBatchWindow(type: .RemoveBackground, files: [file])
|
|
} else if index == 5 {
|
|
} else if index == 5 {
|
|
self.rightSideViewController.isHidden = false
|
|
self.rightSideViewController.isHidden = false
|
|
self.rightSideViewController.subViewType = KMWatermarkAdjectiveTools.KMToolBarTypeToRightSubViewType(type)
|
|
self.rightSideViewController.subViewType = KMWatermarkAdjectiveTools.KMToolBarTypeToRightSubViewType(type)
|
|
@@ -3527,8 +3539,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
func showBatchWindow(type: KMBatchOperationType, files: [KMFileAttribute]?) {
|
|
func showBatchWindow(type: KMBatchOperationType, files: [KMFileAttribute]?) {
|
|
let batchWindowController = KMBatchOperateWindowController.sharedWindowController
|
|
let batchWindowController = KMBatchOperateWindowController.sharedWindowController
|
|
batchWindowController.window?.makeKeyAndOrderFront("")
|
|
batchWindowController.window?.makeKeyAndOrderFront("")
|
|
- let batchOperateFile = KMBatchOperateFile(filePath: "")
|
|
|
|
- batchWindowController.switchToOperateType(type, files: [batchOperateFile])
|
|
|
|
|
|
+
|
|
|
|
+ var array: [KMBatchOperateFile] = []
|
|
|
|
+ for file in files! {
|
|
|
|
+ let batchOperateFile = KMBatchOperateFile(filePath: file.filePath)
|
|
|
|
+ array.append(batchOperateFile)
|
|
|
|
+ }
|
|
|
|
+ batchWindowController.switchToOperateType(type, files: array)
|
|
batchWindowController.window?.makeKeyAndOrderFront("")
|
|
batchWindowController.window?.makeKeyAndOrderFront("")
|
|
}
|
|
}
|
|
|
|
|