|
@@ -413,18 +413,20 @@ class KMLeftSideViewController: KMSideViewController {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+ let hasAnno = self.allAnnotations.count >= 1
|
|
|
+ let disable = !hasAnno
|
|
|
|
|
|
- let expand_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(text: expand_MenuString,
|
|
|
+ let expand_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled:disable, text: expand_MenuString,
|
|
|
identifier: BOTAMenuIdentifier_Annotation_Expand)
|
|
|
|
|
|
let sort_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Sort"),
|
|
|
identifier: BOTAMenuIdentifier_Annotation_Sort)
|
|
|
|
|
|
var subMenuItemArr: [ComponentMenuitemProperty] = []
|
|
|
- let pageProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("By Page"),identifier: BOTAMenuIdentifier_Annotation_SortPage)
|
|
|
- let timeAscProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("By Time - Ascending"),identifier: BOTAMenuIdentifier_Annotation_SortAscTime)
|
|
|
+ let pageProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled:disable,text: KMLocalizedString("By Page"),identifier: BOTAMenuIdentifier_Annotation_SortPage)
|
|
|
+ let timeAscProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled:disable,text: KMLocalizedString("By Time - Ascending"),identifier: BOTAMenuIdentifier_Annotation_SortAscTime)
|
|
|
let timeDecProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(
|
|
|
- text: KMLocalizedString("By Time - Descending"),identifier: BOTAMenuIdentifier_Annotation_SortDesTime)
|
|
|
+ isDisabled:disable,text: KMLocalizedString("By Time - Descending"),identifier: BOTAMenuIdentifier_Annotation_SortDesTime)
|
|
|
|
|
|
subMenuItemArr.append(pageProperty)
|
|
|
subMenuItemArr.append(timeAscProperty)
|
|
@@ -434,12 +436,12 @@ class KMLeftSideViewController: KMSideViewController {
|
|
|
let improt_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Import Annotations"),
|
|
|
identifier: BOTAMenuIdentifier_Annotation_Improt)
|
|
|
|
|
|
- let exprot_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Import Annotations"),
|
|
|
- identifier: BOTAMenuIdentifier_Annotation_Improt)
|
|
|
+ let exprot_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled:disable,text: KMLocalizedString("Export Annotations"),
|
|
|
+ identifier: BOTAMenuIdentifier_Annotation_Export)
|
|
|
|
|
|
- let rem_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Remove All Annotations"),
|
|
|
+ let rem_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled:disable,text: KMLocalizedString("Remove All Annotations"),
|
|
|
identifier: BOTAMenuIdentifier_Annotation_RemoveAll)
|
|
|
- let delete_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Delete All Reply"),
|
|
|
+ let delete_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled:disable,text: KMLocalizedString("Delete All Reply"),
|
|
|
identifier: BOTAMenuIdentifier_Annotation_DeleteRep)
|
|
|
|
|
|
var menuItemArr: [ComponentMenuitemProperty] = []
|
|
@@ -730,11 +732,9 @@ extension KMLeftSideViewController: NSOutlineViewDelegate, NSOutlineViewDataSour
|
|
|
if(!hasAnno) {
|
|
|
headerView.sortButton.properties.isDisabled = true
|
|
|
headerView.searchButton.properties.isDisabled = true
|
|
|
- headerView.moreButton.properties.isDisabled = true
|
|
|
} else {
|
|
|
headerView.sortButton.properties.isDisabled = false
|
|
|
headerView.searchButton.properties.isDisabled = false
|
|
|
- headerView.moreButton.properties.isDisabled = false
|
|
|
}
|
|
|
headerView.sortButton.reloadData()
|
|
|
headerView.searchButton.reloadData()
|
|
@@ -1591,7 +1591,7 @@ extension KMLeftSideViewController: ComponentGroupDelegate {
|
|
|
}
|
|
|
}
|
|
|
} else if (menuItemProperty?.identifier == PDFViewMenuIdentifier_Normal_Copy) {
|
|
|
- if let models = menuItemProperty?.representedObject as? [KMBotaAnnotationReplyModel] {
|
|
|
+ if let models = menuItemProperty?.representedObject as? [KMBotaAnnotationModel] {
|
|
|
if models.first != nil {
|
|
|
let model = models.first
|
|
|
let an = model?.anno
|
|
@@ -1603,11 +1603,11 @@ extension KMLeftSideViewController: ComponentGroupDelegate {
|
|
|
} else if an?.isKind(of: CPDFFreeTextAnnotation.self) == true ||
|
|
|
an?.isKind(of: CPDFTextAnnotation.self) == true {
|
|
|
copyText = an?.contents ?? ""
|
|
|
- let pboard = NSPasteboard.general
|
|
|
- if copyText.isEmpty == false {
|
|
|
- pboard.clearContents()
|
|
|
- pboard.writeObjects([copyText as NSPasteboardWriting])
|
|
|
- }
|
|
|
+ }
|
|
|
+ let pboard = NSPasteboard.general
|
|
|
+ if copyText.isEmpty == false {
|
|
|
+ pboard.clearContents()
|
|
|
+ pboard.writeObjects([copyText as NSPasteboardWriting])
|
|
|
}
|
|
|
}
|
|
|
}
|