|
@@ -8,12 +8,14 @@
|
|
|
import Cocoa
|
|
|
|
|
|
typealias KMOCRSettingWindowControllerOCRAction = (_ controller: KMOCRSettingWindowController, _ model: KMOCRModel) -> Void
|
|
|
+typealias KMOCRSettingWindowControllerCancelAction = (_ controller: KMOCRSettingWindowController) -> Void
|
|
|
|
|
|
class KMOCRSettingWindowController: KMNBaseWindowController {
|
|
|
|
|
|
@IBOutlet weak var OCRSettingView: KMOCRSettingView!
|
|
|
|
|
|
var OCRAction: KMOCRSettingWindowControllerOCRAction?
|
|
|
+ var cancelAction: KMOCRSettingWindowControllerCancelAction?
|
|
|
|
|
|
override func windowDidLoad() {
|
|
|
super.windowDidLoad()
|
|
@@ -23,7 +25,9 @@ class KMOCRSettingWindowController: KMNBaseWindowController {
|
|
|
|
|
|
func updateUI() {
|
|
|
OCRSettingView.cancelAction = { [unowned self] view in
|
|
|
- self.closeWindow()
|
|
|
+ guard let callBack = cancelAction else { return }
|
|
|
+
|
|
|
+ callBack(self)
|
|
|
}
|
|
|
|
|
|
OCRSettingView.OCRAction = { [unowned self] view, model in
|