diff --git a/src/calibre/gui2/dialogs/quickview.py b/src/calibre/gui2/dialogs/quickview.py index 5481c4b635..d9677bfe7e 100644 --- a/src/calibre/gui2/dialogs/quickview.py +++ b/src/calibre/gui2/dialogs/quickview.py @@ -350,7 +350,7 @@ class Quickview(QDialog, Ui_Quickview): Refill the table in case the columns displayed changes ''' self.add_columns_to_widget() - self._refresh(self.current_book_id, self.current_key) + self.refresh(self.view.currentIndex(), ignore_lock=True) def set_search_text(self, txt): self.last_search = txt @@ -461,12 +461,18 @@ class Quickview(QDialog, Ui_Quickview): gprefs['qv_respects_vls'] = self.apply_vls.isChecked() self._refresh(self.current_book_id, self.current_key) - def refresh(self, idx): + def refresh(self, idx, ignore_lock=False): ''' Given a cell in the library view, display the information. This method converts the index into the lookup key ''' - if self.lock_qv.isChecked() or not idx.isValid(): + if (not ignore_lock and self.lock_qv.isChecked()): + return + if not idx.isValid(): + from calibre.constants import DEBUG + if DEBUG: + from calibre import prints + prints('QuickView: current index is not valid') return try: diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 383d9a9a74..65ddf2a9f0 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -424,15 +424,6 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ self.hide_windows() self.auto_adder = AutoAdder(gprefs['auto_add_path'], self) - # Now that the gui is initialized we can restore the quickview state - # The same thing will be true for any action-based operation with a - # layout button - from calibre.gui2.actions.show_quickview import get_quickview_action_plugin - qv = get_quickview_action_plugin() - if qv: - qv.qv_button.restore_state() - self.save_layout_state() - # Collect cycles now gc.collect() @@ -444,6 +435,20 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ QTimer.singleShot(1, self.start_smartdevice) QTimer.singleShot(100, self.update_toggle_to_tray_action) + # Once the gui is initialized we can restore the quickview state + # The same thing will be true for any action-based operation with a + # layout button + QTimer.singleShot(20, self.start_quickview) + + def start_quickview(self): + from calibre.gui2.actions.show_quickview import get_quickview_action_plugin + qv = get_quickview_action_plugin() + if qv: + if DEBUG: + prints('Starting QuickView') + qv.qv_button.restore_state() + self.save_layout_state() + def show_gui_debug_msg(self): info_dialog(self, _('Debug mode'), '

' + _('You have started calibre in debug mode. After you '