Browse Source

【综合】
1. 偏好设置重置修正
2. 标记密文涂白支持修改
3. 转档界面增加引导按钮
4. 插入页面位置调整

niehaoyu 8 months ago
parent
commit
8fa8784330

+ 5 - 1
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMConvertWindowController.swift

@@ -70,7 +70,7 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
     @IBOutlet var box: NSBox!
     
     @IBOutlet var autoCreateFolderBtn: NSButton!
-    
+    @IBOutlet var autoCreateGuideBtn: NSButton!
     
     var isAllInOneSheet = false
     var modalSession: NSApplication.ModalSession?
@@ -526,6 +526,10 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
         }
         
         buttonBottemOffset.constant = offset
+        
+        self.autoCreateGuideBtn.isHidden = self.autoCreateFolderBtn.isHidden
+         
+        
     }
     
     @IBAction func buttonClicked_extractTable(_ sender: NSButton) {

+ 10 - 0
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMConvertWindowController.xib

@@ -14,6 +14,7 @@
                 <outlet property="allContentMenu3" destination="yYm-Qc-Owk" id="DcX-Tq-7QJ"/>
                 <outlet property="allPageButton" destination="i6b-xc-EnV" id="kcK-qQ-pQl"/>
                 <outlet property="autoCreateFolderBtn" destination="cZt-Q3-8Lg" id="f8O-hS-1az"/>
+                <outlet property="autoCreateGuideBtn" destination="Gap-26-ZYO" id="0p5-Jw-Zbf"/>
                 <outlet property="batchButton" destination="Qt9-t5-iOv" id="4Uk-ND-9cb"/>
                 <outlet property="box" destination="jUW-ZO-oLT" id="G2S-bv-4H8"/>
                 <outlet property="buttonBottemOffset" destination="038-Ye-5oH" id="rJL-zQ-c99"/>
@@ -396,6 +397,13 @@ Gw
                             <font key="font" metaFont="system"/>
                         </buttonCell>
                     </button>
+                    <button horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Gap-26-ZYO">
+                        <rect key="frame" x="658" y="20" width="18" height="19"/>
+                        <buttonCell key="cell" type="help" bezelStyle="helpButton" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="GVI-X9-M8T">
+                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                            <font key="font" metaFont="smallSystem"/>
+                        </buttonCell>
+                    </button>
                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rXb-T4-yMb">
                         <rect key="frame" x="75" y="7" width="87" height="32"/>
                         <buttonCell key="cell" type="push" title="Upgrade" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="PUQ-iR-bff">
@@ -568,6 +576,7 @@ Gw
                     <constraint firstItem="UPM-vO-BAb" firstAttribute="leading" secondItem="9e4-ci-JPQ" secondAttribute="trailing" constant="16" id="BJP-lY-vqA"/>
                     <constraint firstItem="jUW-ZO-oLT" firstAttribute="top" secondItem="3if-Xs-8Lv" secondAttribute="bottom" constant="125" id="BVR-t4-M1Y"/>
                     <constraint firstItem="jUW-ZO-oLT" firstAttribute="trailing" secondItem="aGQ-OF-WXB" secondAttribute="trailing" id="DZm-em-mgb"/>
+                    <constraint firstItem="Gap-26-ZYO" firstAttribute="leading" secondItem="cZt-Q3-8Lg" secondAttribute="trailing" constant="5" id="FTu-o6-zwV"/>
                     <constraint firstItem="R2E-0y-EaA" firstAttribute="top" secondItem="3if-Xs-8Lv" secondAttribute="bottom" constant="25" id="Ge2-Ei-w2S"/>
                     <constraint firstItem="hQ6-L6-IW2" firstAttribute="leading" secondItem="9e4-ci-JPQ" secondAttribute="trailing" constant="16" id="HHE-ga-88s"/>
                     <constraint firstItem="9e4-ci-JPQ" firstAttribute="width" secondItem="se5-gp-TjO" secondAttribute="width" multiplier="0.5" id="I64-jc-VDF"/>
@@ -586,6 +595,7 @@ Gw
                     <constraint firstItem="aGQ-OF-WXB" firstAttribute="top" secondItem="3if-Xs-8Lv" secondAttribute="bottom" constant="25" id="XBe-5E-DOQ"/>
                     <constraint firstItem="9e4-ci-JPQ" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="Xkp-aI-WHZ"/>
                     <constraint firstItem="R2E-0y-EaA" firstAttribute="trailing" secondItem="aGQ-OF-WXB" secondAttribute="trailing" id="b9n-uX-rA6"/>
+                    <constraint firstItem="Gap-26-ZYO" firstAttribute="centerY" secondItem="cZt-Q3-8Lg" secondAttribute="centerY" id="bcr-OO-TX5"/>
                     <constraint firstItem="Qt9-t5-iOv" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="20" id="n3y-XG-Jvq"/>
                     <constraint firstItem="jUW-ZO-oLT" firstAttribute="leading" secondItem="9e4-ci-JPQ" secondAttribute="trailing" constant="5" id="r28-fG-4si"/>
                     <constraint firstItem="rXb-T4-yMb" firstAttribute="leading" secondItem="Qt9-t5-iOv" secondAttribute="trailing" constant="7" id="sHg-nI-I4r"/>

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

@@ -1194,7 +1194,7 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
 //                    self.choosePositionWindow {[weak self] index in
 //                        /// 插入位置
                         if let imag = NSImage(contentsOfFile: fileURL.path ) {
-                            let index = self.getInsertIndex()
+                            let index = self.getInsertIndex() + 1
                             let document = CPDFDocument()
                             _ = document?.km_insertPage(imag.size, withImage: fileURL.path , at: 0)
                             if let page: CPDFPage = (document?.page(at: 0)) {
@@ -1236,7 +1236,7 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
             guard let document: CPDFDocument = self.openDocumentWithImageFromPasteboard(NSPasteboard.general, error: &error) else {
                 return
             }
-        let index = self.getInsertIndex()
+        let index = self.getInsertIndex() + 1
             if let page: CPDFPage = (document.page(at: 0)) {
                 self.insertPages(pages: [page], at: IndexSet(integer: index))
             }
@@ -1297,13 +1297,13 @@ class KMPDFEditViewController: KMPDFThumbViewBaseController {
 //            self?.choosePositionWindow {[weak self] index in
                 /// 插入位置
                 if let imag = NSImage(contentsOfFile: url.path! ) {
-                    let index = self?.getInsertIndex()
+                    let index = (self?.getInsertIndex())! + 1
                     let document = CPDFDocument()
                     _ = document?.km_insertPage(imag.size, withImage: url.path! , at: 0)
                     if let page: CPDFPage = (document?.page(at: 0)) {
-                        self?.insertPages(pages: [page], at: IndexSet(integer: index!))
+                        self?.insertPages(pages: [page], at: IndexSet(integer: index))
                     }
-                    let ips: Set<IndexPath> = [IndexPath(item: index!, section: 0)]
+                    let ips: Set<IndexPath> = [IndexPath(item: index, section: 0)]
                     self?.thumbnailView.collectionView.scrollToItems(at: ips, scrollPosition: .centeredVertically)
                 }
 //            }

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Redact/View/KMRedactPDFView.swift

@@ -117,7 +117,7 @@ private let KMPDFViewRedactAnnotationAcross = "KMPDFViewRedactAnnotationAcross"
         let page = self.pageAndPoint(&pagePoint, for: event, nearest: true)
 //        CPDFAnnotation *annotation = [page annotationAtPoint:pagePoint];
         let annotation = page?.annotation(at: pagePoint)
-        if let data = annotation, data is CPDFRedactAnnotation && self.operationType == .redact {
+        if let data = annotation, data is CPDFRedactAnnotation && (self.operationType == .redact || self.operationType == .redactWhite)  {
             var item = menu?.insertItem(withTitle: KMLocalizedString("Delete", nil), action: #selector(deleteAnnotation), target: self, at: 0)
             item?.representedObject = annotation
             menu?.insertItem(.separator(), at: 1)

+ 1 - 1
PDF Office/PDF Master/Class/Preference/Controller/IdentifyPreferense.xib

@@ -130,7 +130,7 @@
                                 </textField>
                                 <textField toolTip="Enter the command to call your favorite TeX editor" focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bwL-mz-h56">
                                     <rect key="frame" x="141" y="5" width="274" height="21"/>
-                                    <textFieldCell key="cell" lineBreakMode="truncatingMiddle" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" drawsBackground="YES" id="ARA-Mm-Ahm">
+                                    <textFieldCell key="cell" lineBreakMode="truncatingMiddle" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="ARA-Mm-Ahm">
                                         <font key="font" metaFont="system"/>
                                         <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>

+ 21 - 13
PDF Office/PDF Master/Class/Preference/Window/KMPreferenceController.swift

@@ -275,22 +275,30 @@ extension KMPreferenceController {
         if (returnCode == NSApplication.ModalResponse.alertFirstButtonReturn.rawValue) {
             if let initialUserDefaultsURL = Bundle.main.url(forResource: INITIALUSERDEFAULTS_KEY, withExtension: "plist") {
                 if let _currentPane = self.currentPane as? NSViewController {
-                let resettableKeys = (NSDictionary(contentsOf: initialUserDefaultsURL)?.object(forKey: RESETTABLEKEYS_KEY) as? NSDictionary)?.object(forKey: _currentPane.nibName ?? "")
-                if let data = resettableKeys as? [String] {
-                    NSUserDefaultsController.shared.revertToInitialValues(forKeys: data)
-                }
-                self.currentPane?.defaultsDidRevert?()
-                
-                if _currentPane is KMGeneralPreferences {
-                    KMPreference.shared.resetData(.general)
-                } else if _currentPane is KMDisplayPreferences {
-                    KMPreference.shared.resetData(.display)
-                } else if _currentPane is KMNotesPreferences {
-                    KMPreference.shared.resetData(.markup)
+                    let resettableKeys = (NSDictionary(contentsOf: initialUserDefaultsURL)?.object(forKey: RESETTABLEKEYS_KEY) as? NSDictionary)?.object(forKey: _currentPane.nibName ?? "")
+                    if let data = resettableKeys as? [String] {
+                        NSUserDefaultsController.shared.revertToInitialValues(forKeys: data)
+                    }
+                    self.currentPane?.defaultsDidRevert?()
+                    
+                    if _currentPane is KMGeneralPreferences {
+                        KMPreference.shared.resetData(.general)
+                    } else if _currentPane is KMDisplayPreferences {
+                        KMPreference.shared.resetData(.display)
+                    } else if _currentPane is KMNotesPreferences {
+                        KMPreference.shared.resetData(.markup)
+                    } else if _currentPane is IdentifyPreferense {
+                        KMProfileInfo.shared().fullName = ""
+                        KMProfileInfo.shared().headName = ""
+                        KMProfileInfo.shared().OrganizeName = ""
+                        KMProfileInfo.shared().OrganizePart = ""
+                        KMProfileInfo.shared().email = ""
+                        
+                        self.currentPane?.defaultsDidRevert?()
+                    }
                 }
             }
         }
-        }
     }
 }