diff --git a/src/calibre/gui2/actions/show_quickview.py b/src/calibre/gui2/actions/show_quickview.py index a0f4fe5ee662..fcfe469ccb42 100644 --- a/src/calibre/gui2/actions/show_quickview.py +++ b/src/calibre/gui2/actions/show_quickview.py @@ -8,7 +8,7 @@ from qt.core import QAction, QTimer -from calibre.gui2 import error_dialog +from calibre.gui2 import error_dialog, gprefs from calibre.gui2.actions import InterfaceAction from calibre.gui2.dialogs.quickview import Quickview @@ -83,6 +83,15 @@ def toggle_quick_view(self): def qv_button(self): return self.gui.layout_container.quick_view_button + def shutting_down(self): + is_open = True + if not self.current_instance or self.current_instance.is_closed: + is_open = False + gprefs.set('qv_open_at_shutdown', is_open) + + def needs_show_on_startup(self): + return gprefs.get('qv_open_at_shutdown', False) + def initialization_complete(self): set_quickview_action_plugin(self) self.qv_button.toggled.connect(self.toggle_quick_view) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 8e923d3cb7cf..c7189de7e2ca 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -444,7 +444,7 @@ def initialize(self, library_path, db, actions, show_gui=True): def post_initialize_actions(self): # Various post-initialization actions after an event loop tick - if self.layout_container.is_visible.quick_view: + if self.layout_container.is_visible.quick_view or self.iactions['Quickview'].needs_show_on_startup(): self.iactions['Quickview'].show_on_startup() self.listener.start_listening() self.start_smartdevice()