Fix #1923061 [ebook-viewer: Unchecking "restore open panels" resets panel locations on restart](https://bugs.launchpad.net/calibre/+bug/1923061)

This commit is contained in:
Kovid Goyal 2021-04-08 20:51:16 +05:30
parent 80364863a9
commit f772957cd7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -685,9 +685,13 @@ class EbookViewer(MainWindow):
QApplication.instance().safe_restore_geometry(self, geom) QApplication.instance().safe_restore_geometry(self, geom)
else: else:
QApplication.instance().ensure_window_on_screen(self) QApplication.instance().ensure_window_on_screen(self)
if state and get_session_pref('restore_docks', True): if state:
self.restoreState(state, self.MAIN_WINDOW_STATE_VERSION) self.restoreState(state, self.MAIN_WINDOW_STATE_VERSION)
self.inspector_dock.setVisible(False) self.inspector_dock.setVisible(False)
if not get_session_pref('restore_docks', True):
for dock_def in self.dock_defs.values():
d = getattr(self, '{}_dock'.format(dock_def.name.partition('-')[0]))
d.setVisible(False)
def quit(self): def quit(self):
self.close() self.close()