Browse Source

Merge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

tangchao 11 months ago
parent
commit
4c9d1420a5

+ 13 - 3
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.swift

@@ -339,6 +339,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController,NSCo
         NotificationCenter.default.addObserver(self, selector: #selector(IAPProductRestoreFinishedNotification(notification:)), name: NSNotification.Name("KMIAPProductRestoreFinishedNotification"), object: nil)
 //        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)
+        NotificationCenter.default.addObserver(self, selector: #selector(deviceActivateStatusChanged(notification:)), name: NSNotification.Name("kDeviceActivateNotification"), object: nil)
     }
     
     
@@ -374,6 +375,13 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController,NSCo
             self.collectionView.reloadData()
         }
     }
+    @objc func deviceActivateStatusChanged(notification: NSNotification) {
+        DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
+            self.updateBottomView()
+            self.prepareData()
+            self.collectionView.reloadData()
+        }
+    }
     func updateViewColor() {
         self.view.wantsLayer = true
         if KMAppearance.isDarkMode() {
@@ -602,7 +610,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController,NSCo
     
     func moreConvertInfoAction() {
         if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false {
-            #if VERSION_DMG
+#if VERSION_DMG
             if IAPProductsManager.default().isAvailableAllFunction() && IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false {
                 let limitWC = KMPurchaseLimitWindowController.currentLimitWC()
                 limitWC.continueBlock = { windowController in
@@ -610,14 +618,16 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController,NSCo
                 }
                 limitWC.window?.center()
                 limitWC.showWindow(nil)
+            }else{
+                KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
             }
-            #else
+#else
             if IAPProductsManager.default().isAvailableAllFunction() {
                 self.convertActionVC()
             } else {
                 KMPurchaseCompareWindowController.sharedInstance().showWindow(nil)
             }
-            #endif
+#endif
         }
     }
 }

+ 10 - 8
PDF Office/PDF Master/Class/Home/View/HomeContentView/History/Cell/KMHomeHistoryCollectionItem.xib

@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" 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="22155"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="Named colors" 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="KMHomeHistoryCollectionItem" customModule="PDF_Master" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMHomeHistoryCollectionItem" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
                 <outlet property="contentBox" destination="gvc-kj-Yeo" id="b05-Yu-1sn"/>
                 <outlet property="handleView" destination="seD-7E-dp2" id="AlN-MY-rLZ"/>
@@ -30,7 +30,7 @@
         <customView translatesAutoresizingMaskIntoConstraints="NO" id="Hz6-mo-xeY">
             <rect key="frame" x="0.0" y="0.0" width="594" height="258"/>
             <subviews>
-                <box boxType="custom" borderWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="gvc-kj-Yeo" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
+                <box boxType="custom" borderWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="gvc-kj-Yeo" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="0.0" y="0.0" width="594" height="258"/>
                     <view key="contentView" id="KgU-86-iwk">
                         <rect key="frame" x="0.0" y="0.0" width="594" height="258"/>
@@ -78,7 +78,7 @@
                             <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="KMImageNameUXIconPropertybarFilePdf" id="eLO-Yq-M3q"/>
                         </imageView>
                         <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ddV-aD-Yah">
-                            <rect key="frame" x="54" y="132" width="40" height="17"/>
+                            <rect key="frame" x="54" y="132" width="241" height="17"/>
                             <textFieldCell key="cell" lineBreakMode="truncatingMiddle" alignment="left" title="Label" id="AYN-Fy-tcy">
                                 <font key="font" metaFont="system" size="14"/>
                                 <color key="textColor" name="KMGray6Color"/>
@@ -95,7 +95,7 @@
                         </textField>
                         <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Der-Qi-aoW">
                             <rect key="frame" x="93" y="109" width="35" height="15"/>
-                            <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="2AB-HF-4Ox">
+                            <textFieldCell key="cell" lineBreakMode="truncatingMiddle" title="Label" id="2AB-HF-4Ox">
                                 <font key="font" metaFont="cellTitle"/>
                                 <color key="textColor" red="0.39607843139999999" green="0.41176470590000003" blue="0.43921568630000002" alpha="1" colorSpace="calibratedRGB"/>
                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -112,7 +112,7 @@
                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="seD-7E-dp2">
                             <rect key="frame" x="349" y="109" width="100" height="40"/>
                             <subviews>
-                                <button translatesAutoresizingMaskIntoConstraints="NO" id="HSD-uO-oml" customClass="KMButton" customModule="PDF_Master" customModuleProvider="target">
+                                <button translatesAutoresizingMaskIntoConstraints="NO" id="HSD-uO-oml" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                     <rect key="frame" x="20" y="10" width="20" height="20"/>
                                     <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMimageNameUXIconHomeOpenfinderNor" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="3fQ-E6-5PX">
                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -126,7 +126,7 @@
                                         <action selector="showPathButtonAction:" target="-2" id="DOu-Nk-4jV"/>
                                     </connections>
                                 </button>
-                                <button translatesAutoresizingMaskIntoConstraints="NO" id="TFk-gH-WAn" customClass="KMButton" customModule="PDF_Master" customModuleProvider="target">
+                                <button translatesAutoresizingMaskIntoConstraints="NO" id="TFk-gH-WAn" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                     <rect key="frame" x="60" y="10" width="20" height="20"/>
                                     <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="KMImageNameUXIconHomeRemoveNor" imagePosition="overlaps" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="4WS-yy-x9P">
                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -153,6 +153,7 @@
                     </subviews>
                     <constraints>
                         <constraint firstItem="Der-Qi-aoW" firstAttribute="leading" secondItem="wId-sm-qtO" secondAttribute="trailing" constant="8" id="3Xx-1N-jxL"/>
+                        <constraint firstItem="wId-sm-qtO" firstAttribute="top" secondItem="ddV-aD-Yah" secondAttribute="bottom" constant="8" symbolic="YES" id="891-ew-t7d"/>
                         <constraint firstItem="WUP-W3-okM" firstAttribute="centerY" secondItem="0Mh-Sf-3a2" secondAttribute="centerY" id="Ek8-FQ-sYA"/>
                         <constraint firstItem="seD-7E-dp2" firstAttribute="centerY" secondItem="7sk-7M-lCI" secondAttribute="centerY" id="LQm-ap-hCm"/>
                         <constraint firstItem="0Mh-Sf-3a2" firstAttribute="leading" secondItem="7sk-7M-lCI" secondAttribute="leading" constant="16" id="NLG-Aa-oZ0"/>
@@ -162,6 +163,7 @@
                         <constraint firstAttribute="trailing" secondItem="WUP-W3-okM" secondAttribute="trailing" constant="16" id="ffA-da-LAi"/>
                         <constraint firstItem="0Mh-Sf-3a2" firstAttribute="centerY" secondItem="7sk-7M-lCI" secondAttribute="centerY" id="hSv-e3-grz"/>
                         <constraint firstItem="wId-sm-qtO" firstAttribute="bottom" secondItem="0Mh-Sf-3a2" secondAttribute="bottom" id="k8G-xK-sUx"/>
+                        <constraint firstAttribute="trailing" secondItem="ddV-aD-Yah" secondAttribute="trailing" constant="301" id="tfJ-y1-8jO"/>
                         <constraint firstItem="WUP-W3-okM" firstAttribute="leading" secondItem="seD-7E-dp2" secondAttribute="trailing" constant="24" id="w23-gi-JHt"/>
                         <constraint firstItem="ddV-aD-Yah" firstAttribute="top" secondItem="0Mh-Sf-3a2" secondAttribute="top" id="yC7-2n-C7a"/>
                     </constraints>

+ 19 - 20
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+Action.swift

@@ -1754,29 +1754,28 @@ extension KMHomeViewController {
         openPanel.allowsMultipleSelection = false
         openPanel.allowedFileTypes = ["pdf"]
         openPanel.beginSheetModal(for: NSApp.mainWindow!) { result in
-            if result == .cancel {
-                return
-            }
-            
-            if !openPanel.url!.path.isPDFValid() {
-                let alert = NSAlert()
-                alert.alertStyle = .critical
-                alert.messageText = NSLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.", comment: "")
-                alert.runModal()
-                return
-            }
-            
-            if let pdf = CPDFDocument(url: openPanel.url!) {
-                if pdf.allowsCopying == false || pdf.allowsPrinting == false {
-                    Task {
-                        _ = await KMAlertTool.runModel(message: KMLocalizedString("This is a secured document. Editing is not permitted.", nil))
-                    }
+            if result == .OK {
+                if !openPanel.url!.path.isPDFValid() {
+                    let alert = NSAlert()
+                    alert.alertStyle = .critical
+                    alert.messageText = NSLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.", comment: "")
+                    alert.runModal()
                     return
                 }
+                
+                if let pdf = CPDFDocument(url: openPanel.url!) {
+                    if pdf.allowsCopying == false || pdf.allowsPrinting == false {
+                        Task {
+                            _ = await KMAlertTool.runModel(message: KMLocalizedString("This is a secured document. Editing is not permitted.", nil))
+                        }
+                        return
+                    }
+                }
+                
+                let windowC = KMPDFEditWindowController(filepath: openPanel.url!.path, password: nil)
+//                windowC.startModal(nil)
+                windowC.showWindow(nil)
             }
-            
-            let windowC = KMPDFEditWindowController(filepath: openPanel.url!.path, password: nil)
-            windowC.startModal(nil)
         }
     }
     

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Watermark/New/View/KMWatermarkView.swift

@@ -764,7 +764,7 @@ extension KMWatermarkView {
             operateCallBack(self.watermark, currentType)
         }
         
-        self.cancelAction?(self)
+//        self.cancelAction?(self)
     }
     
     @IBAction func buttonClicked_Cancel(_ sender: Any) {

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/ViewController/KMAnnotationSelfSignViewController.swift

@@ -75,7 +75,7 @@ typealias KMAnnotationSelfSignViewControllerCallBack = (CAnnotationType) -> Void
             typeSelected(selfSignType)
 
             color = annotation!.lineColor
-            lineWidthSlider.floatValue = Float(annotation!.lineWidth())
+            lineWidthSlider.floatValue = Float(annotation!.lineAnnotationWidth)
             lineWidthComboBox.stringValue = String(format: "%.1f pt", lineWidthSlider.floatValue)
         } else {
             bottomView.isHidden = true

+ 5 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -4381,9 +4381,14 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                     }
                     
                     controller.operateCallBack = { [unowned self] controller, watermark, countType in
+                        self.view.window?.endSheet((self.currentWindowController.window)!)
+                        self.currentWindowController = nil
+                        
                         let file = KMFileAttribute()
                         file.filePath = (self.document?.documentURL.path)!
                         self.showBatchWindow(type: .AddWatermark, files: [file])
+                        
+
                     }
 //                    NSWindow.currentWindow().beginSheet(controller.window!)
                     NSWindow.currentWindow().beginSheet(controller.window!, completionHandler: nil)