Browse Source

【综合】App Target检查

tangchao 1 year ago
parent
commit
a1f9de7ee1

+ 35 - 6
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.swift

@@ -329,9 +329,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController,NSCo
         
         self.detailInfoView.mouseDownCallback = { [weak self] (downEntered: Bool) in
             if downEntered {
-//                if (![IAPProductsManager defaultManager].isAvailableAdvancedPDFToOffice) {
-                self?.convertActionVC()
-//                }
+                self?.moreConvertInfoAction()
             }
         }
         self.updateViewColor()
@@ -342,6 +340,8 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController,NSCo
 //        NotificationCenter.default.addObserver(self, selector: #selector(themeChanged(notification:)), name: NSNotification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
         DistributedNotificationCenter.default().addObserver(self, selector: #selector(themeChanged(notification:)), name: NSNotification.Name("AppleInterfaceThemeChangedNotification"), object: nil)
     }
+    
+    
     @objc func batchFilesCountNotification(notification: NSNotification) {
         let arr: Array? = notification.object as? [KMBatchOperateFile]
         self.files? = arr ?? []
@@ -455,7 +455,15 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController,NSCo
     }
     
     @IBAction func moreButtonAction(_ sender: NSButton) {
-        self.convertActionVC()
+#if VERSION_DMG
+        KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+#else
+        if IAPProductsManager.default().isAvailableAllFunction() {
+            self.convertActionVC()
+        } else {
+            KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+        }
+#endif
         self.buttonClicked_Cancel("")
     }
     
@@ -545,8 +553,8 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController,NSCo
     func collectionView(_ collectionView: NSCollectionView, viewForSupplementaryElementOfKind kind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) -> NSView {
         let view = collectionView.makeSupplementaryView(ofKind: kind, withIdentifier:NSUserInterfaceItemIdentifier(rawValue: "convertHeader") , for: indexPath) as? KMConvertCollectionViewHeader
         
-        view?.convertHeaderClickedCallBack = {
-            self.convertActionVC()
+        view?.convertHeaderClickedCallBack = { [weak self] in
+            self?.moreConvertInfoAction()
         }
         return view ?? NSView()
     }
@@ -591,6 +599,27 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController,NSCo
         }
         return type!
     }
+    
+    func moreConvertInfoAction() {
+        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false {
+            #if VERSION_DMG
+            if IAPProductsManager.default().isAvailableAllFunction() && IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false {
+                let limitWC = KMPurchaseLimitWindowController.currentLimitWC()
+                limitWC.continueBlock = { windowController in
+                    
+                }
+                limitWC.window?.center()
+                limitWC.showWindow(nil)
+            }
+            #else
+            if IAPProductsManager.default().isAvailableAllFunction() {
+                self.convertActionVC()
+            } else {
+                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
+            }
+            #endif
+        }
+    }
 }
 
 extension KMBatchOperateConvertViewController: NSCollectionViewDelegateFlowLayout {

+ 2 - 0
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift

@@ -285,6 +285,7 @@ import Cocoa
                 self.rightToolbarItemView = NSView.init(frame: CGRectMake(0, 10, 184, 40))
                 self.rightToolbarItemView.wantsLayer = true
                 
+                #if VERSION_DMG
                 if self.rightMessageVC == nil {
                     self.rightMessageVC = KMVerificationMessageViewController.init()
                 }
@@ -299,6 +300,7 @@ import Cocoa
                 self.rightMessageVC.view.frame = rect
                 self.rightMessageVC.view.autoresizingMask = [ .maxXMargin]
                 self.rightToolbarItemView.addSubview(self.rightMessageVC.view)
+                #endif
             }
             return self.rightToolbarItemView
         }

+ 3 - 0
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMToolCompareWindowController.swift

@@ -98,7 +98,10 @@ var currentWindowController: KMToolCompareWindowController? = nil
     var modalSession: NSApplication.ModalSession?
     
     deinit {
+#if VERSION_DMG
+#else
         NotificationCenter.default.removeObserver(self)
+#endif
     }
     
     convenience init(toolType: KMCompareWithToolType, selectNum: Int) {

+ 11 - 6
PDF Office/PDF Master/Class/Preference/Controller/KMGeneralPreferences.swift

@@ -55,7 +55,7 @@ class KMGeneralPreferences: NSViewController {
     
     var revertPDFSettingsButtons: [NSButton] = []
     
-    var updateInterval: Int = 0 {
+    var updateInterval: Float = 0 {
         didSet {
             
         }
@@ -346,9 +346,13 @@ class KMGeneralPreferences: NSViewController {
 extension KMGeneralPreferences {
     private func _synchronizeUpdateInterval() {
 //        self.willChangeValue(forKey: UPDATEINTERVAL_KEY)
-        #if VERSION_DMG
-//        updateInterval = [[SUUpdater sharedUpdater] automaticallyChecksForUpdates] ? [[SUUpdater sharedUpdater] updateCheckInterval] : 0;
-        #endif
+#if VERSION_DMG
+        if let updader = SUUpdater.shared() {
+            self.updateInterval = updader.automaticallyChecksForUpdates ? Float(updader.updateCheckInterval) : 0
+        } else {
+            self.updateInterval = 0
+        }
+#endif
 //        self.didChangeValue(forKey: UPDATEINTERVAL_KEY)
     }
     
@@ -405,8 +409,9 @@ extension KMGeneralPreferences: KMPreferencePane {
     func defaultsDidRevert() {
         let interval = Bundle.main.object(forInfoDictionaryKey: SUScheduledCheckIntervalKey)
     #if VERSION_DMG
-//        [[SUUpdater sharedUpdater] setUpdateCheckInterval:interval];
-//        [[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates:interval > 0.0];
+        let value = (interval as? NSNumber)?.doubleValue ?? 0
+        SUUpdater.shared().updateCheckInterval = value
+        SUUpdater.shared().automaticallyChecksForUpdates = value > 0
     #endif
         
         AutoSaveManager.manager.autoSaveEnabled = false

+ 4 - 36
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -46,8 +46,8 @@
             filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1793"
-            endingLineNumber = "1793"
+            startingLineNumber = "1795"
+            endingLineNumber = "1795"
             landmarkName = "KMBrowserWindowController"
             landmarkType = "21">
          </BreakpointContent>
@@ -571,8 +571,8 @@
             filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1022"
-            endingLineNumber = "1022"
+            startingLineNumber = "1024"
+            endingLineNumber = "1024"
             landmarkName = "menuItemClick_saveAsFlattenedPDF(_:)"
             landmarkType = "7">
          </BreakpointContent>
@@ -593,22 +593,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "1911ECC8-12F2-4E19-AAD6-2523DEF67E9A"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/Purchase/DMG/KMPurchaseCompareDMGWindowController.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "561"
-            endingLineNumber = "561"
-            landmarkName = "-enterLicenseAction:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -625,22 +609,6 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "29C99CD0-2D39-4392-A3DD-1C9CF1A02857"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/Purchase/DMG/KMPurchaseCompareDMGWindowController.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "572"
-            endingLineNumber = "572"
-            landmarkName = "-buttonItemClicked_Buy:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent