瀏覽代碼

综合-页面编辑,页面范围选择 Custom,文本会默认显示 Custom(已修复)

tangchao 2 年之前
父節點
當前提交
ca3b46d1c5
共有 19 個文件被更改,包括 39 次插入40 次删除
  1. 二進制
      PDF Office/PDF Office.xcodeproj/project.xcworkspace/xcuserdata/kdanmobile.xcuserdatad/UserInterfaceState.xcuserstate
  2. 1 1
      PDF Office/PDF Office/Class/Merge/Controller/KMMergeViewController.swift
  3. 1 1
      PDF Office/PDF Office/Class/Merge/Controller/KMPageRangePickerWindowController.swift
  4. 1 1
      PDF Office/PDF Office/Class/PDFTools/Background/Controller/KMBackgroundFilePropertyInfoController.swift
  5. 1 1
      PDF Office/PDF Office/Class/PDFTools/Background/Controller/KMBackgroundPropertyInfoController.swift
  6. 1 1
      PDF Office/PDF Office/Class/PDFTools/Bates/Controller/KMBatesPropertyInfoController.swift
  7. 1 1
      PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.swift
  8. 1 1
      PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertCSVWindowController.swift
  9. 1 1
      PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertExcelWindowController.swift
  10. 1 1
      PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertImageWindowController.swift
  11. 1 1
      PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertPPTsWindowController.swift
  12. 1 1
      PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertWordWindowController.swift
  13. 1 7
      PDF Office/PDF Office/Class/PDFTools/Convert/View/KMConvertPageRangeSettingItemView.swift
  14. 1 1
      PDF Office/PDF Office/Class/PDFTools/Crop/KMCropSettingWindowController.swift
  15. 1 1
      PDF Office/PDF Office/Class/PDFTools/Extract/KMHomeExtractActionViewController.swift
  16. 1 1
      PDF Office/PDF Office/Class/PDFTools/HeaderFooter/Controller/KMHeaderFooterPropertyInfoController.swift
  17. 21 16
      PDF Office/PDF Office/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift
  18. 1 1
      PDF Office/PDF Office/Class/PDFTools/Watermark/Controller/KMWatermarkPropertyInfoController.swift
  19. 2 2
      PDF Office/PDF Office/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

二進制
PDF Office/PDF Office.xcodeproj/project.xcworkspace/xcuserdata/kdanmobile.xcuserdatad/UserInterfaceState.xcuserstate


+ 1 - 1
PDF Office/PDF Office/Class/Merge/Controller/KMMergeViewController.swift

@@ -292,7 +292,7 @@ class KMMergeViewController: NSViewController {
                 if !isValidPagesString(pagesString: pageString) {
                     let alert = NSAlert()
                     alert.alertStyle = .warning
-                    alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                    alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                     alert.runModal()
                     return
                 }

+ 1 - 1
PDF Office/PDF Office/Class/Merge/Controller/KMPageRangePickerWindowController.swift

@@ -120,7 +120,7 @@ class KMPageRangePickerWindowController: NSWindowController {
         if selectIndex == 3 && findSelectPage(pagesString: self.customPagesTextField.stringValue).count == 0 {
             let alert = NSAlert()
             alert.alertStyle = .warning
-            alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+            alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
             alert.runModal()
             return
         }

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Background/Controller/KMBackgroundFilePropertyInfoController.swift

@@ -234,7 +234,7 @@ class KMBackgroundFilePropertyInfoController: NSViewController {
             if (array.count <= 0) {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
                 return
             }

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Background/Controller/KMBackgroundPropertyInfoController.swift

@@ -170,7 +170,7 @@ class KMBackgroundPropertyInfoController: NSViewController {
             if (array.count <= 0) {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
                 return
             }

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Bates/Controller/KMBatesPropertyInfoController.swift

@@ -210,7 +210,7 @@ class KMBatesPropertyInfoController: NSViewController {
             if (array.count <= 0) {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
                 return
             }

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertBaseWindowController.swift

@@ -343,7 +343,7 @@ class KMConvertBaseWindowController: NSWindowController {
             if array.count == 0 {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
                 return
             } else {

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertCSVWindowController.swift

@@ -34,7 +34,7 @@ class KMConvertCSVWindowController: KMConvertBaseWindowController {
             if array.count == 0 {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
             } else {
                 self.pageRangeString = string

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertExcelWindowController.swift

@@ -35,7 +35,7 @@ class KMConvertExcelWindowController: KMConvertBaseWindowController {
             if array.count == 0 {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
             } else {
                 self.pageRangeString = string

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertImageWindowController.swift

@@ -46,7 +46,7 @@ class KMConvertImageWindowController: KMConvertBaseWindowController {
             if array.count == 0 {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
             } else {
                 self.pageRangeString = string

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertPPTsWindowController.swift

@@ -53,7 +53,7 @@ class KMConvertPPTsWindowController: KMConvertBaseWindowController {
             if array.count == 0 {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
             } else {
                 self.pageRangeString = string

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Convert/Controller/KMConvertWordWindowController.swift

@@ -35,7 +35,7 @@ class KMConvertWordWindowController: KMConvertBaseWindowController {
             if array.count == 0 {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
             } else {
                 self.pageRangeString = string

+ 1 - 7
PDF Office/PDF Office/Class/PDFTools/Convert/View/KMConvertPageRangeSettingItemView.swift

@@ -49,7 +49,7 @@ class KMConvertPageRangeSettingItemView: NSView, NibLoadable {
         pageSizeBox.contentView = pageSizeVC.view
         
         pageSizeVC.removeAllItems()
-        pageSizeVC.addItems(withObjectValues: [NSLocalizedString("All Pages", comment: ""), NSLocalizedString("Current Page", comment: ""), NSLocalizedString("Odd Pages", comment: ""), NSLocalizedString("Even Pages", comment: ""), NSLocalizedString("Custom", comment: "")])
+        pageSizeVC.addItems(withObjectValues: [NSLocalizedString("All Pages", comment: ""), NSLocalizedString("Current Page", comment: ""), NSLocalizedString("Odd Pages", comment: ""), NSLocalizedString("Even Pages", comment: ""), NSLocalizedString("Customized", comment: "")])
         pageSizeVC.selectItem(at: 0)
         pageSizeVC.editable = false //默认属性,初始化可不设置
         pageSizeVC.delete = self
@@ -58,12 +58,6 @@ class KMConvertPageRangeSettingItemView: NSView, NibLoadable {
         titleLabel.stringValue = NSLocalizedString("Page Range", comment: "")
         titleLabel.textColor = NSColor(hex: "#616469")
         titleLabel.font = .SFProTextRegular(12)
-//        pageSizeComboBox.removeAllItems()
-//        pageSizeComboBox.addItems(withObjectValues: ["All Pages", "Current Page", "Odd Pages", "Even Pages", "Custom"])
-//        pageSizeComboBox.selectItem(at: 0)
-//        pageSizeComboBox.isEditable = false
-//        pageSizeComboBox.delegate = self
-//        pageSizeComboBox.placeholderString = "如1,3-5,10"
         
         pageSizeVC.updateUI()
     }

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Crop/KMCropSettingWindowController.swift

@@ -54,7 +54,7 @@ class KMCropSettingWindowController: NSWindowController {
             if (array.count <= 0) {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
                 return
             }

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Extract/KMHomeExtractActionViewController.swift

@@ -62,7 +62,7 @@ class KMHomeExtractActionViewController: NSViewController {
         super.viewDidLoad()
         // Do view setup here.
         
-        choiceArray = [NSLocalizedString("All Pages", comment: ""), NSLocalizedString("Current Page", comment: ""), NSLocalizedString("odd page", comment: ""), NSLocalizedString("even page", comment: ""), NSLocalizedString("custom page", comment: "")]
+        choiceArray = [NSLocalizedString("All Pages", comment: ""), NSLocalizedString("Current Page", comment: ""), NSLocalizedString("Odd Pages", comment: ""), NSLocalizedString("Even Pages", comment: ""), NSLocalizedString("Customized", comment: "")]
                 
         oneDocumentPerPageBox.downCallback = { [self](downEntered: Bool, mouseBox: KMBox) -> Void in
             if downEntered {

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/HeaderFooter/Controller/KMHeaderFooterPropertyInfoController.swift

@@ -203,7 +203,7 @@ class KMHeaderFooterPropertyInfoController: NSViewController {
             if (array.count <= 0) {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
                 return
             }

+ 21 - 16
PDF Office/PDF Office/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.swift

@@ -26,6 +26,12 @@ class KMPDFEditViewController: NSViewController {
     @IBOutlet weak var contentBox: NSBox!
     
     var pageRangeView: KMDesignSelect?
+    var pageRangeViewItems = [NSLocalizedString("All Pages", comment: ""),
+                              NSLocalizedString("Odd Pages", comment: ""),
+                              NSLocalizedString("Even Pages", comment: ""),
+                              NSLocalizedString("Horizontal Pages", comment: ""),
+                              NSLocalizedString("Vertical Pages", comment: ""),
+                              NSLocalizedString("Customized", comment: "")]
     
     var toolBar = KMToolbar()
     
@@ -185,9 +191,9 @@ class KMPDFEditViewController: NSViewController {
                 replaceItem?.unEnabled = !replaceEnable
             }
             
-            if (self!.pageIsUpdate == false) {
-                return
-            }
+//            if (self!.pageIsUpdate == false) {
+//                return
+//            }
             
             var indexs: Array<Int> = []
             for indexPath in selectedIndexs {
@@ -314,7 +320,7 @@ class KMPDFEditViewController: NSViewController {
             return
         }
         if (indexs.count == (self.listView?.document.pageCount)!) {
-            let _ = CustomAlertView(message: "无法删除所有页面", from: self.thumbnailView, with: .blue)
+            let _ = CustomAlertView(message: NSLocalizedString("无法删除所有页面", comment: ""), from: self.thumbnailView, with: .blue)
             return
         }
         /// 数据降序排序
@@ -1016,13 +1022,9 @@ extension KMPDFEditViewController: KMNewToolbarDelegate {
             comBoxView.view.frame = NSMakeRect(0, 8, NSWidth(view.frame), 24)
             comBoxView.view.autoresizingMask = [.width]
             comBoxView.removeAllItems()
-            comBoxView.addItems(withObjectValues: [NSLocalizedString("all pages", comment: ""),
-                                             NSLocalizedString("odd pages", comment: ""),
-                                             NSLocalizedString("even pages", comment: ""),
-                                             NSLocalizedString("horizontal pages", comment: ""),
-                                             NSLocalizedString("vertical pages", comment: ""),
-                                             NSLocalizedString("custom", comment: "")])
+            comBoxView.addItems(withObjectValues: self.pageRangeViewItems)
             comBoxView.selectItem(at: 0)
+            comBoxView.placeholderString = NSLocalizedString("eg .1,3-5,10", comment: "")
             comBoxView.editable = false
             comBoxView.delete = self
             pageRangeView = comBoxView
@@ -1404,6 +1406,9 @@ extension KMPDFEditViewController: KMSelectPopButtonDelegate {
         } else { /// 自定义
             self.pageIsUpdate = false
             self.pageRangeView?.editable = true
+            DispatchQueue.main.async {
+                self.pageRangeView?.stringValue = ""
+            }
         }
     }
     
@@ -1412,16 +1417,16 @@ extension KMPDFEditViewController: KMSelectPopButtonDelegate {
     }
     
     func km_controlTextDidEndEditing(_ obj: KMDesignSelect) {
-//        for index in 0 ..< self.pageRangeView!.numberOfItems {
-//            if (self.pageRangeView.itemObjectValue(at: index) as! String == self.pageRangeView!.stringValue) {
-//                return
-//            }
-//        }
+        for index in 0 ..< self.pageRangeView!.numberOfItems {
+            if (self.pageRangeViewItems[index] == self.pageRangeView!.stringValue) {
+                return
+            }
+        }
         
         let pages = KMPageRangeTools.findSelectPage(pageRangeString: self.pageRangeView!.stringValue, pageCount: Int((self.listView?.document.pageCount)!))
         if (pages.isEmpty) {
             let alert = NSAlert()
-            alert.messageText = "页面范围输入有误"
+            alert.messageText = "Invalid page range or the page number is out of range. Please try again."
             alert.runModal()
             return
         }

+ 1 - 1
PDF Office/PDF Office/Class/PDFTools/Watermark/Controller/KMWatermarkPropertyInfoController.swift

@@ -278,7 +278,7 @@ class KMWatermarkPropertyInfoController: NSViewController {
             if (array.count <= 0) {
                 let alert = NSAlert()
                 alert.alertStyle = .warning
-                alert.messageText = NSLocalizedString("页面范围格式错误", comment: "")
+                alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                 alert.runModal()
                 return
             }

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

@@ -557,7 +557,7 @@ extension KMMainViewController {
                 let array = KMPageRangeTools.findSelectPage(pageRangeString: pageString, pageCount: Int((self?.listView.document.pageCount)!))
                 if (array.count == 0) {
                     let alert = NSAlert()
-                    alert.messageText = "页面范围有误"
+                    alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "")
                     alert.runModal()
                     return
                 }
@@ -1679,7 +1679,7 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
                         let array = KMPageRangeTools.findSelectPage(pageRangeString: pageString, pageCount: Int((self?.listView.document.pageCount)!))
                         if (array.count == 0) {
                             let alert = NSAlert()
-                            alert.messageText = "页面范围有误"
+                            alert.messageText = NSLocalizedString("Invalid page range or the page number is out of range. Please try again.", comment: "") 
                             alert.runModal()
                             return
                         }