Browse Source

【订阅】编辑工具付费弹窗对比检查

lizhe 1 year ago
parent
commit
3e525aa36c

+ 0 - 4
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -1203,10 +1203,6 @@ extension KMHomeViewController {
     }
     
     func fastTool_Security() {  // 安全
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-            return
-        }
         let openPanel = NSOpenPanel()
         openPanel.allowedFileTypes = ["pdf","PDF"]
         //MARK: 允许多选还是单选,如果是付费用户允许多选

+ 6 - 5
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.xib

@@ -1,16 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22146" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22146"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="System colors introduced in macOS 10.13" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMEditPDFTextPropertyViewController" customModule="PDF_Master" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMEditPDFTextPropertyViewController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
                 <outlet property="alignmentTopConstraint" destination="UEJ-wK-qqM" id="L36-e1-XfJ"/>
                 <outlet property="alignmentView" destination="Oi3-L1-ffT" id="rBC-Tk-pG6"/>
+                <outlet property="backgroundView" destination="TEL-xs-Bvc" id="Ycv-he-P2R"/>
                 <outlet property="centerAlignmentBox" destination="rXF-2b-cRj" id="fi9-sF-XfO"/>
                 <outlet property="colorBox" destination="Dcy-0U-AoP" id="ADd-OX-dJd"/>
                 <outlet property="contentView" destination="dAY-3A-lfL" id="mu3-cD-1Tc"/>
@@ -75,7 +76,7 @@
                                 </constraints>
                             </box>
                             <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="TmC-Oc-Dxd">
-                                <rect key="frame" x="14" y="616" width="31" height="16"/>
+                                <rect key="frame" x="14" y="616" width="30" height="16"/>
                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Text" id="tZm-OE-Wdr">
                                     <font key="font" usesAppearanceFont="YES"/>
                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -282,7 +283,7 @@
                                     <constraint firstAttribute="bottom" secondItem="cZ0-Lb-7rt" secondAttribute="bottom" id="zHr-Q3-Fwg"/>
                                 </constraints>
                             </customView>
-                            <customView hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Oi3-L1-ffT" customClass="KMEditPropertyAlignmentView" customModule="PDF_Master" customModuleProvider="target">
+                            <customView hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Oi3-L1-ffT" customClass="KMEditPropertyAlignmentView" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                 <rect key="frame" x="16" y="187" width="228" height="100"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="100" id="lQ0-Zl-AJK"/>

+ 14 - 35
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -3915,12 +3915,11 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                 //// 自定义裁剪区域
                 //            self.cropCustomArea()
             } else if (type == .bates || type == .headerAndFooter) {
+                if !IAPProductsManager.default().isAvailableAllFunction(){
+                    KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                    return
+                }
                 if (index == 1) {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-            return
-        }
-                    
                     var windowController: KMBaseWindowController = KMBaseWindowController()
                     
                     if (type == .bates) {
@@ -3980,11 +3979,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                         self.showBatchWindow(type: .RemoveHeaderFooter, files: [file])
                     }
                 } else if (index == 2) { //// 移除
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-            return
-        }
-                    
                     if type == .headerAndFooter {
                         let savePanelAccessoryViewController = KMSavePanelAccessoryController()
                         let savePanel = NSSavePanel()
@@ -4157,11 +4151,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     return
                 }
             } else if (type == .secure) { /// 安全
-//                if !IAPProductsManager.default().isAvailableAllFunction(){
-//                    KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-//                    return
-//                }
-//                
                 if (index == 1) { /// 设置密码
                     if (!self.listView.document!.allowsCopying || !self.listView.document!.allowsPrinting) {
                         KMPasswordInputWindow.openWindow(window: self.view.window!, type: .owner, url: self.listView.document.documentURL) { [weak self]  result, password in
@@ -4306,12 +4295,12 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
             
                 await NSWindow.currentWindow().beginSheet(controller.window!)
             } else if type == .watermark {
+                if !IAPProductsManager.default().isAvailableAllFunction(){
+                    KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                    return
+                }
+                
                 if index == 1 {
-                    if !IAPProductsManager.default().isAvailableAllFunction(){
-                        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-                        return
-                    }
-                    
                     let controller = KMWatermarkWindowController(windowNibName: "KMWatermarkWindowController")
                     self.currentWindowController = controller
                     controller.pdfDocument = self.document
@@ -4329,11 +4318,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
 //                    NSWindow.currentWindow().beginSheet(controller.window!)
                     NSWindow.currentWindow().beginSheet(controller.window!, completionHandler: nil)
                 } else if index == 2 {
-                    if !IAPProductsManager.default().isAvailableAllFunction(){
-                        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-                        return
-                    }
-                    
                     let watermarks = self.listView.document.watermarks()
                     if (watermarks == nil || watermarks!.count <= 0) {
                         let alert = NSAlert()
@@ -4389,12 +4373,12 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     return
                 }
             } else if type == .background {
+                if !IAPProductsManager.default().isAvailableAllFunction(){
+                    KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                    return
+                }
+                           
                 if index == 1 {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-            return
-        }
-                    
                     let controller = KMBackgroundWindowController(windowNibName: "KMBackgroundWindowController")
                     self.currentWindowController = controller
                     controller.pdfDocument = self.document
@@ -4412,11 +4396,6 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     
                     await NSWindow.currentWindow().beginSheet(controller.window!)
                 } else if index == 2 {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
-            return
-        }
-                    
                     guard let document = self.document else { return }
                     
                     if !document.allowsPrinting || !document.allowsCopying {