|
@@ -3545,16 +3545,12 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
|
|
|
|
Task { @MainActor in
|
|
Task { @MainActor in
|
|
if (type == .compress) { /// 压缩
|
|
if (type == .compress) { /// 压缩
|
|
-// #if VERSION_DMG
|
|
|
|
-// if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
|
|
|
|
-// let _ = KMComparativeTableViewController.show(window: self.view.window!, .compress)
|
|
|
|
-
|
|
|
|
-// self.toolbarController.cancelSelected(KMToolbarToolCompressItemIdentifier)
|
|
|
|
-// return
|
|
|
|
-
|
|
|
|
-// }
|
|
|
|
-// #endif
|
|
|
|
-
|
|
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
if await (KMLightMemberManager.manager.canPayFunction() == false) {
|
|
if await (KMLightMemberManager.manager.canPayFunction() == false) {
|
|
// self.view.window?.contentView?.superview?.beginLoading()
|
|
// self.view.window?.contentView?.superview?.beginLoading()
|
|
let document = self.listView.document
|
|
let document = self.listView.document
|
|
@@ -3638,14 +3634,12 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
}
|
|
}
|
|
|
|
|
|
if (type == .merge) { /// 合并
|
|
if (type == .merge) { /// 合并
|
|
-// #if VERSION_DMG
|
|
|
|
-// if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
|
|
|
|
-// let _ = KMComparativeTableViewController.show(window: self.view.window!, .merge)
|
|
|
|
-//
|
|
|
|
-// self.toolbarController.cancelSelected(KMToolbarToolMergeItemIdentifier)
|
|
|
|
-// return
|
|
|
|
-// }
|
|
|
|
-// #endif
|
|
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
|
|
if (self.listView.document.allowsCopying == false || self.listView.document.allowsPrinting == false) {
|
|
if (self.listView.document.allowsCopying == false || self.listView.document.allowsPrinting == false) {
|
|
if await (KMLightMemberManager.manager.canPayFunction() == false) {
|
|
if await (KMLightMemberManager.manager.canPayFunction() == false) {
|
|
@@ -3699,12 +3693,12 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
}
|
|
}
|
|
|
|
|
|
if (type == .crop) {
|
|
if (type == .crop) {
|
|
- #if VERSION_DMG
|
|
|
|
- if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
|
|
|
|
- let _ = KMComparativeTableViewController.show(window: self.view.window!, .crop)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- #endif
|
|
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
|
|
self.recordSaveWatermarkFlag(type: .crop)
|
|
self.recordSaveWatermarkFlag(type: .crop)
|
|
|
|
|
|
@@ -3721,6 +3715,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
// self.cropCustomArea()
|
|
// self.cropCustomArea()
|
|
} else if (type == .bates || type == .headerAndFooter) {
|
|
} else if (type == .bates || type == .headerAndFooter) {
|
|
if (index == 1) {
|
|
if (index == 1) {
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
var windowController: KMBaseWindowController = KMBaseWindowController()
|
|
var windowController: KMBaseWindowController = KMBaseWindowController()
|
|
|
|
|
|
if (type == .bates) {
|
|
if (type == .bates) {
|
|
@@ -3780,6 +3781,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
self.showBatchWindow(type: .RemoveHeaderFooter, files: [file])
|
|
self.showBatchWindow(type: .RemoveHeaderFooter, files: [file])
|
|
}
|
|
}
|
|
} else if (index == 2) { //// 移除
|
|
} else if (index == 2) { //// 移除
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
if type == .headerAndFooter {
|
|
if type == .headerAndFooter {
|
|
let savePanelAccessoryViewController = KMSavePanelAccessoryController()
|
|
let savePanelAccessoryViewController = KMSavePanelAccessoryController()
|
|
let savePanel = NSSavePanel()
|
|
let savePanel = NSSavePanel()
|
|
@@ -3864,6 +3872,14 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
self.openRightPane()
|
|
self.openRightPane()
|
|
}
|
|
}
|
|
} else if (type == .redact) { /// 标记密文
|
|
} else if (type == .redact) { /// 标记密文
|
|
|
|
+
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
if (index == 1) { /// 取消
|
|
if (index == 1) { /// 取消
|
|
if (self.hasAddRedact) {
|
|
if (self.hasAddRedact) {
|
|
let alert = NSAlert()
|
|
let alert = NSAlert()
|
|
@@ -3947,12 +3963,12 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
} else if (type == .secure) { /// 安全
|
|
} else if (type == .secure) { /// 安全
|
|
- #if VERSION_DMG
|
|
|
|
- if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
|
|
|
|
- let _ = KMComparativeTableViewController.show(window: self.view.window!, .secure)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- #endif
|
|
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
|
|
if (index == 1) { /// 设置密码
|
|
if (index == 1) { /// 设置密码
|
|
if (!self.listView.document!.allowsCopying || !self.listView.document!.allowsPrinting) {
|
|
if (!self.listView.document!.allowsCopying || !self.listView.document!.allowsPrinting) {
|
|
@@ -4048,6 +4064,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
} else if type == .comparison {
|
|
} else if type == .comparison {
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
let controller = KMCompareWindowController(windowNibName: "KMCompareWindowController")
|
|
let controller = KMCompareWindowController(windowNibName: "KMCompareWindowController")
|
|
self.currentWindowController = controller
|
|
self.currentWindowController = controller
|
|
controller.password = self.document?.password ?? ""
|
|
controller.password = self.document?.password ?? ""
|
|
@@ -4083,6 +4106,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
await NSWindow.currentWindow().beginSheet(controller.window!)
|
|
await NSWindow.currentWindow().beginSheet(controller.window!)
|
|
} else if type == .watermark {
|
|
} else if type == .watermark {
|
|
if index == 1 {
|
|
if index == 1 {
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
let controller = KMWatermarkWindowController(windowNibName: "KMWatermarkWindowController")
|
|
let controller = KMWatermarkWindowController(windowNibName: "KMWatermarkWindowController")
|
|
self.currentWindowController = controller
|
|
self.currentWindowController = controller
|
|
controller.pdfDocument = self.document
|
|
controller.pdfDocument = self.document
|
|
@@ -4100,6 +4130,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
// NSWindow.currentWindow().beginSheet(controller.window!)
|
|
// NSWindow.currentWindow().beginSheet(controller.window!)
|
|
NSWindow.currentWindow().beginSheet(controller.window!, completionHandler: nil)
|
|
NSWindow.currentWindow().beginSheet(controller.window!, completionHandler: nil)
|
|
} else if index == 2 {
|
|
} else if index == 2 {
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
let watermarks = self.listView.document.watermarks()
|
|
let watermarks = self.listView.document.watermarks()
|
|
if (watermarks == nil || watermarks!.count <= 0) {
|
|
if (watermarks == nil || watermarks!.count <= 0) {
|
|
let alert = NSAlert()
|
|
let alert = NSAlert()
|
|
@@ -4156,6 +4193,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
}
|
|
}
|
|
} else if type == .background {
|
|
} else if type == .background {
|
|
if index == 1 {
|
|
if index == 1 {
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
let controller = KMBackgroundWindowController(windowNibName: "KMBackgroundWindowController")
|
|
let controller = KMBackgroundWindowController(windowNibName: "KMBackgroundWindowController")
|
|
self.currentWindowController = controller
|
|
self.currentWindowController = controller
|
|
controller.pdfDocument = self.document
|
|
controller.pdfDocument = self.document
|
|
@@ -4173,6 +4217,13 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
|
|
|
|
await NSWindow.currentWindow().beginSheet(controller.window!)
|
|
await NSWindow.currentWindow().beginSheet(controller.window!)
|
|
} else if index == 2 {
|
|
} else if index == 2 {
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+ if !IAPProductsManager.default().isAvailableAllFunction() {
|
|
|
|
+ KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
guard let document = self.document else { return }
|
|
guard let document = self.document else { return }
|
|
|
|
|
|
if !document.allowsPrinting || !document.allowsCopying {
|
|
if !document.allowsPrinting || !document.allowsCopying {
|
|
@@ -4221,7 +4272,7 @@ 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("")
|