Skip to content

Commit

Permalink
Fix undocked Quickview dialog not being restored at startup. Fixes #2…
Browse files Browse the repository at this point in the history
…060314 [Quickview panel on Calibre start](https://bugs.launchpad.net/calibre/+bug/2060314)
  • Loading branch information
kovidgoyal committed Apr 16, 2024
1 parent 3c9dc1b commit 4183627
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/calibre/gui2/actions/show_quickview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/calibre/gui2/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4183627

Please sign in to comment.