diff --git a/src/calibre/gui2/viewer/ui.py b/src/calibre/gui2/viewer/ui.py index 1461b51b69..246d11a91c 100644 --- a/src/calibre/gui2/viewer/ui.py +++ b/src/calibre/gui2/viewer/ui.py @@ -685,7 +685,7 @@ class EbookViewer(MainWindow): QApplication.instance().safe_restore_geometry(self, geom) else: QApplication.instance().ensure_window_on_screen(self) - if state: + if state and get_session_pref('restore_docks', True): self.restoreState(state, self.MAIN_WINDOW_STATE_VERSION) self.inspector_dock.setVisible(False) diff --git a/src/pyj/read_book/prefs/misc.pyj b/src/pyj/read_book/prefs/misc.pyj index c547ec1ad1..47fcf5a9d7 100644 --- a/src/pyj/read_book/prefs/misc.pyj +++ b/src/pyj/read_book/prefs/misc.pyj @@ -22,6 +22,7 @@ DEFAULTS = { 'sync_annots_user': '', 'singleinstance': False, 'auto_hide_mouse': True, + 'restore_docks': True, } @@ -74,6 +75,7 @@ def create_misc_panel(container, apply_func, cancel_func): container.append(cb('singleinstance', _('Allow only a single instance of the viewer (needs restart)'))) container.append(cb('hide_tooltips', _('Hide mouse-over tooltips in the book text'))) container.append(cb('auto_hide_mouse', _('Auto hide the mouse cursor when unused for a few seconds'))) + container.append(cb('restore_docks', _('Restore open panels such as Table of Contents, Search, etc. on restart'))) container.appendChild(create_button_box(restore_defaults, apply_func, cancel_func))