Преглед на файлове

【综合】文件菜单去除之前的功能窗口

tangchao преди 1 година
родител
ревизия
52f93016c3

+ 16 - 80
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -260,86 +260,6 @@
             </Locations>
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "017D8E63-C59C-474C-8D86-56EABCF89CEF"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "514"
-            endingLineNumber = "514"
-            landmarkName = "openBlankPage(_:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "C7D5FAD7-6212-42AC-9A70-C8237FF4EB89"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "559"
-            endingLineNumber = "559"
-            landmarkName = "screenShot_FullScreenDelay(_:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "A7EA912F-FD84-4D3F-B327-D44A1EC37889"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "547"
-            endingLineNumber = "547"
-            landmarkName = "importFromWebPage(_:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "C26F29DC-2234-4254-AF30-35AE492835DD"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "544"
-            endingLineNumber = "544"
-            landmarkName = "newDocumetFromImage(_:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "A82F3388-A61A-4717-B375-568DAD4759AC"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/ChromiumTabs/KMBrowserWindowController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "541"
-            endingLineNumber = "541"
-            landmarkName = "newDocumentFromClipboard(_:)"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
@@ -420,5 +340,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "8AFE4AA4-706E-487D-AB7C-C3F6334DDCD7"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFTools/Merge/OCPart/KMPDFEditAppendWindow.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "222"
+            endingLineNumber = "222"
+            landmarkName = "-initWithFilePaths:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

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

@@ -539,7 +539,7 @@ extension KMBrowserWindowController {
     @IBAction func newDocumentFromClipboard(_ sender: Any?) {
         KMPrint("newDocumentFromClipboard")
     }
-    @IBAction func newDocumetFromImage(_ sender: Any?) {
+    @IBAction func newDocumentFromImage(_ sender: Any?) {
         KMPrint("importFromWebPage")
     }
     @IBAction func importFromWebPage(_ sender: Any?) {

+ 25 - 25
PDF Office/PDF Master/Class/Document/KMDocumentController.swift

@@ -98,31 +98,31 @@ class KMDocumentController: NSDocumentController {
     }
 
     @IBAction func newDocumentFromImage(_ sender: Any) {
-        let openPanel = NSOpenPanel()
-        openPanel.allowedFileTypes = KMImageAccessoryController.supportedImageTypes()
-        openPanel.allowsMultipleSelection = true
-        openPanel.message = NSLocalizedString("Select images to create a new document. To select multiple files press cmd ⌘ button on keyboard and click on the target files one by one.", comment: "")
-        openPanel.beginSheetModal(for: NSApp.mainWindow!) { response in
-            let savePath = self.kNewDocumentTempSavePath("convertToPDF.pdf")
-            if response == .OK {
-                KMConvertPDFManager.convertImages(openPanel.urls, savePath: savePath) { success, errorDic in
-                    if !success || !FileManager.default.fileExists(atPath: savePath) {
-                        if FileManager.default.fileExists(atPath: savePath) {
-                            try? FileManager.default.removeItem(atPath: savePath)
-                        }
-                        
-                        let alert = NSAlert()
-                        alert.alertStyle = .critical
-                        alert.messageText = NSLocalizedString("Conversion Failed", comment: "")
-                        alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
-                        alert.runModal()
-                        return
-                    }
-                    self.savePdf(savePath)
-                    try? FileManager.default.removeItem(atPath: savePath)
-                }
-            }
-        }
+//        let openPanel = NSOpenPanel()
+//        openPanel.allowedFileTypes = KMImageAccessoryController.supportedImageTypes()
+//        openPanel.allowsMultipleSelection = true
+//        openPanel.message = NSLocalizedString("Select images to create a new document. To select multiple files press cmd ⌘ button on keyboard and click on the target files one by one.", comment: "")
+//        openPanel.beginSheetModal(for: NSApp.mainWindow!) { response in
+//            let savePath = self.kNewDocumentTempSavePath("convertToPDF.pdf")
+//            if response == .OK {
+//                KMConvertPDFManager.convertImages(openPanel.urls, savePath: savePath) { success, errorDic in
+//                    if !success || !FileManager.default.fileExists(atPath: savePath) {
+//                        if FileManager.default.fileExists(atPath: savePath) {
+//                            try? FileManager.default.removeItem(atPath: savePath)
+//                        }
+//
+//                        let alert = NSAlert()
+//                        alert.alertStyle = .critical
+//                        alert.messageText = NSLocalizedString("Conversion Failed", comment: "")
+//                        alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+//                        alert.runModal()
+//                        return
+//                    }
+//                    self.savePdf(savePath)
+//                    try? FileManager.default.removeItem(atPath: savePath)
+//                }
+//            }
+//        }
     }
     
     @IBAction func importFromWebPage(_ sender: Any) {

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

@@ -911,21 +911,21 @@ extension KMHomeViewController {
     }
     
     func km_open_pdf_merge() {
-        DispatchQueue.main.async {
-            NSPanel.km_open_pdf_multi_success(self.view.window!, panel: nil) { urls in
-                DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
-                    var filepaths: Array<String> = []
-                    for url in urls {
-                        filepaths.append(url.path)
-                    }
-                    let windowController = KMPDFEditAppendWindow(filePaths: filepaths)
-                    self.currentWindowController = windowController
-                    windowController?.beginSheetModal(for: self.view.window, completionHandler: { result, indexs in
-                        
-                    })
-                }
-            }
-        }
+//        DispatchQueue.main.async {
+//            NSPanel.km_open_pdf_multi_success(self.view.window!, panel: nil) { urls in
+//                DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
+//                    var filepaths: Array<String> = []
+//                    for url in urls {
+//                        filepaths.append(url.path)
+//                    }
+//                    let windowController = KMPDFEditAppendWindow(filePaths: filepaths)
+//                    self.currentWindowController = windowController
+//                    windowController?.beginSheetModal(for: self.view.window, completionHandler: { result, indexs in
+//
+//                    })
+//                }
+//            }
+//        }
     }
     
     func fastTool_Compression() {   // 压缩
@@ -958,33 +958,33 @@ extension KMHomeViewController {
     }
     
     func showCompressWindow(_ url: URL, _ password: String?) {
-        Task { @MainActor in
-            let windowController = KMCompressWindowController(windowNibName: "KMCompressWindowController")
-            windowController.documentURL = url
-            windowController.password = password
-            
-            windowController.itemClick = { [weak self] _ in
-                self?.km_endSheet()
-            }
-            
-            windowController.resultCallback = { [weak self] result, openDocument, fileURL, _ in
-                if result {
-                    self?.km_endSheet()
-                    if openDocument {
-                        NSDocumentController.shared.km_safe_openDocument(withContentsOf: fileURL, display: true) { _, _, _ in
-                            
-                        }
-                    } else {
-                        NSWorkspace.shared.activateFileViewerSelecting([fileURL])
-                    }
-                } else {
-                    let alert = NSAlert()
-                    alert.messageText = NSLocalizedString("Compress Faild", comment: "")
-                    alert.runModal()
-                }
-            }
-            self.km_beginSheet(windowC: windowController)
-        }
+//        Task { @MainActor in
+//            let windowController = KMCompressWindowController(windowNibName: "KMCompressWindowController")
+//            windowController.documentURL = url
+//            windowController.password = password
+//            
+//            windowController.itemClick = { [weak self] _ in
+//                self?.km_endSheet()
+//            }
+//            
+//            windowController.resultCallback = { [weak self] result, openDocument, fileURL, _ in
+//                if result {
+//                    self?.km_endSheet()
+//                    if openDocument {
+//                        NSDocumentController.shared.km_safe_openDocument(withContentsOf: fileURL, display: true) { _, _, _ in
+//                            
+//                        }
+//                    } else {
+//                        NSWorkspace.shared.activateFileViewerSelecting([fileURL])
+//                    }
+//                } else {
+//                    let alert = NSAlert()
+//                    alert.messageText = NSLocalizedString("Compress Faild", comment: "")
+//                    alert.runModal()
+//                }
+//            }
+//            self.km_beginSheet(windowC: windowController)
+//        }
     }
     
     func fastTool_Security() {  // 安全

+ 84 - 84
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+UI.swift

@@ -207,93 +207,93 @@ extension KMHomeViewController {
     // MARK: - Private Methods
     
     fileprivate func _showConvertWindow(type: KMPDFConvertType, url: URL, password: String? = nil) {
-        var windowController: KMConvertBaseWindowController?
-        if (type == .word) { /// Word
-            windowController = KMConvertWordWindowController()
-        } else if (type == .excel) {
-            windowController = KMConvertExcelWindowController()
-        } else if (type == .ppt || type == .rtf || type == .html || type == .text) {
-            windowController = KMConvertPPTsWindowController()
-            if (type == .ppt) {
-                windowController?.subType = 1
-            } else if (type == .rtf) {
-                windowController?.subType = 2
-            } else if (type == .html) {
-                windowController?.subType = 3
-            } else if (type == .text) {
-                windowController?.subType = 4
-            }
-        } else if (type == .csv) {
-            windowController = KMConvertCSVWindowController()
-        } else if (type == .image) {
-            windowController = KMConvertImageWindowController()
-        }
-        windowController?.subscribeWaterMarkType = type.toSubscribeWaterMarkType()
-        
-        let model = KMDocumentModel(url: url)
-        if (password != nil) {
-            let _ = model.unlock(password!)
-        }
-        windowController?.documentModel = model
-        
-        windowController?.itemClick = { [weak self] _ in
-            self?.km_endSheet()
-        }
-        
-        self.km_safe_beginSheet(windowC: windowController)
+//        var windowController: KMConvertBaseWindowController?
+//        if (type == .word) { /// Word
+//            windowController = KMConvertWordWindowController()
+//        } else if (type == .excel) {
+//            windowController = KMConvertExcelWindowController()
+//        } else if (type == .ppt || type == .rtf || type == .html || type == .text) {
+//            windowController = KMConvertPPTsWindowController()
+//            if (type == .ppt) {
+//                windowController?.subType = 1
+//            } else if (type == .rtf) {
+//                windowController?.subType = 2
+//            } else if (type == .html) {
+//                windowController?.subType = 3
+//            } else if (type == .text) {
+//                windowController?.subType = 4
+//            }
+//        } else if (type == .csv) {
+//            windowController = KMConvertCSVWindowController()
+//        } else if (type == .image) {
+//            windowController = KMConvertImageWindowController()
+//        }
+//        windowController?.subscribeWaterMarkType = type.toSubscribeWaterMarkType()
+//        
+//        let model = KMDocumentModel(url: url)
+//        if (password != nil) {
+//            let _ = model.unlock(password!)
+//        }
+//        windowController?.documentModel = model
+//        
+//        windowController?.itemClick = { [weak self] _ in
+//            self?.km_endSheet()
+//        }
+//        
+//        self.km_safe_beginSheet(windowC: windowController)
     }
     
     fileprivate func _showSecurityWindow(url: URL, password: String?, limit: Bool = false) {  // 安全
-        let windowC = KMSecureEncryptWindowController(windowNibName: "KMSecureEncryptWindowController")
-        windowC.documentURL = url
-        windowC.myDocument = CPDFDocument(url: url)
-        if let _password = password {
-            windowC.myDocument.unlock(withPassword: _password)
-        }
-        
-        let newDocument: CPDFDocument = CPDFDocument(url: url)
-        windowC.itemClick = { [weak self] _ in
-            self?.km_endSheet()
-        }
-        
-        windowC.resultCallback = { [weak self] _ in
-            let windowController_secure: KMSecureEncryptWindowController = self?.kmCurrentWindowC as! KMSecureEncryptWindowController
-            self?.km_endSheet()
-            if let _password = password {
-                newDocument.unlock(withPassword: _password)
-            }
-            
-            if (!limit) {
-                newDocument.setPasswordOptions(windowController_secure.options)
-                let result = KMPasswordInputWindow.saveDocument(newDocument)
-                if result {
-                    NSWorkspace.shared.activateFileViewerSelecting([newDocument.documentURL])
-                } else {
-                    let alert = NSAlert()
-                    alert.messageText = NSLocalizedString("Failure", comment: "")
-                    alert.runModal()
-                }
-                return
-            }
-            
-            NSPanel.savePanel((self?.view.window)!, panel: { panel in
-                panel.nameFieldStringValue = url.lastPathComponent
-            }) { response, saveUrl in
-                if (response == .cancel) {
-                    return
-                }
-                
-                if let fileUrl = KMTools.saveWatermarkDocument(document: newDocument, to: saveUrl!, secureOptions: windowController_secure.options) {
-                    NSWorkspace.shared.activateFileViewerSelecting([fileUrl])
-                } else {
-                    let alert = NSAlert()
-                    alert.messageText = NSLocalizedString("Failure", comment: "")
-                    alert.runModal()
-                }
-            }
-        }
-        
-        self.km_beginSheet(windowC: windowC)
+//        let windowC = KMSecureEncryptWindowController(windowNibName: "KMSecureEncryptWindowController")
+//        windowC.documentURL = url
+//        windowC.myDocument = CPDFDocument(url: url)
+//        if let _password = password {
+//            windowC.myDocument.unlock(withPassword: _password)
+//        }
+//        
+//        let newDocument: CPDFDocument = CPDFDocument(url: url)
+//        windowC.itemClick = { [weak self] _ in
+//            self?.km_endSheet()
+//        }
+//        
+//        windowC.resultCallback = { [weak self] _ in
+//            let windowController_secure: KMSecureEncryptWindowController = self?.kmCurrentWindowC as! KMSecureEncryptWindowController
+//            self?.km_endSheet()
+//            if let _password = password {
+//                newDocument.unlock(withPassword: _password)
+//            }
+//            
+//            if (!limit) {
+//                newDocument.setPasswordOptions(windowController_secure.options)
+//                let result = KMPasswordInputWindow.saveDocument(newDocument)
+//                if result {
+//                    NSWorkspace.shared.activateFileViewerSelecting([newDocument.documentURL])
+//                } else {
+//                    let alert = NSAlert()
+//                    alert.messageText = NSLocalizedString("Failure", comment: "")
+//                    alert.runModal()
+//                }
+//                return
+//            }
+//            
+//            NSPanel.savePanel((self?.view.window)!, panel: { panel in
+//                panel.nameFieldStringValue = url.lastPathComponent
+//            }) { response, saveUrl in
+//                if (response == .cancel) {
+//                    return
+//                }
+//                
+//                if let fileUrl = KMTools.saveWatermarkDocument(document: newDocument, to: saveUrl!, secureOptions: windowController_secure.options) {
+//                    NSWorkspace.shared.activateFileViewerSelecting([fileUrl])
+//                } else {
+//                    let alert = NSAlert()
+//                    alert.messageText = NSLocalizedString("Failure", comment: "")
+//                    alert.runModal()
+//                }
+//            }
+//        }
+//        
+//        self.km_beginSheet(windowC: windowC)
     }
 }
 

+ 1 - 1
PDF Office/PDF Master/Class/KMAdvertisement/Config/KMAdvertisementConfig.swift

@@ -161,7 +161,7 @@ extension KMAdvertisementConfig {
             }
             
             guard let style = dicts["AppleInterfaceStyle"] as? String else {
-                print("style is not string")
+//                print("style is not string")
                 return false
             }
             

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

@@ -2025,59 +2025,59 @@ extension KMMainViewController {
     // MARK: 显示窗口
     
     internal func showCompressWindow(url: URL? = nil) {
-        if let wc = self.currentWindowController as? KMCompressWindowController, let _ = wc.window?.isSheet {
-            KMPrint("压缩窗口已显示")
-            return
-        }
-        let windowController = KMCompressWIndowControllerNew(windowNibName: "KMCompressWIndowControllerNew")
-        self.view.window?.beginSheet(windowController.window!)
-        self.currentWindowController = windowController
-//        if let _url = url {
-//            windowController.oriDocumentUrl = self.listView.document.documentURL
-//            windowController.documentURL = _url
-//        } else {
-            windowController.documentURL = self.listView.document.documentURL
+//        if let wc = self.currentWindowController as? KMCompressWindowController, let _ = wc.window?.isSheet {
+//            KMPrint("压缩窗口已显示")
+//            return
+//        }
+//        let windowController = KMCompressWIndowControllerNew(windowNibName: "KMCompressWIndowControllerNew")
+//        self.view.window?.beginSheet(windowController.window!)
+//        self.currentWindowController = windowController
+////        if let _url = url {
+////            windowController.oriDocumentUrl = self.listView.document.documentURL
+////            windowController.documentURL = _url
+////        } else {
+//            windowController.documentURL = self.listView.document.documentURL
+////        }
+//        windowController.password = self.listView.document.password
+//
+//        windowController.itemClick = { [weak self] in
+//            self?.view.window?.endSheet((self?.currentWindowController.window)!)
+//            self?.currentWindowController = nil
+//
+//            self?.toolbarController.cancelSelected(KMToolbarToolCompressItemIdentifier)
+//        }
+//
+//        windowController.batchAction = { [weak self] view, filePaths in
+//            self?.view.window?.endSheet((self?.currentWindowController.window)!)
+//            self?.currentWindowController = nil
+//
+//            self?.toolbarController.cancelSelected(KMToolbarToolCompressItemIdentifier)
+//
+//            let batchWindowController = KMBatchOperateWindowController.sharedWindowController
+//                    batchWindowController.window?.makeKeyAndOrderFront("")
+//            let batchOperateFile = KMBatchOperateFile(filePath: filePaths.first!.path)
+//            batchWindowController.switchToOperateType(KMBatchOperationType.Compress, files: [batchOperateFile])
+//            batchWindowController.window?.makeKeyAndOrderFront("")
+//        }
+//
+//        windowController.resultCallback = { [weak self] result, openDocument, fileURL, error in
+//            if (result) {
+//                self?.view.window?.endSheet((self?.currentWindowController.window)!)
+//                self?.currentWindowController = nil
+//
+//                self?.toolbarController.cancelSelected(KMToolbarToolCompressItemIdentifier)
+//
+//                if (openDocument) {
+//                    NSDocumentController.shared.openDocument(withContentsOf: fileURL, display: true) { document, result, error in }
+//                } else {
+//                    NSWorkspace.shared.activateFileViewerSelecting([fileURL])
+//                }
+//            } else {
+//                let alert = NSAlert()
+//                alert.messageText = NSLocalizedString("Compress Faild", comment: "")
+//                alert.runModal()
+//            }
 //        }
-        windowController.password = self.listView.document.password
-        
-        windowController.itemClick = { [weak self] in
-            self?.view.window?.endSheet((self?.currentWindowController.window)!)
-            self?.currentWindowController = nil
-            
-            self?.toolbarController.cancelSelected(KMToolbarToolCompressItemIdentifier)
-        }
-        
-        windowController.batchAction = { [weak self] view, filePaths in
-            self?.view.window?.endSheet((self?.currentWindowController.window)!)
-            self?.currentWindowController = nil
-            
-            self?.toolbarController.cancelSelected(KMToolbarToolCompressItemIdentifier)
-            
-            let batchWindowController = KMBatchOperateWindowController.sharedWindowController
-                    batchWindowController.window?.makeKeyAndOrderFront("")
-            let batchOperateFile = KMBatchOperateFile(filePath: filePaths.first!.path)
-            batchWindowController.switchToOperateType(KMBatchOperationType.Compress, files: [batchOperateFile])
-            batchWindowController.window?.makeKeyAndOrderFront("")
-        }
-        
-        windowController.resultCallback = { [weak self] result, openDocument, fileURL, error in
-            if (result) {
-                self?.view.window?.endSheet((self?.currentWindowController.window)!)
-                self?.currentWindowController = nil
-                
-                self?.toolbarController.cancelSelected(KMToolbarToolCompressItemIdentifier)
-                
-                if (openDocument) {
-                    NSDocumentController.shared.openDocument(withContentsOf: fileURL, display: true) { document, result, error in }
-                } else {
-                    NSWorkspace.shared.activateFileViewerSelecting([fileURL])
-                }
-            } else {
-                let alert = NSAlert()
-                alert.messageText = NSLocalizedString("Compress Faild", comment: "")
-                alert.runModal()
-            }
-        }
     }
     
     internal func showConvertWindow(type: KMToolbarType, documentUrl: URL? = nil, identifier: String?) {
@@ -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) {

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

@@ -938,48 +938,48 @@ import Cocoa
         
 //        self.view.window?.beginSheet(windowController.window!)
         
-        let controller = KMSecurityWindowController(windowNibName: "KMSecurityWindowController")
-        controller.pdfDocument = self.document
-        self.currentWindowController = controller
-        
-        controller.batchAction = { [unowned self] controller, files in
-            self.view.window?.endSheet((self.currentWindowController.window)!)
-            self.currentWindowController = nil
-            
-            self.toolbarController.cancelSelected(KMToolbarToolCompressItemIdentifier)
-            
-            let batchWindowController = KMBatchOperateWindowController.sharedWindowController
-                    batchWindowController.window?.makeKeyAndOrderFront("")
-            let batchOperateFile = KMBatchOperateFile(filePath: files.first?.filePath ?? "")
-            batchWindowController.switchToOperateType(.AddPassword, files: [batchOperateFile])
-            batchWindowController.window?.makeKeyAndOrderFront("")
-        }
-        
-        controller.doneAction = { [unowned self] controller, options, attribute in
-//            let windowController_secure = self.currentWindowController as! KMSecureEncryptWindowController
-            self.view.window?.endSheet((self.currentWindowController.window)!)
-            self.currentWindowController = nil
-            
-            self._secureOptions = options
-            self.documentAttribute = attribute
-            self.needSave = true
-            self.recordIsPDFDocumentEdited(type: .setPassword)
-            
-            if (options.count != 0) {
-                self.showSecureSuccessTip()
-                self.recordSaveWatermarkFlag(type: .setPassword)
-            } else {
-                let alert = NSAlert()
-                alert.messageText = NSLocalizedString("Failure", comment: "")
-                alert.runModal()
-            }
-        }
-        
-        controller.cancelAction = { [unowned self] controller in
-            self.view.window?.endSheet((self.currentWindowController.window)!)
-            self.currentWindowController = nil
-        }
-        NSWindow.currentWindow().beginSheet(controller.window!)
+//        let controller = KMSecurityWindowController(windowNibName: "KMSecurityWindowController")
+//        controller.pdfDocument = self.document
+//        self.currentWindowController = controller
+//        
+//        controller.batchAction = { [unowned self] controller, files in
+//            self.view.window?.endSheet((self.currentWindowController.window)!)
+//            self.currentWindowController = nil
+//            
+//            self.toolbarController.cancelSelected(KMToolbarToolCompressItemIdentifier)
+//            
+//            let batchWindowController = KMBatchOperateWindowController.sharedWindowController
+//                    batchWindowController.window?.makeKeyAndOrderFront("")
+//            let batchOperateFile = KMBatchOperateFile(filePath: files.first?.filePath ?? "")
+//            batchWindowController.switchToOperateType(.AddPassword, files: [batchOperateFile])
+//            batchWindowController.window?.makeKeyAndOrderFront("")
+//        }
+//        
+//        controller.doneAction = { [unowned self] controller, options, attribute in
+////            let windowController_secure = self.currentWindowController as! KMSecureEncryptWindowController
+//            self.view.window?.endSheet((self.currentWindowController.window)!)
+//            self.currentWindowController = nil
+//            
+//            self._secureOptions = options
+//            self.documentAttribute = attribute
+//            self.needSave = true
+//            self.recordIsPDFDocumentEdited(type: .setPassword)
+//            
+//            if (options.count != 0) {
+//                self.showSecureSuccessTip()
+//                self.recordSaveWatermarkFlag(type: .setPassword)
+//            } else {
+//                let alert = NSAlert()
+//                alert.messageText = NSLocalizedString("Failure", comment: "")
+//                alert.runModal()
+//            }
+//        }
+//        
+//        controller.cancelAction = { [unowned self] controller in
+//            self.view.window?.endSheet((self.currentWindowController.window)!)
+//            self.currentWindowController = nil
+//        }
+//        NSWindow.currentWindow().beginSheet(controller.window!)
     }
     
     // MARK: -