KMConvertJsonWindowController.swift 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // KMConvertJsonWindowController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by User-Tangchao on 2024/10/29.
  6. //
  7. import Cocoa
  8. class KMConvertJsonWindowController: KMConvertBaseWindowController {
  9. override var fileExtension: String {
  10. return KMPDFConvert.pathExtension(.json)
  11. }
  12. override func initContentView() {
  13. super.initContentView()
  14. self.titleLabel.stringValue = NSLocalizedString("PDF to Json", comment: "")
  15. }
  16. override func initSettingView() -> KMConvertSettingView? {
  17. return KMConvertJsonSettingView.json_createFromNib()
  18. }
  19. override func initConvert() -> KMPDFConvert {
  20. return KMPDFConvertJson()
  21. }
  22. override func convertModelAppendParams(convert: KMPDFConvert) {
  23. super.convertModelAppendParams(convert: convert)
  24. if let _convert = convert as? KMPDFConvertHTML {
  25. let settingView: KMConvertJsonSettingView = self.settingView as! KMConvertJsonSettingView
  26. let index = settingView.extractIndex
  27. if (index == 0) {
  28. _convert.isAllInOneSheet = false
  29. } else if index == 1 {
  30. _convert.isAllInOneSheet = true
  31. }
  32. }
  33. }
  34. }