|
@@ -141,6 +141,11 @@ extension KMLeftSideViewController {
|
|
self.tocOutlineView.reloadData()
|
|
self.tocOutlineView.reloadData()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @objc dynamic func changePDFOutlineDestination(_ destination: CPDFDestination, PDFoutline outline: CPDFOutline) {
|
|
|
|
+ (self.listView.undoManager?.prepare(withInvocationTarget: self) as AnyObject).changePDFOutlineDestination(outline.destination, PDFoutline: outline)
|
|
|
|
+ outline.destination = destination
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// MARK: - Menu Actions
|
|
// MARK: - Menu Actions
|
|
@@ -204,4 +209,22 @@ extension KMLeftSideViewController {
|
|
self.removeOutline(parent: outL.parent , removeOutline: outL, index: Int(outL.index), needExpand: false)
|
|
self.removeOutline(parent: outL.parent , removeOutline: outL, index: Int(outL.index), needExpand: false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //重置目的
|
|
|
|
+
|
|
|
|
+ @objc func outlineContextMenuItemClicked_SetDestination(_ sender: AnyObject?) {
|
|
|
|
+ guard let setPDFOutline = self.tocOutlineView.item(atRow: self.tocOutlineView.clickedRow) as? CPDFOutline else {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Task {
|
|
|
|
+ let modalRes = await KMAlertTool.runModel(style: .informational, message: KMLocalizedString("Are you sure you want to set the destination as the current location?", nil), buttons: [KMLocalizedString("Yes", nil), KMLocalizedString("No", nil)])
|
|
|
|
+ if (modalRes == .alertFirstButtonReturn) {
|
|
|
|
+ self.changePDFOutlineDestination(self.listView.currentDestination, PDFoutline: setPDFOutline)
|
|
|
|
+ self.tocOutlineView.reloadData()
|
|
|
|
+ let idx = self.tocOutlineView.row(forItem: setPDFOutline)
|
|
|
|
+ self.tocOutlineView.selectRowIndexes(IndexSet(integer: idx), byExtendingSelection: false)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|