|
@@ -129,4 +129,26 @@ class KMPageEditSplitWindowController: KMPageEditSettingBaseWindowController {
|
|
|
self.funcVC?.stringValue = NSLocalizedString("Split", comment: "")
|
|
|
self.funcVC?.updateUI()
|
|
|
}
|
|
|
+
|
|
|
+ override func funcButtonAction() {
|
|
|
+ guard let _model = self.model as? KMPageEditSplitSettingModel else {
|
|
|
+ super.funcButtonAction()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_model.pageRangeType == 2) {
|
|
|
+ let pages = KMPageRangeTools.findSelectPage(pageRangeString: _model.pageRangeString, pageCount: _model.pageCount)
|
|
|
+ if (pages.isEmpty) {
|
|
|
+ let alert = NSAlert()
|
|
|
+ alert.messageText = NSLocalizedString("Value must be between 1 and \(_model.pageCount)", comment: "")
|
|
|
+ alert.informativeText = NSLocalizedString("Values cannot exceed the page range.", comment: "")
|
|
|
+ alert.runModal()
|
|
|
+ (self.settingView as? KMPageEditSplitSettingView)?.setPageRangeString("1")
|
|
|
+
|
|
|
+ _model.pageRangeString = "1"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ super.funcButtonAction()
|
|
|
+ }
|
|
|
}
|