From a25013945a680c578b9458bddd50e8c16f856990 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sun, 30 Jul 2017 10:31:57 +0200 Subject: [PATCH] Quickview: fix regression that broke the "Lock quickview" checkbox. --- src/calibre/gui2/actions/edit_metadata.py | 2 +- src/calibre/gui2/actions/show_quickview.py | 9 ++++++++- src/calibre/gui2/dialogs/quickview.py | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/actions/edit_metadata.py b/src/calibre/gui2/actions/edit_metadata.py index 07b35c86c8..38e06480c7 100644 --- a/src/calibre/gui2/actions/edit_metadata.py +++ b/src/calibre/gui2/actions/edit_metadata.py @@ -350,7 +350,7 @@ class EditMetadataAction(InterfaceAction): self.gui.tags_view.recount_with_position_based_index() qv = get_quickview_action_plugin() if qv: - qv.refill_quickview() + qv.refresh_quickview(current) def do_edit_metadata(self, row_list, current_row, editing_multiple): from calibre.gui2.metadata.single import edit_metadata diff --git a/src/calibre/gui2/actions/show_quickview.py b/src/calibre/gui2/actions/show_quickview.py index 4003a7f5d2..a1d8bc0328 100644 --- a/src/calibre/gui2/actions/show_quickview.py +++ b/src/calibre/gui2/actions/show_quickview.py @@ -149,11 +149,18 @@ class ShowQuickviewAction(InterfaceAction): def refill_quickview(self): ''' - Called when the data or the columns shown in the QV pane might have changed. + Called when the columns shown in the QV pane might have changed. ''' if self.current_instance and not self.current_instance.is_closed: self.current_instance.refill() + def refresh_quickview(self, idx): + ''' + Called when the data shown in the QV pane might have changed. + ''' + if self.current_instance and not self.current_instance.is_closed: + self.current_instance.refresh(idx) + def change_quickview_column(self, idx): ''' Called from the column header context menu to change the QV query column diff --git a/src/calibre/gui2/dialogs/quickview.py b/src/calibre/gui2/dialogs/quickview.py index 43e8cba572..34c4fb2671 100644 --- a/src/calibre/gui2/dialogs/quickview.py +++ b/src/calibre/gui2/dialogs/quickview.py @@ -267,7 +267,7 @@ class Quickview(QDialog, Ui_Quickview): def refill(self): ''' - Refill the table in case the book data changes + Refill the table in case the columns displayed changes ''' self.add_columns_to_widget() self._refresh(self.current_book_id, self.current_key) @@ -371,7 +371,7 @@ class Quickview(QDialog, Ui_Quickview): # operation if we get an exception. The "close" will come # eventually. try: - self._refresh(mi.get('id'), self.current_key) + self.refresh(self.view.model().index(self.db.row(mi.id), self.current_column)) except: pass