123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- //
- // KMConvertExcelWindowController.swift
- // PDF Reader Pro
- //
- // Created by tangchao on 2022/12/6.
- //
- import Cocoa
- // 转档 Excel 窗口
- class KMConvertExcelWindowController: KMConvertBaseWindowController {
- override var fileExtension: String {
- return KMPDFConvert.pathExtension(.excel)
- }
-
- override func initDefaultValue() {
- super.initDefaultValue()
-
- self.titleLabel.stringValue = NSLocalizedString("PDF to Excel", comment: "")
- }
-
- override func initSubViews() {
- super.initSubViews()
-
- self.refreshUI()
- }
-
- override func initSettingView() -> KMConvertSettingView? {
- return KMConvertExcelSettingView.createFromNib()
- }
-
- override func initConvert() -> KMPDFConvert {
- return KMPDFConvertExcel()
- }
-
- override func refreshUI() {
- super.refreshUI()
-
- Task { @MainActor in
- if await (KMLightMemberManager.manager.canPayFunction() == false) {
- self.setupContentHeight(height: 391+20, animated: true)
- return
- }
- self.setupContentHeight(height: 391)
- }
- }
-
- override func convertModelAppendParams(convert: KMPDFConvert) {
- super.convertModelAppendParams(convert: convert)
-
- let settingView: KMConvertExcelSettingView = self.settingView as! KMConvertExcelSettingView
- if settingView.selectedSettingIndex == 0 {
- convert.isExtractTable = false
- convert.isExtractText = false
-
- if (settingView.selectedSheetIndex == 0) {
- convert.isAllInOneSheet = false
- } else if (settingView.selectedSheetIndex == 1) {
- convert.isAllInOneSheet = true
- }
- } else if settingView.selectedSettingIndex == 1 {
- convert.isAllInOneSheet = false
- convert.isExtractText = false
- convert.isExtractTable = true
-
- convert.extractTableIndex = settingView.selectedTableFormatIndex
- } else if (settingView.selectedSettingIndex == 2) {
- convert.isAllInOneSheet = false
- convert.isExtractTable = false
- convert.isExtractText = true
- }
- }
-
- }
|