|
@@ -272,9 +272,6 @@ struct KMNMWCFlags {
|
|
|
|
|
|
setupUI()
|
|
|
|
|
|
- NotificationCenter.default.addObserver(self, selector: #selector(pdfViewScrollViewDidScroll), name: NSScrollView.didLiveScrollNotification, object: listView.documentView())
|
|
|
- NotificationCenter.default.addObserver(self, selector: #selector(pageCountChangedNotification), name: NSNotification.Name.CPDFDocumentPageCountChanged, object: listView.document)
|
|
|
-
|
|
|
}
|
|
|
|
|
|
override func viewDidAppear() {
|
|
@@ -434,8 +431,19 @@ struct KMNMWCFlags {
|
|
|
|
|
|
private func addNotificationCenter() {
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(annotationsAttributeHasChange), name: NSNotification.Name.CPDFListViewAnnotationsAttributeHasChange, object:nil)
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(signatureStateChangeNoti), name: NSNotification.Name(rawValue: "CSignatureTrustCerDidChangeNotification"), object: nil)
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(pdfViewScrollViewDidScroll), name: NSScrollView.didLiveScrollNotification, object: listView.documentView())
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(pageCountChangedNotification), name: NSNotification.Name.CPDFDocumentPageCountChanged, object: listView.document)
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(documentDidUnlockNotification), name: Notification.Name("CPDFDocumentDidUnlockNotification"), object: nil)
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(applicationWillTerminateNotification), name: NSApplication.willTerminateNotification, object: nil)
|
|
|
|
|
|
- NotificationCenter.default.addObserver(self, selector: #selector(signatureStateChangeNoti), name: NSNotification.Name(rawValue: "CSignatureTrustCerDidChangeNotification"), object: nil)
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(pdfViewHighlightFormFiledUpdateNoti), name: kPDFViewHighlightFormFiledUpdateNotiName, object: nil)
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ internal func removeNotifications() {
|
|
|
+ NotificationCenter.default.removeObserver(self)
|
|
|
|
|
|
}
|
|
|
|
|
@@ -462,7 +470,9 @@ struct KMNMWCFlags {
|
|
|
} else if SettingsManager.sharedInstance.leftPanelType == .hideLeftSide {
|
|
|
viewManager.pdfSideBarType = .none
|
|
|
} else if SettingsManager.sharedInstance.leftPanelType == .prioritizeOutline {
|
|
|
-
|
|
|
+ if let rootOutline = self.listView.document.outlineRoot(), rootOutline.numberOfChildren > 0 {
|
|
|
+ viewManager.pdfSideBarType = .outline
|
|
|
+ }
|
|
|
}
|
|
|
if viewManager.pdfSideBarType == .none {
|
|
|
toggleCloseLeftSide()
|
|
@@ -3123,6 +3133,7 @@ struct KMNMWCFlags {
|
|
|
CPDFKitConfig.sharedInstance().setEnableFormFieldHighlight(!enabled)
|
|
|
|
|
|
listView.setNeedsDisplayForVisiblePages()
|
|
|
+ self.alertTipViewController.reloadFormAlertUI()
|
|
|
}
|
|
|
|
|
|
//MARK: - 高亮Link
|
|
@@ -4045,6 +4056,7 @@ extension KMMainViewController: KMPDFToolbarControllerDelegate {
|
|
|
CPDFAnnotation.updateHighlightFormFiled(listView, highlightFormFiled: !value)
|
|
|
|
|
|
self.toolbarManager.refreshDefaultConfigItem()
|
|
|
+ self.alertTipViewController.reloadFormAlertUI()
|
|
|
|
|
|
} else if itemIdentifier == KMPDFToolbar_form_ShowName_Identifier {
|
|
|
listView.showFormFieldName = !listView.showFormFieldName
|
|
@@ -4937,6 +4949,7 @@ extension KMMainViewController: KMBatesControllerDelegate {
|
|
|
//MARK: - CPDFViewDelegate PDFView代理
|
|
|
|
|
|
extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
|
|
|
+
|
|
|
func pdfViewDocumentDidLoaded(_ pdfView: CPDFView!) {
|
|
|
sideBarController?.reloadPageTurnerData()
|
|
|
|
|
@@ -7010,10 +7023,6 @@ extension KMMainViewController : CDistanceSettingWindowControllerDelegate {
|
|
|
//MARK: - extension
|
|
|
extension KMMainViewController {
|
|
|
|
|
|
- internal func removeNotifications() {
|
|
|
- NotificationCenter.default.removeObserver(self)
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
func removeAllAnnotations() {
|
|
|
let alert = NSAlert()
|
|
@@ -7870,4 +7879,9 @@ extension KMMainViewController {
|
|
|
self.saveDocument()
|
|
|
}
|
|
|
|
|
|
+ internal func pdfViewHighlightFormFiledUpdateNoti(_ sender: Notification) {
|
|
|
+ self.alertTipViewController.reloadFormAlertUI()
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|