Pārlūkot izejas kodu

【2025】【综合】付费锁逻辑补充

niehaoyu 3 nedēļas atpakaļ
vecāks
revīzija
66b2f04152

+ 8 - 0
PDF Office/PDF Master/AppDelegate+MenuAction.swift

@@ -848,8 +848,16 @@ extension AppDelegate {
     @IBAction func menuItemAction_SplitView(_ sender: NSMenuItem) {
         if let mainVC = self.mainViewController() {
             if sender.tag == 0 {
+                if KMMemberInfo.shared.isLogin == false {
+                    KMLoginWindowsController.shared.showWindow(nil)
+                    return
+                }
                 mainVC.listView.viewSplitMode = .vertical
             } else if sender.tag == 1 {
+                if KMMemberInfo.shared.isLogin == false {
+                    KMLoginWindowsController.shared.showWindow(nil)
+                    return
+                }
                 mainVC.listView.viewSplitMode = .horizontal
             } else if sender.tag == 2 {
                 mainVC.listView.viewSplitMode = .disable

+ 23 - 28
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController+CreateFile.swift

@@ -205,12 +205,7 @@ extension KMBrowserWindowController {
                 }
                 if !alreadyOpen {
                     if self.browser?.tabCount() ?? 0 > 1{
-                        if !IAPProductsManager.default().isAvailableAllFunction() {
-                            showLimitWindowAlert(url: url)
-                            return
-                        }else {
-                            
-                        }
+                         
                     }
                 }
                 
@@ -712,32 +707,32 @@ extension KMBrowserWindowController {
     func checkOpenNewDocument(path: String) -> Bool {
         let tabCount = self.km_browser?.tabCount() ?? 0
         if tabCount > 1{
-            if !IAPProductsManager.default().isAvailableAllFunction() {
-                let preferenceNoteShow = UserDefaults.standard.bool(forKey: KMTabbingHintShowFlag)
-                if preferenceNoteShow {
-                    menuItemAction_newTagPageToNewWindow("")
-                } else {
-                    if !KMDataManager.default.isTabbingWin{
-                        KMDataManager.default.isTabbingWin = true
-                        let tabbingWin: KMTabbingHintWindowController = KMTabbingHintWindowController()
-                        tabbingWin.selectCallBack = {[weak self] continueOrNot in
-                            KMDataManager.default.isTabbingWin = false
-                            if continueOrNot {
-                                self?.reopenDocumentForNewWindow(savePath: path)
-                            } else {
-                                
-                            }
-                        }
-                        self.km_beginSheet(windowC: tabbingWin)
-                    }
-                }
-                return false
-            }else {
+//            if !IAPProductsManager.default().isAvailableAllFunction() {
+//                let preferenceNoteShow = UserDefaults.standard.bool(forKey: KMTabbingHintShowFlag)
+//                if preferenceNoteShow {
+//                    menuItemAction_newTagPageToNewWindow("")
+//                } else {
+//                    if !KMDataManager.default.isTabbingWin{
+//                        KMDataManager.default.isTabbingWin = true
+//                        let tabbingWin: KMTabbingHintWindowController = KMTabbingHintWindowController()
+//                        tabbingWin.selectCallBack = {[weak self] continueOrNot in
+//                            KMDataManager.default.isTabbingWin = false
+//                            if continueOrNot {
+//                                self?.reopenDocumentForNewWindow(savePath: path)
+//                            } else {
+//                                
+//                            }
+//                        }
+//                        self.km_beginSheet(windowC: tabbingWin)
+//                    }
+//                }
+//                return false
+//            }else {
                 if KMPreference.shared.openDocumentType == .newWindow {
                     self.reopenDocumentForNewWindow(savePath: path)
                     return false
                 }
-            }
+//            }
         }
         return true
     }

+ 17 - 17
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -236,7 +236,7 @@ import Cocoa
                         let winC = self?.kmCurrentWindowC as? KMTabbingHintWindowController
                         let newTab = winC?.newTabInWindowButton.state == .on
                         if continueOrNot {
-                            if IAPProductsManager.default().isAvailableAllFunction() && newTab {
+                            if newTab {
                                 self?.openDocumentWindow()
                             } else {
                                 self?.reopenDocument(forPaths: nil)
@@ -420,22 +420,22 @@ import Cocoa
             return
         }
         if let cnt = self.browser?.tabCount(), cnt > 1{
-            if !IAPProductsManager.default().isAvailableAllFunction() {
-                if !KMDataManager.default.isTabbingWin{
-                    KMDataManager.default.isTabbingWin = true
-                    let tabbingWin: KMTabbingHintWindowController = KMTabbingHintWindowController()
-                    tabbingWin.selectCallBack = { [weak self] continueOrNot in
-                        KMDataManager.default.isTabbingWin = false
-                        if continueOrNot {
-                            self?.reopenDocument(forPaths: nil)
-                        } else {
-                            
-                        }
-                    }
-                    self.km_beginSheet(windowC: tabbingWin)
-                }
-                return
-            }
+//            if !IAPProductsManager.default().isAvailableAllFunction() {
+//                if !KMDataManager.default.isTabbingWin{
+//                    KMDataManager.default.isTabbingWin = true
+//                    let tabbingWin: KMTabbingHintWindowController = KMTabbingHintWindowController()
+//                    tabbingWin.selectCallBack = { [weak self] continueOrNot in
+//                        KMDataManager.default.isTabbingWin = false
+//                        if continueOrNot {
+//                            self?.reopenDocument(forPaths: nil)
+//                        } else {
+//                            
+//                        }
+//                    }
+//                    self.km_beginSheet(windowC: tabbingWin)
+//                }
+//                return
+//            }
             if KMPreference.shared.openDocumentType == .newWindow {
                 self.reopenDocument(forPaths: nil)
                 return

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/AddPassword/View/KMSecurityView.swift

@@ -127,8 +127,8 @@ extension KMSecurityView {
 
 extension KMSecurityView {
     @objc func batchButtonAction(_ sender: Any) {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+        if KMMemberInfo.shared.isLogin == false {
+            KMLoginWindowsController.shared.showWindow(nil)
             return
         }
         guard let callBack = batchAction else { return }

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressSettingViewController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" 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="23504"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 0 - 4
PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressWindowController.swift

@@ -61,10 +61,6 @@ class KMCompressWindowController: KMNBaseWindowController {
         
         self.compressView.batchAction = { [unowned self] view in
             print("Batch 按钮点击")
-            if KMMemberInfo.shared.isLogin == false {
-                KMLoginWindowsController.shared.showWindow(nil)
-                return
-            }
             guard let callBack = batchAction else { return }
             
             callBack(self, [documentURL])

+ 3 - 3
PDF Office/PDF Master/Class/PDFTools/Compress/Controller/KMCompressWindowController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" 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="23504"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -18,7 +18,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="480" height="415"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="480" height="415"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 2 - 2
PDF Office/PDF Master/Class/PDFTools/Compress/View/KMCompressView.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" 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="23504"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 3 - 5
PDF Office/PDF Master/Class/PDFTools/RemovePassword/New/View/KMRemovePasswordView.swift

@@ -65,13 +65,11 @@ extension KMRemovePasswordView {
     
     
     @IBAction func removeButtonAction(_ sender: Any) {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_RemoveSecurity_BuyNow"
-            winC?.showWindow(nil)
+        if KMMemberInfo.shared.isLogin == false {
+            KMLoginWindowsController.shared.showWindow(nil)
             return
         }
-
+        
         guard let callBack = removeAction else { return }
         
         callBack(self, files)

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -1974,8 +1974,8 @@ void CPDFListViewOCDrawLineHandles(CGContextRef context, CGRect rect, CGFloat ra
         
         NSString *filePath = filePaths.firstObject;
         if ([supportArray containsObject:[filePath.pathExtension lowercaseString]]) {
-            if (![[IAPProductsManager defaultManager] isAvailableAllFunction]) {
-                [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
+            if ([KMMemberInfo shared].isLogin == false) {
+                [KMLoginWindowsController.shared showWindow:nil];
                 return NO;
             }
             if([[filePath.pathExtension lowercaseString] isEqual:@"pdf"]) {

+ 2 - 3
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailBaseViewController+Action.swift

@@ -693,9 +693,8 @@ extension KMNThumbnailBaseViewController {
     }
     
     @objc func sharePageItemAction(menuItem:NSMenuItem) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.showWindow(nil)
+        if KMMemberInfo.shared.isLogin == false {
+            KMLoginWindowsController.shared.showWindow(nil)
             return
         }
         let indexpaths = collectionView.selectionIndexPaths

+ 6 - 13
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController+Action.swift

@@ -196,8 +196,8 @@ extension KMMainViewController {
         Task { @MainActor in
             let idx = sender.tag
             if idx == 10 {
-                if IAPProductsManager.default().isAvailableAllFunction() == false {
-                    KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                if KMMemberInfo.shared.isLogin == false {
+                    KMLoginWindowsController.shared.showWindow(nil)
                     return
                 }
             }
@@ -535,8 +535,8 @@ extension KMMainViewController {
     @IBAction func imageAnnotation(_ sender: Any) {
         FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_Tools", withProperties: ["SubTbr_Btn": "Btn_SubTbr_Tools_Image"])
          
-        guard IAPProductsManager.default().isAvailableAllFunction() else {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+        if KMMemberInfo.shared.isLogin == false {
+            KMLoginWindowsController.shared.showWindow(nil)
             return
         }
         
@@ -599,10 +599,8 @@ extension KMMainViewController {
     @IBAction func tableAnnotation(_ sender: Any) {
         FMTrackEventManager.defaultManager.trackEvent(event: "SubTbr_Tools", withProperties: ["SubTbr_Btn": "Btn_SubTbr_Tools_Table"])
      
-        guard IAPProductsManager.default().isAvailableAllFunction() else {
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.kEventName = "Reading_Table_BuyNow"
-            winC?.showWindow(nil)
+        if KMMemberInfo.shared.isLogin == false {
+            KMLoginWindowsController.shared.showWindow(nil)
             return
         }
         listView.addAnnotationWithTable()
@@ -689,11 +687,6 @@ extension KMMainViewController {
      
     func openNewWindowAlertWindow() {
         var needShowChooseWindow = false
-        //#if VERSION_FREE
-        if (!IAPProductsManager.default().isAvailableAllFunction()) {
-            needShowChooseWindow = true
-        }
-        //#endif
         if needShowChooseWindow {
             let preferenceNoteShow = UserDefaults.standard.bool(forKey: KMTabbingHintShowFlag)
             if preferenceNoteShow {

+ 20 - 21
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -1235,10 +1235,6 @@ struct KMNMWCFlags {
     
     //MARK: - PPT
     func togglePresentation(_ sender: Any?) {
-        if KMMemberInfo.shared.isLogin == false {
-            KMLoginWindowsController.shared.showWindow(nil)
-            return
-        }
         if self.canExitPresentation() {
             exitFullScreen()
         } else if self.canEnterPresentation() {
@@ -3946,9 +3942,8 @@ extension KMMainViewController {
     }
     
     private func _showOCRWindow() {
-        if !IAPProductsManager.default().isAvailableAllFunction(){
-            let winC = KMPurchaseCompareWindowController.sharedInstance()
-            winC?.showWindow(nil)
+        if KMMemberInfo.shared.isLogin == false {
+            KMLoginWindowsController.shared.showWindow(nil)
             return
         }
         
@@ -8926,21 +8921,25 @@ extension KMMainViewController {
                 }
                 guideWC.purchaseHandle = { [weak self] windowVC in
 #if VERSION_DMG
-                    if IAPProductsManager.default().isAvailableAllFunction() {
-                        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-                            //Convert:
-                            
-                        } else {
-                            let limitWC = KMPurchaseLimitWindowController.currentLimitWC()
-                            limitWC.continueBlock = { windowController in
-                                
-                            }
-                            limitWC.window?.center()
-                            limitWC.showWindow(nil)
-                        }
-                    } else {
-                        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+                    if KMMemberInfo.shared.isLogin == false {
+                        KMLoginWindowsController.shared.showWindow(nil)
+                        return
                     }
+//                    if IAPProductsManager.default().isAvailableAllFunction() {
+//                        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+//                            //Convert:
+//                            
+//                        } else {
+//                            let limitWC = KMPurchaseLimitWindowController.currentLimitWC()
+//                            limitWC.continueBlock = { windowController in
+//                                
+//                            }
+//                            limitWC.window?.center()
+//                            limitWC.showWindow(nil)
+//                        }
+//                    } else {
+//                        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+//                    }
 #else
                     if IAPProductsManager.default().isAvailableAllFunction() {
                         if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {

+ 5 - 0
PDF Office/PDF Master/KMClass/KMPDFViewController/KMNDisplayViewController/KMNDisplayViewController.swift

@@ -576,6 +576,11 @@ class KMNDisplayViewController: NSViewController {
     }
     
     @objc func themeAddButtonClicked(_ sender: ComponentButton) {
+        if KMMemberInfo.shared.isLogin == false {
+            KMLoginWindowsController.shared.showWindow(nil)
+            return
+        }
+        
         let color = KMAppearance.Layout.l_1Color()
         themesArray.append(color)
         

+ 2 - 2
PDF Office/PDF Master/KMClass/Left/Search/Controller/KMBotaSearchViewController.swift

@@ -713,8 +713,8 @@ extension KMBotaSearchViewController: NSTableViewDelegate, NSTableViewDataSource
     }
     
     func tableView(_ aTableView: NSTableView, copyRowsWithIndexes rowIndexes: IndexSet) {
-        if IAPProductsManager.default().isAvailableAllFunction() == false {
-            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+        if KMMemberInfo.shared.isLogin == false {
+            KMLoginWindowsController.shared.showWindow(nil)
             return
         }