Browse Source

【综合】解决冲突

tangchao 1 year ago
parent
commit
e751c319b8

+ 32 - 0
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -340,5 +340,37 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "B32D857B-3059-44B0-A24F-2AF4265B3FF1"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/Home/ViewController/KMHomeViewController+UI.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "244"
+            endingLineNumber = "244"
+            landmarkName = "_showConvertWindow(type:url:password:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "2657D455-420D-4030-8E7B-7ADA42DF7CC9"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/Batch/WindowController/Base/KMBatchOperateBaseViewController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "66"
+            endingLineNumber = "66"
+            landmarkName = "KMBatchOperateBaseViewController"
+            landmarkType = "3">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 1 - 1
PDF Office/PDF Master/Class/Analytics/KMAnalytics.swift

@@ -99,7 +99,7 @@ extension KMAnalytics.Parameter {
 
     // 发送事件
     static func trackEvent(eventName: String, parameters: [String : Any]? = nil, platform: KMAnalyticsPlatform = .firebase, appTarget: AppTarget = [.free]) {
-        Swift.debugPrint("trackEvent: \(eventName)")
+//        Swift.debugPrint("trackEvent: \(eventName)")
         
         if (appTarget.contains(.free)) {
 #if VERSION_FREE

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

@@ -299,7 +299,6 @@ extension KMHomeViewController {
     }
     
     func historyFileDeleteAction(_ indexPaths: [URL]) -> Void {
-//        NSDocumentController.shared.clearRecentDocuments(nil)
         let urls: Array<URL> = NSDocumentController.shared.recentDocumentURLs
         NSDocumentController.shared.clearRecentDocuments(nil)
         DispatchQueue.main.asyncAfter(deadline: .now()) { [self] in
@@ -311,7 +310,6 @@ extension KMHomeViewController {
             
             self.homeContentView.historyListView.reloadData()
         }
-//        historyFileViewController.reloadData()
     }
     
     func openHistoryFilePath(url: URL) -> Void {

+ 12 - 2
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift

@@ -194,8 +194,18 @@ import Cocoa
         }
         
         self.homeContentView.historyRemoveAllFileAction = { [unowned self] view in
-            let urls: Array<URL> = NSDocumentController.shared.recentDocumentURLs
-            self.historyFileDeleteAction(urls)
+            let alert = NSAlert()
+            alert.alertStyle = .critical
+            alert.messageText = String(format: "%@?", NSLocalizedString("Clear All Recents", comment: ""))
+            alert.addButton(withTitle: NSLocalizedString("Delete", comment: ""))
+            alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
+
+            alert.beginSheetModal(for: self.view.window!) { response in
+                if response == .alertFirstButtonReturn {
+                    let urls: Array<URL> = NSDocumentController.shared.recentDocumentURLs
+                    self.historyFileDeleteAction(urls)
+                }
+            }
         }
         
         //quciktools

+ 4 - 4
PDF Office/PDF Master/Class/KMAdvertisement/View/Tableview/Cell/KMAdvertisementCollectionHeadView.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -14,8 +14,8 @@
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
                 <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DuE-Mw-GiV">
-                    <rect key="frame" x="6" y="7" width="37" height="16"/>
-                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="KZj-T6-HnW">
+                    <rect key="frame" x="6" y="7" width="4" height="16"/>
+                    <textFieldCell key="cell" lineBreakMode="clipping" id="KZj-T6-HnW">
                         <font key="font" usesAppearanceFont="YES"/>
                         <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>

+ 3 - 3
PDF Office/PDF Master/Class/PDFTools/Convert/Controller/KMConvertImageWindowController.xib

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMConvertImageWindowController" customModule="PDF_Office" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMConvertImageWindowController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
             </connections>

+ 2 - 1
PDF Office/PDF Master/Class/PDFTools/Convert/ExtractImage/Controller/KMExtractImageWindowController.swift

@@ -87,7 +87,8 @@ class KMExtractImageWindowController: NSWindowController,PDFConvertObjectDelegat
         } else {
             self.doublePageButton.isEnabled = true
         }
-        
+        self.preViewPDFView.setDisplay(.singlePage)
+        self.preViewPDFView.layoutDocumentView()
         NotificationCenter.default.addObserver(self, selector: #selector(pageChangeNotification(notification:)), name: NSNotification.Name.PDFViewPageChanged, object: self.preViewPDFView)
     }
     func selectCurrentPageBtn() {

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

@@ -223,15 +223,13 @@ class KMConvertWindowController: NSWindowController, NSTextFieldDelegate, NSWind
     }
     func configuView() {
         self.prePDFView.autoScales = true
-        
-        self.prePDFView.setDisplay(.singlePage)
         self.prePDFView.wantsLayer = true
         self.prePDFView.document = self.pdfDocument
         self.imageDPISelectButton.removeAllItems()
         self.formatSelectButton.removeAllItems()
         
         let dpiArray = ["50 dpi", "72 dpi", "96 dpi", "150 dpi", "300 dpi", "600 dpi"]
-        var formArray = ["Excel (.xlsx)", "PowerPoint (.pptx)", "RTF (.rtf)", "CSV (.csv)", "Html (.html)", "Text (.txt)", "JPEG (.jpeg)", "JPG (.jpg)", "PNG (.png)", "GIF (.gif)", "TIFF (.tiff)", "TGA (.tga)", "BMP (.bmp)", "JPEG-2000 (.jp2)"]
+        let formArray = ["Excel (.xlsx)", "PowerPoint (.pptx)", "RTF (.rtf)", "CSV (.csv)", "Html (.html)", "Text (.txt)", "JPEG (.jpeg)", "JPG (.jpg)", "PNG (.png)", "GIF (.gif)", "TIFF (.tiff)", "TGA (.tga)", "BMP (.bmp)", "JPEG-2000 (.jp2)"]
         
         for (index, string) in formArray.enumerated() {
             let item = NSMenuItem()
@@ -380,6 +378,8 @@ class KMConvertWindowController: NSWindowController, NSTextFieldDelegate, NSWind
             }
             self.prePDFView.document = self.pdfDocument
         }
+        self.prePDFView.setDisplay(.singlePage)
+        self.prePDFView.layoutDocumentView()
     }
     func updataView() {
         var moreLabelString: String = ""

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

@@ -90,7 +90,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="ioL-gH-agJ">
                                 <rect key="frame" x="155" y="10" width="56" height="22"/>
                                 <subviews>
-                                    <textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SOc-Qh-Bb7">
+                                    <textField focusRingType="none" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SOc-Qh-Bb7">
                                         <rect key="frame" x="0.0" y="0.0" width="40" height="22"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="22" id="3Jq-m9-DeQ"/>
@@ -105,7 +105,7 @@
                                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                         </textFieldCell>
                                     </textField>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="z3E-2c-R0k">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="z3E-2c-R0k">
                                         <rect key="frame" x="38" y="3" width="20" height="16"/>
                                         <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="/ 0" id="DYY-wZ-Qj3">
                                             <font key="font" metaFont="system"/>
@@ -149,7 +149,7 @@
                             <rect key="frame" x="0.0" y="0.0" width="320" height="106"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <subviews>
-                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="A06-uc-UOW">
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="A06-uc-UOW">
                                     <rect key="frame" x="8" y="90" width="47" height="16"/>
                                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Format" id="I6C-fa-6mM">
                                         <font key="font" metaFont="system"/>
@@ -214,7 +214,7 @@
                                                     <constraint firstAttribute="width" constant="20" id="uhJ-3t-Ju2"/>
                                                 </constraints>
                                             </button>
-                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ckr-Wn-5Tf">
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ckr-Wn-5Tf">
                                                 <rect key="frame" x="23" y="0.0" width="279" height="34"/>
                                                 <textFieldCell key="cell" title="Export PDF to Word and other Microsoft Office formats" id="sBS-zf-jgA">
                                                     <font key="font" metaFont="system"/>
@@ -350,7 +350,7 @@ Gw
                                         <action selector="buttonClicked_PageSelect:" target="-2" id="GvJ-gr-WLP"/>
                                     </connections>
                                 </button>
-                                <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="y8I-4d-Yvk">
+                                <textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="y8I-4d-Yvk">
                                     <rect key="frame" x="24" y="10" width="154" height="21"/>
                                     <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="bpr-eQ-jls">
                                         <font key="font" metaFont="system"/>
@@ -543,7 +543,7 @@ Gw
                             <action selector="buttonClicked_extractTable:" target="-2" id="0No-NT-2vF"/>
                         </connections>
                     </button>
-                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hQ6-L6-IW2">
+                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hQ6-L6-IW2">
                         <rect key="frame" x="379" y="314" width="37" height="16"/>
                         <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="8X0-Hn-fJf">
                             <font key="font" metaFont="system"/>

+ 1 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -1439,7 +1439,6 @@ class KMLeftSideViewController: KMSideViewController {
     }
     
     @objc func leftSideEmptyAnnotationClick_DeleteOutline(_ sender: AnyObject?) {
-        KMPrint("leftSideEmptyAnnotationClick_DeleteOutline")
         let alert = NSAlert()
         alert.alertStyle = .critical
         alert.messageText = ""
@@ -2308,7 +2307,7 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
     }
     
     func tableViewSelectionIsChanging(_ notification: Notification) {
-        KMPrint(self.thumbnailTableView.selectedRowIndexes)
+        
     }
     func tableViewSelectionDidChange(_ notification: Notification) {
 //        if ([[aNotification object] isEqual:leftSideController.findTableView] || [[aNotification object] isEqual:leftSideController.groupedFindTableView]) {
@@ -3708,7 +3707,6 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
                 }
             }
             cell.isUnFoldNote = { [unowned self] cellNote, isUnfold in
-                KMPrint(cell)
                 model.foldType = isUnfold ? .unfold : .fold
 //                let COLUMN_INDENTATION: CGFloat = 16
 //                if let _cell = tableColumn?.dataCell as? NSCell {

+ 3 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/KMRightSideEmptyVC.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22155" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22155"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -25,7 +25,7 @@
                         <customView translatesAutoresizingMaskIntoConstraints="NO" id="6q6-Ub-zoO">
                             <rect key="frame" x="0.0" y="0.0" width="168" height="40"/>
                             <subviews>
-                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cwY-ba-Aw0">
+                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cwY-ba-Aw0">
                                     <rect key="frame" x="-2" y="0.0" width="172" height="32"/>
                                     <textFieldCell key="cell" alignment="center" title="Label" id="o6y-4P-ieZ">
                                         <font key="font" usesAppearanceFont="YES"/>

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Toolbar/KMToolbarItemView.swift

@@ -195,7 +195,7 @@ extension KMToolbarItemView {
     private var _originalHelpTip: String?
     
     deinit {
-        Swift.debugPrint("KMToolbarItemView deinit")
+//        Swift.debugPrint("KMToolbarItemView deinit")
         NotificationCenter.default.removeObserver(self)
     }
     

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

@@ -2085,37 +2085,37 @@ extension KMMainViewController {
             KMPrint("转档窗口已显示")
             return
         }
-//        var convertT: KMConvertType = .Word
-//        var windowController: KMConvertBaseWindowController?
-//        if (type == .word) { /// Word
-//            convertT = .Word
-//        } else if (type == .excel) {
-//            convertT = .Excel
-//        } else if (type == .ppt || type == .rtf || type == .html || type == .conversion_text) {
-//            if (type == .ppt) {
-//                convertT = .PPT
-//            } else if (type == .rtf) {
-//                convertT = .RTF
-//            } else if (type == .html) {
-//                convertT = .HTML
-//            } else if (type == .conversion_text) {
-//                convertT = .Text
-//            }
-//        } else if (type == .csv) {
-//            convertT = .CSV
-//        } else if (type == .conversion_image) {
-//            windowController = KMConvertImageWindowController()
-//        }
-//        windowController?.subscribeWaterMarkType = type.toSubscribeWaterMarkType()
-//
-//        var url: URL?
-//        if (documentUrl != nil) {
-//            url = documentUrl
-//            windowController?.oriDocumentUrl = self.listView.document.documentURL
-//        } else {
-//            url = self.listView.document.documentURL
-//        }
-//        self.showAllConvertWindow(convertT: convertT)
+        var convertT: KMConvertType = .Word
+        var windowController: KMConvertBaseWindowController?
+        if (type == .word) { /// Word
+            convertT = .Word
+        } else if (type == .excel) {
+            convertT = .Excel
+        } else if (type == .ppt || type == .rtf || type == .html || type == .conversion_text) {
+            if (type == .ppt) {
+                convertT = .PPT
+            } else if (type == .rtf) {
+                convertT = .RTF
+            } else if (type == .html) {
+                convertT = .HTML
+            } else if (type == .conversion_text) {
+                convertT = .Text
+            }
+        } else if (type == .csv) {
+            convertT = .CSV
+        } else if (type == .conversion_image) {
+            windowController = KMConvertImageWindowController()
+        }
+        windowController?.subscribeWaterMarkType = type.toSubscribeWaterMarkType()
+        
+        var url: URL?
+        if (documentUrl != nil) {
+            url = documentUrl
+            windowController?.oriDocumentUrl = self.listView.document.documentURL
+        } else {
+            url = self.listView.document.documentURL
+        }
+        self.showAllConvertWindow(convertT: convertT)
         
 //        let model = KMDocumentModel(url: url!)
 //        if (self.listView.document.password != nil) {
@@ -2301,7 +2301,7 @@ extension KMMainViewController {
         let extract = KMExtractImageWindowController(windowNibName: "KMExtractImageWindowController")
         extract.docPath = fileURL?.path ?? ""
         extract.password = document?.password ?? ""
-        extract.currentPage = self.listView.currentPageIndex - 1
+        extract.currentPage = self.listView.currentPageIndex
 //        extract.beginSheetModal(for: NSApp.mainWindow!, completionHandler: nil)
         self.km_beginSheet(windowC: extract)
         extract.selectCurrentPageBtn()