E-book viewer: Add an option under Preferences->Miscellaneous to not restore open panels such as Search, Table of Contents etc on restart. Fixes #1921689 [Enhancement Request: ebook-viewer: Option to save panels on exit](https://bugs.launchpad.net/calibre/+bug/1921689)

This commit is contained in:
Kovid Goyal 2021-04-08 08:47:04 +05:30
parent d2a2faae0d
commit d8b0c1bb1f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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))