Procházet zdrojové kódy

【综合】去除注释代码和保存水印代码

tangchao před 6 měsíci
rodič
revize
9d982f2f40

+ 1 - 19
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+UI.swift

@@ -82,25 +82,7 @@ extension KMHomeViewController {
     }
     
     func showSecurityWindow() {
-//        Task { @MainActor in
-//            #if VERSION_DMG
-//            if await (KMLightMemberManager.manager.canUseAdvanced() == false) {
-//                let _ = KMComparativeTableViewController.show(window: self.view.window!, .merge)
-//                return
-//            }
-//            #endif
-//
-//            if await (KMLightMemberManager.manager.canPayFunction() == false) {
-//                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isContinue: true) { isSubscribeSuccess, isWaterMarkExport, isClose in
-//                    if (isClose) {
-//                        return
-//                    }
-//                    self.km_secure_openPanel_security(limit: true)
-//                }
-//                return
-//            }
-//            self.km_secure_openPanel_security()
-//        }
+
     }
     
     func km_secure_openPanel_security(limit: Bool = false) {

+ 2 - 65
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -3003,29 +3003,11 @@ extension KMMainViewController {
                 // 隐藏提示
                 self?.hiddenSecureLimitTip()
                 // 去打印
-                if let data = self?.saveWatermarkFlag, !data {
-                    KMPrintWindowController.openDocument(inputDocument: self!.listView?.document, inputPageRange: pageRange)
-                    return
-                }
-                if let _url = KMTools.saveWatermarkDocumentToTemp(document: self!.listView.document, secureOptions: self!.secureOptions, removePWD: self!.removeSecureFlag) {
-                    _ = CPDFDocument(url: _url)
-                    KMPrintWindowController.showPrintWindowControll(inputData: _url, inputDocument: self?.listView.document, inputPageRange: pageRange)
-                } else {
-                    KMPrintWindowController.openDocument(inputDocument: self?.listView?.document, inputPageRange: pageRange)
-                }
+                KMPrintWindowController.openDocument(inputDocument: self?.listView?.document, inputPageRange: pageRange)
             }
             return
         }
-        if (!self.saveWatermarkFlag) {
-            KMPrintWindowController.openDocument(inputDocument: self.listView?.document, inputPageRange: pageRange)
-            return
-        }
-        if let _url = KMTools.saveWatermarkDocumentToTemp(document: self.listView.document, secureOptions: self.secureOptions, removePWD: self.removeSecureFlag) {
-            let _document = CPDFDocument(url: _url)
-            KMPrintWindowController.showPrintWindowControll(inputData: _url, inputDocument: self.listView.document, inputPageRange: pageRange)
-        } else {
-            KMPrintWindowController.openDocument(inputDocument: self.listView?.document, inputPageRange: pageRange)
-        }
+        KMPrintWindowController.openDocument(inputDocument: self.listView?.document, inputPageRange: pageRange)
     }
     
     // MARK: - 图片注释
@@ -3531,22 +3513,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
         #endif
         self.trackEvent_aiTranslate()
         self._aiTranslationPDFFileAction()
-//        Task { @MainActor in
-//            if await (KMLightMemberManager.manager.canPayFunction() == false) {
-//                let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, type: .aiTranslate) { isSub, _, isClose in
-//                    if (isClose) {
-//                        return
-//                    }
-//                    if (isSub) {
-//                        self._aiTranslationPDFFileAction()
-//                        return
-//                    }
-//                }
-//                return
-//            }
-//
-//            self._aiTranslationPDFFileAction()
-//        }
     }
     
     private func _aiTranslationPDFFileAction() {
@@ -3731,27 +3697,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     return
                 }
                 
-                if await (KMLightMemberManager.manager.canPayFunction() == false) {
-//                    self.view.window?.contentView?.superview?.beginLoading()
-                    let document = self.listView.document
-                    let secureOptions = self.secureOptions
-                    let removeSecureFlag = self.removeSecureFlag
-                    
-//                    DispatchQueue.global().async { [unowned self] in
-                        guard let _url = KMTools.saveWatermarkDocumentToTemp(document: document!, secureOptions: secureOptions, removePWD: removeSecureFlag) else {
-//                            DispatchQueue.main.async {
-//                                self.view.window?.contentView?.superview?.endLoading()
-//                            }
-                            return
-                        }
-//                        DispatchQueue.main.async {
-//                            self.view.window?.contentView?.superview?.endLoading()
-                            self.showCompressWindow(url: _url)
-//                        }
-//                    }
-                    return
-                }
-                
                 if (self.needSaveDocument()) {
                     self.saveDocumentWithProgressAlert { [unowned self] params in
                         self.showCompressWindow()
@@ -3799,14 +3744,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     return
                 }
                 
-                if await (KMLightMemberManager.manager.canPayFunction() == false) {
-                    guard let _url =  KMTools.saveWatermarkDocumentToTemp(document: self.listView.document, secureOptions: self.secureOptions, removePWD: self.removeSecureFlag) else {
-                        return
-                    }
-                    self.showMergeWindow(url: _url, self.model.password)
-                    return
-                }
-                
                 if (self.needSaveDocument()) {
                     self.saveDocumentWithProgressAlert { [unowned self] params in
                         self.showMergeWindow(self.listView.document.password)