mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-03 08:16:07 +01:00
Viewer highlights panel: Fix the "Edit notes" link not saving the changes
This commit is contained in:
parent
3e633713d9
commit
e74e14fdb0
2 changed files with 13 additions and 0 deletions
|
|
@ -422,6 +422,7 @@ class HighlightsPanel(QWidget):
|
|||
request_highlight_action = pyqtSignal(object, object)
|
||||
web_action = pyqtSignal(object, object)
|
||||
toggle_requested = pyqtSignal()
|
||||
notes_edited_signal = pyqtSignal(object, object)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QWidget.__init__(self, parent)
|
||||
|
|
@ -471,6 +472,7 @@ def notes_edited(self, text):
|
|||
if h is not None:
|
||||
h['notes'] = text
|
||||
self.web_action.emit('set-notes-in-highlight', h)
|
||||
self.notes_edited_signal.emit(h['uuid'], text)
|
||||
|
||||
def set_tooltips(self, rmap):
|
||||
a = rmap.get('create_annotation')
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ def create_dock(title, name, area, areas=Qt.DockWidgetArea.LeftDockWidgetArea |
|
|||
self.dock_visibility_changed()
|
||||
self.highlights_widget.request_highlight_action.connect(self.web_view.highlight_action)
|
||||
self.highlights_widget.web_action.connect(self.web_view.generic_action)
|
||||
self.highlights_widget.notes_edited_signal.connect(self.notes_edited)
|
||||
if continue_reading:
|
||||
self.continue_reading()
|
||||
self.setup_mouse_auto_hide()
|
||||
|
|
@ -649,6 +650,16 @@ def highlights_changed(self, highlights):
|
|||
self.highlights_widget.refresh(highlights)
|
||||
self.save_annotations()
|
||||
|
||||
def notes_edited(self, uuid, notes):
|
||||
for h in self.current_book_data['annotations_map']['highlight']:
|
||||
if h.get('uuid') == uuid:
|
||||
h['notes'] = notes
|
||||
h['timestamp'] = utcnow().isoformat()
|
||||
break
|
||||
else:
|
||||
return
|
||||
self.save_annotations()
|
||||
|
||||
def edit_book(self, file_name, progress_frac, selected_text):
|
||||
import subprocess
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue