KMBatchOperateCompressViewController.swift 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // KMBatchOperateCompressViewController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by lizhe on 2024/11/15.
  6. //
  7. import Cocoa
  8. import KMComponentLibrary
  9. class KMBatchOperateCompressViewController: KMBatchOperateBaseViewController {
  10. @IBOutlet weak var titleLabel: NSTextField!
  11. @IBOutlet weak var compressView: KMCompressContentView!
  12. @IBOutlet weak var compressButton: ComponentButton!
  13. var model: KMCompressSettingModel = KMCompressSettingModel(modelsType: .standard) {
  14. didSet {
  15. self.reloadData()
  16. }
  17. }
  18. override func viewDidLoad() {
  19. super.viewDidLoad()
  20. // Do view setup here.
  21. self.updateUI()
  22. }
  23. }
  24. //UI
  25. extension KMBatchOperateCompressViewController {
  26. func updateUI() {
  27. compressButton.properties = ComponentButtonProperty(type: .primary, size: .xs, buttonText: KMLocalizedString("Compress"), keepPressState: false)
  28. compressButton.setTarget(self, action: #selector(compressButtonAction(_:)))
  29. self.compressView.selectTypeAction = {[unowned self] view, tModel in
  30. self.model = tModel
  31. }
  32. }
  33. }
  34. //MARK: Data
  35. extension KMBatchOperateCompressViewController {
  36. func reloadData() {
  37. }
  38. }
  39. //MARK: Action
  40. extension KMBatchOperateCompressViewController {
  41. @IBAction func compressButtonAction(_ sender: Any) {
  42. // KMCompressManager.shared.compress(documentURL: self.documentURL,
  43. // limit: limit,
  44. // model: self.model,
  45. // view: (self.window?.contentView)!) { [unowned self] isFinish, resultURL in
  46. // if isFinish {
  47. // self.closeWindow()
  48. // }
  49. // }
  50. }
  51. }