|
@@ -26,28 +26,28 @@ extension KMLeftSideViewController {
|
|
let model = self.snapshots[selectedRow]
|
|
let model = self.snapshots[selectedRow]
|
|
let controller = model.windowC
|
|
let controller = model.windowC
|
|
let menu = NSMenu()
|
|
let menu = NSMenu()
|
|
- let itemExport = menu.addItem(title: KMLocalizedString("Export", "Menu item title"), action: nil, target: self)
|
|
|
|
|
|
+ let itemExport = menu.addItem(title: KMLocalizedString("Export"), action: nil, target: self)
|
|
let subMenu = NSMenu()
|
|
let subMenu = NSMenu()
|
|
|
|
|
|
- var t = subMenu.addItem(title: KMLocalizedString("PNG", "Menu item title"), action: #selector(menuItemClick_ExportPNG), target: self)
|
|
|
|
|
|
+ var t = subMenu.addItem(title: KMLocalizedString("PNG"), action: #selector(menuItemClick_ExportPNG), target: self)
|
|
t?.representedObject = controller
|
|
t?.representedObject = controller
|
|
|
|
|
|
- t = subMenu.addItem(title: KMLocalizedString("JPG", "Menu item title"), action: #selector(menuItemClick_ExportJPG), target: self)
|
|
|
|
|
|
+ t = subMenu.addItem(title: KMLocalizedString("JPG"), action: #selector(menuItemClick_ExportJPG), target: self)
|
|
t?.representedObject = controller
|
|
t?.representedObject = controller
|
|
|
|
|
|
- t = subMenu.addItem(title: KMLocalizedString("PDF", "Menu item title"), action: #selector(menuItemClick_ExportPDF), target: self)
|
|
|
|
|
|
+ t = subMenu.addItem(title: KMLocalizedString("PDF"), action: #selector(menuItemClick_ExportPDF), target: self)
|
|
t?.representedObject = controller
|
|
t?.representedObject = controller
|
|
itemExport?.submenu = subMenu
|
|
itemExport?.submenu = subMenu
|
|
|
|
|
|
- let itemPrint = menu.addItem(title: KMLocalizedString("Print", "Menu item title"), action: #selector(menuItemClick_Print), target: self)
|
|
|
|
|
|
+ let itemPrint = menu.addItem(title: KMLocalizedString("Print"), action: #selector(menuItemClick_Print), target: self)
|
|
itemPrint?.representedObject = controller
|
|
itemPrint?.representedObject = controller
|
|
menu.addItem(.separator())
|
|
menu.addItem(.separator())
|
|
|
|
|
|
- let itemSelectAll = menu.addItem(title: KMLocalizedString("Select All", "Menu item title"), action: #selector(menuItemClick_SelectAll), target: self)
|
|
|
|
|
|
+ let itemSelectAll = menu.addItem(title: KMLocalizedString("Select All"), action: #selector(menuItemClick_SelectAll), target: self)
|
|
itemSelectAll?.representedObject = controller
|
|
itemSelectAll?.representedObject = controller
|
|
menu.addItem(.separator())
|
|
menu.addItem(.separator())
|
|
|
|
|
|
- let itemDeleteAllSnapshot = menu.addItem(title: KMLocalizedString("Delete All Snapshots", "Menu item title"), action: #selector(deleteAllSnapshot), target: self)
|
|
|
|
|
|
+ let itemDeleteAllSnapshot = menu.addItem(title: KMLocalizedString("Delete All Snapshots"), action: #selector(deleteAllSnapshot), target: self)
|
|
itemDeleteAllSnapshot?.representedObject = controller
|
|
itemDeleteAllSnapshot?.representedObject = controller
|
|
if let data = NSApp.currentEvent {
|
|
if let data = NSApp.currentEvent {
|
|
NSMenu.popUpContextMenu(menu, with: data, for: button)
|
|
NSMenu.popUpContextMenu(menu, with: data, for: button)
|
|
@@ -163,63 +163,63 @@ extension KMLeftSideViewController: NSMenuDelegate {
|
|
let pageCount = self.pageCount()
|
|
let pageCount = self.pageCount()
|
|
if (row != -1 && isLocked == false) {
|
|
if (row != -1 && isLocked == false) {
|
|
if(self.thumbnailTableView.selectedRowIndexes.count == pageCount) {
|
|
if(self.thumbnailTableView.selectedRowIndexes.count == pageCount) {
|
|
- item = menu.addItem(title: KMLocalizedString("Cut", "Menu item title"), action: nil, target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Cut"), action: nil, target: self)
|
|
} else {
|
|
} else {
|
|
- item = menu.addItem(title: KMLocalizedString("Cut", "Menu item title"), action: #selector(cutPage), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Cut"), action: #selector(cutPage), target: self)
|
|
}
|
|
}
|
|
item?.representedObject = IndexSet(integer: row)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
|
|
|
|
|
|
|
|
- item = menu.addItem(title: KMLocalizedString("Copy", "Menu item title"), action: #selector(copyPage), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Copy"), action: #selector(copyPage), target: self)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
|
|
|
|
if (self.copyPages.count > 0) {
|
|
if (self.copyPages.count > 0) {
|
|
- item = menu.addItem(title: KMLocalizedString("Paste", "Menu item title"), action: #selector(pastePage), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Paste"), action: #selector(pastePage), target: self)
|
|
}else{
|
|
}else{
|
|
- item = menu.addItem(title: KMLocalizedString("Paste", "Menu item title"), action: nil, target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Paste"), action: nil, target: self)
|
|
}
|
|
}
|
|
item?.representedObject = IndexSet(integer: row)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
|
|
|
|
menu.addItem(.separator())
|
|
menu.addItem(.separator())
|
|
|
|
|
|
if(self.thumbnailTableView.selectedRowIndexes.count == pageCount) {
|
|
if(self.thumbnailTableView.selectedRowIndexes.count == pageCount) {
|
|
- item = menu.addItem(title: KMLocalizedString("Delete", "Menu item title"), action: nil, target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Delete"), action: nil, target: self)
|
|
} else {
|
|
} else {
|
|
- item = menu.addItem(title: KMLocalizedString("Delete", "Menu item title"), action: #selector(deletePage), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Delete"), action: #selector(deletePage), target: self)
|
|
}
|
|
}
|
|
item?.representedObject = IndexSet(integer: row)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
|
|
|
|
menu.addItem(.separator())
|
|
menu.addItem(.separator())
|
|
|
|
|
|
- item = menu.addItem(title: KMLocalizedString("Rotate", "Menu item title"), action: #selector(rotatePageMenuAction), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Rotate"), action: #selector(rotatePageMenuAction), target: self)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
|
|
|
|
- item = menu.addItem(title: KMLocalizedString("Insert", "Menu item title"), action: nil, target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Insert"), action: nil, target: self)
|
|
let subMenu = NSMenu()
|
|
let subMenu = NSMenu()
|
|
- _ = subMenu.addItem(title: KMLocalizedString("Blank Page", "Menu item title"), action: #selector(quickInsert), target: self)
|
|
|
|
- _ = subMenu.addItem(title: KMLocalizedString("Blank Page - Custom...", "Menu item title"), action: #selector(insert), target: self)
|
|
|
|
- _ = subMenu.addItem(title: KMLocalizedString("From PDF", "Menu item title"), action: #selector(insertPDF), target: self)
|
|
|
|
|
|
+ _ = subMenu.addItem(title: KMLocalizedString("Blank Page"), action: #selector(quickInsert), target: self)
|
|
|
|
+ _ = subMenu.addItem(title: KMLocalizedString("Blank Page - Custom..."), action: #selector(insert), target: self)
|
|
|
|
+ _ = subMenu.addItem(title: KMLocalizedString("From PDF"), action: #selector(insertPDF), target: self)
|
|
item?.submenu = subMenu
|
|
item?.submenu = subMenu
|
|
item?.representedObject = IndexSet(integer: row)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
|
|
|
|
- item = menu.addItem(title: KMLocalizedString("Extract", "Menu item title"), action: #selector(extractPage), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Extract"), action: #selector(extractPage), target: self)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
|
|
|
|
- item = menu.addItem(title: KMLocalizedString("Page Edit", "Menu item title"), action: #selector(pageEdit), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Page Edit"), action: #selector(pageEdit), target: self)
|
|
|
|
|
|
menu.addItem(.separator())
|
|
menu.addItem(.separator())
|
|
|
|
|
|
var displayStr = ""
|
|
var displayStr = ""
|
|
if (self.isDisplayPageSize) {
|
|
if (self.isDisplayPageSize) {
|
|
- displayStr = KMLocalizedString("Hide Page Size", "Menu item title")
|
|
|
|
|
|
+ displayStr = KMLocalizedString("Hide Page Size")
|
|
} else {
|
|
} else {
|
|
- displayStr = KMLocalizedString("Display Page Size", "Menu item title")
|
|
|
|
|
|
+ displayStr = KMLocalizedString("Display Page Size")
|
|
}
|
|
}
|
|
item = menu.addItem(title: displayStr, action: #selector(displayPageSize), target: self)
|
|
item = menu.addItem(title: displayStr, action: #selector(displayPageSize), target: self)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
item?.representedObject = IndexSet(integer: row)
|
|
|
|
|
|
if let doct = self.pdfDocument() {
|
|
if let doct = self.pdfDocument() {
|
|
- item = menu.addItem(title: KMLocalizedString("Share", "Menu item title"), action: nil, target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Share"), action: nil, target: self)
|
|
|
|
|
|
var tName = self.fileNameWithSelectedPages(self.thumbnailTableView.selectedRowIndexes)
|
|
var tName = self.fileNameWithSelectedPages(self.thumbnailTableView.selectedRowIndexes)
|
|
if (tName.count > 50) {
|
|
if (tName.count > 50) {
|
|
@@ -245,15 +245,15 @@ extension KMLeftSideViewController: NSMenuDelegate {
|
|
let hideNotes = self.hideNotes()
|
|
let hideNotes = self.hideNotes()
|
|
let allowsNotes = self.allowsNotes()
|
|
let allowsNotes = self.allowsNotes()
|
|
if hideNotes == false && allowsNotes {
|
|
if hideNotes == false && allowsNotes {
|
|
- item = menu.addItem(withTitle: KMLocalizedString("Add New Circle", "Menu item title"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.circle.rawValue)
|
|
|
|
|
|
+ item = menu.addItem(withTitle: KMLocalizedString("Add New Circle"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.circle.rawValue)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
- item = menu.addItem(withTitle: KMLocalizedString("Add New Rectangle", "Menu item title"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.square.rawValue)
|
|
|
|
|
|
+ item = menu.addItem(withTitle: KMLocalizedString("Add New Rectangle"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.square.rawValue)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
- item = menu.addItem(withTitle: KMLocalizedString("Add New Highlight", "Menu item title"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.highlight.rawValue)
|
|
|
|
|
|
+ item = menu.addItem(withTitle: KMLocalizedString("Add New Highlight"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.highlight.rawValue)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
- item = menu.addItem(withTitle: KMLocalizedString("Add New Underline", "Menu item title"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.underline.rawValue)
|
|
|
|
|
|
+ item = menu.addItem(withTitle: KMLocalizedString("Add New Underline"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.underline.rawValue)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
- item = menu.addItem(withTitle: KMLocalizedString("Add New Strikethrough", "Menu item title"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.strikeOut.rawValue)
|
|
|
|
|
|
+ item = menu.addItem(withTitle: KMLocalizedString("Add New Strikethrough"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.strikeOut.rawValue)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -274,21 +274,21 @@ extension KMLeftSideViewController: NSMenuDelegate {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- item = menu.addItem(title: KMLocalizedString("Select", "Menu item title"), action: #selector(selectSelections), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Select"), action: #selector(selectSelections), target: self)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
menu.addItem(.separator())
|
|
menu.addItem(.separator())
|
|
let hideNotes = self.hideNotes()
|
|
let hideNotes = self.hideNotes()
|
|
let allowsNotes = self.allowsNotes()
|
|
let allowsNotes = self.allowsNotes()
|
|
if hideNotes == false && allowsNotes {
|
|
if hideNotes == false && allowsNotes {
|
|
- item = menu.addItem(withTitle: KMLocalizedString("Add New Circle", "Menu item title"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.circle.rawValue)
|
|
|
|
|
|
+ item = menu.addItem(withTitle: KMLocalizedString("Add New Circle"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.circle.rawValue)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
- item = menu.addItem(withTitle: KMLocalizedString("Add New Rectangle", "Menu item title"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.square.rawValue)
|
|
|
|
|
|
+ item = menu.addItem(withTitle: KMLocalizedString("Add New Rectangle"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.square.rawValue)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
- item = menu.addItem(withTitle: KMLocalizedString("Add New Highlight", "Menu item title"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.highlight.rawValue)
|
|
|
|
|
|
+ item = menu.addItem(withTitle: KMLocalizedString("Add New Highlight"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.highlight.rawValue)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
- item = menu.addItem(withTitle: KMLocalizedString("Add New Underline", "Menu item title"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.underline.rawValue)
|
|
|
|
|
|
+ item = menu.addItem(withTitle: KMLocalizedString("Add New Underline"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.underline.rawValue)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
- item = menu.addItem(withTitle: KMLocalizedString("Add New Strikethrough", "Menu item title"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.strikeOut.rawValue)
|
|
|
|
|
|
+ item = menu.addItem(withTitle: KMLocalizedString("Add New Strikethrough"), action: #selector(addAnnotationsForSelections), target: self, tag: CAnnotationType.strikeOut.rawValue)
|
|
item?.representedObject = selections
|
|
item?.representedObject = selections
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -299,38 +299,38 @@ extension KMLeftSideViewController: NSMenuDelegate {
|
|
let controller = model.windowC
|
|
let controller = model.windowC
|
|
|
|
|
|
if let data = controller?.window?.isVisible, data {
|
|
if let data = controller?.window?.isVisible, data {
|
|
- item = menu.addItem(title: KMLocalizedString("Hide", "Menu item title"), action: #selector(hideSnapshot), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Hide"), action: #selector(hideSnapshot), target: self)
|
|
item?.representedObject = controller
|
|
item?.representedObject = controller
|
|
} else {
|
|
} else {
|
|
- item = menu.addItem(title: KMLocalizedString("Show", "Menu item title"), action: #selector(showSnapshot), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Show"), action: #selector(showSnapshot), target: self)
|
|
item?.representedObject = controller
|
|
item?.representedObject = controller
|
|
}
|
|
}
|
|
menu.addItem(.separator())
|
|
menu.addItem(.separator())
|
|
|
|
|
|
- item = menu.addItem(title: KMLocalizedString("Export", "Menu item title"), action: nil, target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Export"), action: nil, target: self)
|
|
let subMenu = NSMenu()
|
|
let subMenu = NSMenu()
|
|
|
|
|
|
- var t = subMenu.addItem(title: KMLocalizedString("PNG", "Menu item title"), action: #selector(menuItemClick_ExportPNG), target: self)
|
|
|
|
|
|
+ var t = subMenu.addItem(title: KMLocalizedString("PNG"), action: #selector(menuItemClick_ExportPNG), target: self)
|
|
t?.representedObject = controller
|
|
t?.representedObject = controller
|
|
|
|
|
|
- t = subMenu.addItem(title: KMLocalizedString("JPG", "Menu item title"), action: #selector(menuItemClick_ExportJPG), target: self)
|
|
|
|
|
|
+ t = subMenu.addItem(title: KMLocalizedString("JPG"), action: #selector(menuItemClick_ExportJPG), target: self)
|
|
t?.representedObject = controller
|
|
t?.representedObject = controller
|
|
|
|
|
|
- t = subMenu.addItem(title: KMLocalizedString("PDF", "Menu item title"), action: #selector(menuItemClick_ExportPDF), target: self)
|
|
|
|
|
|
+ t = subMenu.addItem(title: KMLocalizedString("PDF"), action: #selector(menuItemClick_ExportPDF), target: self)
|
|
t?.representedObject = controller
|
|
t?.representedObject = controller
|
|
item?.submenu = subMenu
|
|
item?.submenu = subMenu
|
|
|
|
|
|
- item = menu.addItem(title: KMLocalizedString("Print", "Menu item title"), action: #selector(menuItemClick_Print), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Print"), action: #selector(menuItemClick_Print), target: self)
|
|
item?.representedObject = controller
|
|
item?.representedObject = controller
|
|
menu.addItem(.separator())
|
|
menu.addItem(.separator())
|
|
|
|
|
|
- item = menu.addItem(title: KMLocalizedString("Copy", "Menu item title"), action: #selector(menuItemClick_Copy), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Copy"), action: #selector(menuItemClick_Copy), target: self)
|
|
item?.representedObject = controller
|
|
item?.representedObject = controller
|
|
menu.addItem(.separator())
|
|
menu.addItem(.separator())
|
|
|
|
|
|
- item = menu.addItem(title: KMLocalizedString("Delete", "Menu item title"), action: #selector(deleteSnapshot), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Delete"), action: #selector(deleteSnapshot), target: self)
|
|
item?.representedObject = controller
|
|
item?.representedObject = controller
|
|
- item = menu.addItem(title: KMLocalizedString("Delete All Snapshots", "Menu item title"), action: #selector(deleteAllSnapshot), target: self)
|
|
|
|
|
|
+ item = menu.addItem(title: KMLocalizedString("Delete All Snapshots"), action: #selector(deleteAllSnapshot), target: self)
|
|
item?.representedObject = controller
|
|
item?.representedObject = controller
|
|
}
|
|
}
|
|
} else if menu.isEqual(to: self.noteOutlineView.menu) {
|
|
} else if menu.isEqual(to: self.noteOutlineView.menu) {
|