|
@@ -87,12 +87,22 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
|
|
|
}
|
|
|
|
|
|
//MARK: 打开文件
|
|
|
- static func show(window: NSWindow, isContinue: Bool = false, isAI: Bool = false, type: KMSubscribeWaterMarkType = .none, subscribeDidClick: (()->Void)? = nil, completion: @escaping (_ isSubscribeSuccess: Bool, _ isWaterMarkExport: Bool, _ isClose: Bool) -> Void) -> KMSubscribeWaterMarkWindowController {
|
|
|
+ static func show(window: NSWindow, isContinue: Bool = false, type: KMSubscribeWaterMarkType = .none, subscribeDidClick: (()->Void)? = nil, completion: @escaping (_ isSubscribeSuccess: Bool, _ isWaterMarkExport: Bool, _ isClose: Bool) -> Void) -> KMSubscribeWaterMarkWindowController {
|
|
|
+ var isAI = false
|
|
|
+ if type == .aiCorrect ||
|
|
|
+ type == .aiRewrite ||
|
|
|
+ type == .aiTranslate {
|
|
|
+ isAI = true
|
|
|
+ } else {
|
|
|
+ isAI = false
|
|
|
+ }
|
|
|
+
|
|
|
if KMLightMemberManager.manager.isLogin() {
|
|
|
let subscribeWaterMarkWindowController: KMSubscribeWaterMarkWindowController = KMSubscribeWaterMarkWindowController.init(windowNibName: "KMSubscribeWaterMarkWindowController")
|
|
|
|
|
|
subscribeWaterMarkWindowController.isContinue = isContinue
|
|
|
subscribeWaterMarkWindowController.isAI = isAI
|
|
|
+
|
|
|
window.beginSheet(subscribeWaterMarkWindowController.window!)
|
|
|
subscribeWaterMarkWindowController.window?.center()
|
|
|
|
|
@@ -179,7 +189,20 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
|
|
|
subscribeWaterMarkMainWindow = window
|
|
|
return subscribeWaterMarkWindowController
|
|
|
} else {
|
|
|
- KMLoginWindowController.show(window: NSApp.mainWindow!,.equity)
|
|
|
+ let controller = KMLoginWindowController.show(window: NSApp.mainWindow!,.equity)
|
|
|
+ if isAI {
|
|
|
+ let alert = NSAlert()
|
|
|
+ alert.messageText = NSLocalizedString("Please login or register to proceed to the next step", comment: "")
|
|
|
+ alert.informativeText = NSLocalizedString("As a PDF Master member, you can subscribe to use AI features as needed.", comment: "")
|
|
|
+ alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
|
+ alert.beginSheetModal(for: (controller?.window)!) { result in
|
|
|
+// if (result == .alertFirstButtonReturn) {
|
|
|
+//
|
|
|
+// } else if result == .alertSecondButtonReturn {
|
|
|
+// return
|
|
|
+// }
|
|
|
+ }
|
|
|
+ }
|
|
|
return KMSubscribeWaterMarkWindowController.init()
|
|
|
}
|
|
|
}
|