Browse Source

【综合】批量转档标准Word类型去除

tangchao 2 months ago
parent
commit
329fa8c71f

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

@@ -79,7 +79,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
                 self.convertButton.tag = 2
                 self.convertButton.setTitleColor(KMAppearance.Layout.w0Color())
                 self.convertButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().cgColor
-                if self.convertType == .WordStandard {
+                if self.convertType == .WordStandard || self.convertType == .WordAdvance {
                     self.convertButton.title = NSLocalizedString("Convert", comment: "")
                     self.convertButton.layer?.backgroundColor = KMAppearance.Interactive.m0Color().withAlphaComponent(0.4).cgColor
                     self.convertButton.isEnabled = false
@@ -178,7 +178,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
             isShowUpgrade = true
         }
 #endif
-
+        
         var moreLabelString = ""
 #if VERSION_FREE
         if !KMMemberInfo.shared.isMemberAllFunction {
@@ -241,7 +241,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
         detailInfoBox.isHidden = true
         buttonBottemOffset.constant = 10
         
-        if self.convertType == .WordAdvance {
+        if self.convertType == .WordAdvance || self.convertType == .WordStandard {
             separateStypeBox.isHidden = false
             excelStyleBox.isHidden = true
             csvExtractButton.isHidden = true
@@ -408,66 +408,11 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
     }
     
     func prepareData() {
-        let arr: [KMConvertWithPDFType] = [.Excel, .PowerPoint, .RTF, .CSV, .HTML, .Text, .JPEG, .JPG, .PNG, .GIF, .TIFF, .TGA, .BMP, .JPEG2000, .Json]
+        let arr: [KMConvertWithPDFType] = [.WordAdvance ,.Excel, .PowerPoint, .RTF, .CSV, .HTML, .Text, .JPEG, .JPG, .PNG, .GIF, .TIFF, .TGA, .BMP, .JPEG2000, .Json]
         self.dataSourcesArray = arr
-        
-        var needShowAdvance = true
-        var needShowDefault = true
-        
-#if VERSION_FREE
-        // 桌机版
-        if KMMemberInfo.shared.isMemberAllFunction {
-            if KMMemberInfo.shared.isPermitConvert {
-                needShowAdvance = true
-                needShowDefault = false
-            }
-        }
-#else
-        if KMMemberInfo.shared.isPermitConvert {
-            needShowAdvance = true
-            needShowDefault = false
-        }
-#endif
-        
-        if needShowDefault {
-            var wordType: KMConvertWithPDFType = .WordStandard
-            self.dataSourcesArray?.insert(wordType, at: 0)
-        }
-        
-        if needShowAdvance {
-            var wordType: KMConvertWithPDFType = .WordAdvance
-            self.dataSourcesArray?.insert(wordType, at: 0)
-        }
     }
     
     func updateFormatView() {
-        var isShowAdvanced = false
-            
-#if VERSION_FREE
-#if VERSION_DMG
-        // 桌机版
-        isShowAdvanced = true
-        if KMMemberInfo.shared.isMemberAllFunction {
-            if KMMemberInfo.shared.isPermitConvert {
-                isShowAdvanced = false
-            }
-        }
-#else
-        // 免费版
-        isShowAdvanced = true
-        if KMMemberInfo.shared.isMemberAllFunction {
-            if KMMemberInfo.shared.isPermitConvert {
-                isShowAdvanced = false
-            }
-        }
-        
-#endif
-#else
-        isShowAdvanced = true
-        if KMMemberInfo.shared.isPermitConvert {
-            isShowAdvanced = false
-        }
-#endif
         self.formatSelectButton.removeAllItems()
 
         for i in 0..<self.dataSourcesArray!.count {
@@ -475,38 +420,9 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
             let item = NSMenuItem()
             item.target = self
             
-            if(number == .WordAdvance) {
-                if isShowAdvanced {
-                    let originStr = " \(NSLocalizedString("Advanced", comment: "")) "
-                    let str = NSLocalizedString("Word (.docx)", comment: "")
-                    
-                    let attributedStr = NSMutableAttributedString(string: "\(str)  \(originStr)")
-                    
-                    attributedStr.addAttribute(NSAttributedString.Key.backgroundColor, value: NSColor(red: 245.0/255.0, green: 142.0/255.0, blue: 38.0/255.0, alpha: 1.0), range: NSMakeRange(str.count + 2, originStr.count))
-                    
-                    attributedStr.addAttribute(NSAttributedString.Key.foregroundColor, value: NSColor.white, range: NSMakeRange(str.count + 2, originStr.count))
-                    
-                    item.attributedTitle = attributedStr
-                } else {
-                    item.title = "Word (.docx)"
-                }
+            if(number == .WordAdvance || number == .WordStandard) {
+                item.title = "Word (.docx)"
                 item.tag = KMConvertWithPDFType.WordAdvance.rawValue
-            } else if(number == .WordStandard) {
-                if isShowAdvanced {
-                    let originStr = " \(KMLocalizedString("Standard", nil)) "
-                    let str = KMLocalizedString("Word (.docx)", nil)
-                    
-                    let attributedStr = NSMutableAttributedString(string: "\(str)  \(originStr)")
-                    
-                    attributedStr.addAttribute(NSAttributedString.Key.backgroundColor, value: NSColor(red: 40/255.0, green: 193.0/255.0, blue: 107.0/255.0, alpha: 1.0), range: NSMakeRange(str.count + 2, originStr.count))
-                    
-                    attributedStr.addAttribute(NSAttributedString.Key.foregroundColor, value: NSColor.white, range: NSMakeRange(str.count + 2, originStr.count))
-                    
-                    item.attributedTitle = attributedStr
-                } else {
-                    item.title = "Word (.docx)"
-                }
-                item.tag = KMConvertWithPDFType.WordStandard.rawValue
             } else if(number == .Excel) {
                 item.title = "Excel (.xlsx)"
                 item.tag = KMConvertWithPDFType.Excel.rawValue
@@ -555,9 +471,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
             }
             
             self.formatSelectButton.menu?.addItem(item)
-
         }
-       
     }
     
     @IBAction func buttonClicked_Convert(_ sender: NSButton) {