mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Also use same path for creating highlight
This commit is contained in:
parent
f259e86cb3
commit
d6498bf837
@ -82,7 +82,6 @@ class Highlights(QListWidget):
|
||||
class HighlightsPanel(QWidget):
|
||||
|
||||
jump_to_cfi = pyqtSignal(object)
|
||||
add_highlight = pyqtSignal()
|
||||
request_highlight_action = pyqtSignal(object, object)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
@ -145,3 +144,6 @@ class HighlightsPanel(QWidget):
|
||||
if h is None:
|
||||
return self.no_selected_highlight()
|
||||
self.request_highlight_action.emit(h['uuid'], 'delete')
|
||||
|
||||
def add_highlight(self):
|
||||
self.request_highlight_action.emit(None, 'create')
|
||||
|
@ -155,7 +155,6 @@ class EbookViewer(MainWindow):
|
||||
self.bookmarks_dock.setWidget(w)
|
||||
|
||||
self.highlights_widget = w = HighlightsPanel(self)
|
||||
w.add_highlight.connect(self.add_highlight)
|
||||
self.highlights_dock.setWidget(w)
|
||||
|
||||
self.web_view = WebView(self)
|
||||
@ -339,9 +338,6 @@ class EbookViewer(MainWindow):
|
||||
def bookmark_activated(self, cfi):
|
||||
self.web_view.goto_cfi(cfi)
|
||||
|
||||
def add_highlight(self):
|
||||
self.web_view.trigger_shortcut('create_annotation')
|
||||
|
||||
def view_image(self, name):
|
||||
path = get_path_for_name(name)
|
||||
if path:
|
||||
|
@ -1191,6 +1191,9 @@ class View:
|
||||
self.show_name(sr.file_name, initial_position={'type':'search_result', 'search_result':sr, 'replace_history':True})
|
||||
|
||||
def highlight_action(self, uuid, which):
|
||||
if which is 'create':
|
||||
self.iframe_wrapper.send_message('create_annotation')
|
||||
return
|
||||
spine = self.book.manifest.spine
|
||||
spine_index = self.annotations_manager.spine_index_for_highlight(uuid, spine)
|
||||
if spine_index < 0 or spine_index >= spine.length:
|
||||
|
Loading…
x
Reference in New Issue
Block a user