Browse Source

【综合】页面编辑新增付费限制

tangchao 1 năm trước cách đây
mục cha
commit
a03118af70

+ 58 - 1
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -293,6 +293,10 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func cutAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
         if (self.thumbnailView.selectionIndexPaths.count == (self.listView?.document.pageCount)!) {
             let _ = CustomAlertView.alertView(message: NSLocalizedString("Unable to delete all pages", comment: ""), fromView: self.thumbnailView, withStyle: .blue)
             return
@@ -307,6 +311,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func deleteAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         self.trackEvent(type: .delete)
         
         super.deleteAction()
@@ -330,6 +339,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func leftRotateAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         self.trackEvent(type: .leftRotate)
         
         super.leftRotateAction()
@@ -346,6 +360,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func rightRotateAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         self.trackEvent(type: .rightRotate)
         
         super.rightRotateAction()
@@ -372,6 +391,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func pasteAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         if (self.canPaste()) {
             super.pasteAction()
             
@@ -380,6 +404,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func extractAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         self.trackEvent(type: .extract)
         
         super.extractAction()
@@ -390,6 +419,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func replaceAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         self.trackEvent(type: .replace)
         
         super.replaceAction()
@@ -444,6 +478,10 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
 //                self._splitMethod(windowC: splitWindowC, model: model)
 //            }
 //        }
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
         
         let windowC = SplitWindowController(document: self.pdfDocument!)
         self.km_beginSheet(windowC: windowC)
@@ -463,7 +501,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
 //    #endif
 //            return;
 //        }
-
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         let pdf = self.thumbnailView.document
         let pages = self.thumbnailView.selectionIndexPaths
         if (pages.isEmpty == false) {
@@ -534,6 +576,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     override func reverseAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         self.trackEvent(type: .reverse)
         
 //        Task { @MainActor in
@@ -808,6 +855,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     // MARK: menu 菜单事件
     
     @objc func item_insertCustomPage(sender: NSMenuItem?) {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         let windowC = KMPDFEditInsertBlankPageWindow(document: self.pdfDocument!)
         windowC.callback = { [weak self] pdfDoc, _, pages, insertI in
             if let _pages = pages {
@@ -917,6 +969,11 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
     }
     
     func extractSelectPageItemAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         let indexs = self.thumbnailView.selectionIndexPaths
         if indexs.isEmpty {
             CustomAlertView.alertView(message: KMLocalizedString("No pages selected. Please select one or more pages first to organize.",nil), fromView: self.thumbnailView, withStyle: .blue)

+ 34 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/Base/KMPDFThumbViewBaseController.swift

@@ -181,6 +181,11 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
 //
 //            self.insertPages(pages: pages, at: indexs)
 //        }
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         let panel = NSOpenPanel()
         panel.allowedFileTypes = ["pdf"]
         panel.beginSheetModal(for: self.view.window!) { response in
@@ -222,6 +227,11 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     
     // 插入空白页面事件
     public func insertBlankPageAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         let index = self.getInsertIndex()
         guard let page = self.thumbnailView.document?.page(at: UInt(index)) else {
             KMPrint("insert blank page failure.")
@@ -264,12 +274,22 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     }
     
     public func cutAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         let indexpaths = self.thumbnailView.selectionIndexPaths
         self._cutPages(indexpaths: indexpaths)
         self.cutAfter(indexpaths: indexpaths)
     }
     
     public func copyAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         let indexpaths = self.thumbnailView.selectionIndexPaths
         self._copyPages(indexpaths: indexpaths)
         self.copyAfter(indexpaths: indexpaths)
@@ -298,6 +318,11 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     }
     
     public func pasteAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         if (!self.canPaste()) {
             KMPrint("no can paste.")
             return
@@ -369,6 +394,11 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
 //        let pageIndexs = self.indexpathsToIndexs(indexpaths: indexpaths)
 //        var fileName = self.thumbnailView.document?.documentURL.deletingPathExtension().lastPathComponent
 //        fileName?.append(KMPageRangeTools.newParseSelectedIndexs(selectedIndex: pageIndexs.sorted()))
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
+        
         let windowC = KMPDFEditExtractWindow(document: self.thumbnailView.document!, selectedPagesName: "")
         windowC.callback = { [weak self] pdfDoc, fileAttribute, oneDocumentPerPage, isDeletePage in
             self?.km_endSheet()
@@ -389,6 +419,10 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
     
     // 替换 特定的item
     public func replaceAction() {
+        if IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
         self.km_open_file_multi {  [unowned self] index, params in
             if (self.fetchProgressBlockParamsIsPasswordFile(params: params)) { // 加密文档进度回调
                 return

+ 4 - 4
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/PageDisplay/KMPageDisplayPropertiesViewController.swift

@@ -516,10 +516,10 @@ class KMPageDisplayPropertiesButton: NSButton {
     @IBAction private func splitViewButtonAction(_ sender: KMPageDisplayPropertiesButton) {
 //        [[FMTrackEventManager manager] trackEvent:@"SubTbr_PageDisplay" withProperties:@{@"SubTbr_Btn":@"Btn_SubTbr_PageDisplay_ViewSetting_SplitView"}];
         
-//        if sender.tag > 0 && IAPProductsManager.default().isAvailableAllFunction() == false {
-//            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-//            return
-//        }
+        if sender.tag > 0 && IAPProductsManager.default().isAvailableAllFunction() == false {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            return
+        }
         
         let menuItem = NSMenuItem()
         switch sender.tag {

+ 16 - 0
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -132,5 +132,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "BE287A37-CCB4-4A24-BE76-B4DFF3F1FBBB"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/Base/KMPDFThumbViewBaseController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "246"
+            endingLineNumber = "246"
+            landmarkName = "insertBlankPage(size:at:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>