KMConvertCSVWindowController.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // KMConvertCSVWindowController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2022/12/6.
  6. //
  7. import Cocoa
  8. // 转档 CSV 窗口
  9. class KMConvertCSVWindowController: KMConvertBaseWindowController {
  10. override var fileExtension: String {
  11. let settingView: KMConvertCSVSettingView = self.settingView as! KMConvertCSVSettingView
  12. if settingView.selectedSettingIndex == 0 {
  13. return KMPDFConvert.pathExtension(.csv, false)
  14. } else {
  15. return KMPDFConvert.pathExtension(.csv, true)
  16. }
  17. }
  18. override func initDefaultValue() {
  19. super.initDefaultValue()
  20. self.titleLabel.stringValue = NSLocalizedString("PDF to CSV", comment: "")
  21. }
  22. override func initSettingView() -> KMConvertSettingView? {
  23. return KMConvertCSVSettingView.createFromNib()
  24. }
  25. override func initConvert() -> KMPDFConvert {
  26. return KMPDFConvertCSV()
  27. }
  28. override func convertModelAppendParams(convert: KMPDFConvert) {
  29. let settingView: KMConvertCSVSettingView = self.settingView as! KMConvertCSVSettingView
  30. if settingView.selectedSettingIndex == 0 {
  31. convert.isExtractTable = false
  32. } else {
  33. convert.isExtractTable = true
  34. }
  35. }
  36. }