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..279b91db60 100644
--- a/src/calibre/gui2/actions/show_quickview.py
+++ b/src/calibre/gui2/actions/show_quickview.py
@@ -87,6 +87,15 @@ class ShowQuickviewAction(InterfaceAction):
group=self.action_spec[0])
self.focus_bl_action.triggered.connect(self.focus_booklist)
+ self.focus_refresh_action = QAction(self.gui)
+ self.gui.addAction(self.focus_refresh_action)
+ self.gui.keyboard.register_shortcut('Refresh from Quickview',
+ _('Refresh Quickview'),
+ description=_('Refresh the information shown in the Quickview pane'),
+ action=self.focus_refresh_action,
+ group=self.action_spec[0])
+ self.focus_refresh_action.triggered.connect(self.refill_quickview)
+
self.search_action = QAction(self.gui)
self.gui.addAction(self.search_action)
self.gui.keyboard.register_shortcut('Search from Quickview', _('Search from Quickview'),
@@ -96,6 +105,7 @@ class ShowQuickviewAction(InterfaceAction):
self.search_action.triggered.connect(self.search_quickview)
self.search_action.changed.connect(self.set_search_shortcut)
self.menuless_qaction.changed.connect(self.set_search_shortcut)
+
self.qv_button = QuickviewButton(self.gui, self)
def initialization_complete(self):
@@ -149,11 +159,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..5c27930222 100644
--- a/src/calibre/gui2/dialogs/quickview.py
+++ b/src/calibre/gui2/dialogs/quickview.py
@@ -193,9 +193,11 @@ class Quickview(QDialog, Ui_Quickview):
self.books_table.installEventFilter(focus_filter)
self.close_button.clicked.connect(self.close_button_clicked)
+ self.refresh_button.clicked.connect(self.refill)
self.tab_order_widgets = [self.items, self.books_table, self.lock_qv,
- self.dock_button, self.search_button, self.close_button]
+ self.dock_button, self.search_button, self.refresh_button,
+ self.close_button]
for idx,widget in enumerate(self.tab_order_widgets):
widget.installEventFilter(WidgetTabFilter(widget, idx, self.tab_pressed_signal))
@@ -239,8 +241,10 @@ class Quickview(QDialog, Ui_Quickview):
self.dock_button.setText(_('Undock'))
self.dock_button.setToolTip(_('Pop up the quickview panel into its own floating window'))
self.dock_button.setIcon(QIcon(I('arrow-up.png')))
+ # Remove the ampersands from the buttons because shortcuts exist.
self.lock_qv.setText(_('Lock Quickview contents'))
self.search_button.setText(_('Search'))
+ self.refresh_button.setText(_('Refresh'))
self.gui.quickview_splitter.add_quickview_dialog(self)
self.close_button.setVisible(False)
else:
@@ -252,6 +256,13 @@ class Quickview(QDialog, Ui_Quickview):
self.dock_button.clicked.connect(self.show_as_pane_changed)
self.gui.search.cleared.connect(self.indicate_no_items)
+ # Enable the refresh button only when QV is locked
+ self.refresh_button.setEnabled(False)
+ self.lock_qv.stateChanged.connect(self.lock_qv_changed)
+
+ def lock_qv_changed(self, state):
+ self.refresh_button.setEnabled(state)
+
def add_columns_to_widget(self):
'''
Get the list of columns from the preferences. Clear the current table
@@ -267,7 +278,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 +382,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
diff --git a/src/calibre/gui2/dialogs/quickview.ui b/src/calibre/gui2/dialogs/quickview.ui
index 3f1b6c497c..87bcbe236e 100644
--- a/src/calibre/gui2/dialogs/quickview.ui
+++ b/src/calibre/gui2/dialogs/quickview.ui
@@ -148,6 +148,32 @@
+ -
+
+
+ &Refresh
+
+
+ When Quickview is locked, refresh the window using the last selected book and that book's value in the last selected column.
+
+
+ false
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 0
+ 0
+
+
+
+
-