// // KMPageEditExtractSettingView.swift // PDF Master // // Created by tangchao on 2023/1/12. // import Cocoa class KMPageEditExtractSettingView: KMPageEditSettingBaseView { @IBOutlet weak var independentPerPageCheck: NSButton! @IBOutlet weak var extractAfterDeletePageCheck: NSButton! override func awakeFromNib() { super.awakeFromNib() self.independentPerPageCheck.title = NSLocalizedString("Each page as a separate page", comment: "") self.extractAfterDeletePageCheck.title = NSLocalizedString("Delete page after extraction", comment: "") self.independentPerPageCheck.target = self self.independentPerPageCheck.action = #selector(checkAction) self.independentPerPageCheck.state = .off self.extractAfterDeletePageCheck.target = self self.extractAfterDeletePageCheck.action = #selector(checkAction) self.extractAfterDeletePageCheck.state = .off } @objc func checkAction(sender: NSButton) { guard let callback = self.itemClick else { return } var index: Int = 1 if (sender.isEqual(to: self.extractAfterDeletePageCheck)) { index = 2 } callback(index, sender.state == .on) } }