mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remember windows size of download metadata preferences dialog
This commit is contained in:
parent
48d431f85f
commit
48f0079d06
@ -319,9 +319,12 @@ def show_config_widget(category, name, gui=None, show_restart_msg=False,
|
|||||||
:return: True iff a restart is required for the changes made by the user to
|
:return: True iff a restart is required for the changes made by the user to
|
||||||
take effect
|
take effect
|
||||||
'''
|
'''
|
||||||
|
from calibre.gui2 import gprefs
|
||||||
pl = get_plugin(category, name)
|
pl = get_plugin(category, name)
|
||||||
d = ConfigDialog(parent)
|
d = ConfigDialog(parent)
|
||||||
d.resize(750, 550)
|
d.resize(750, 550)
|
||||||
|
conf_name = 'config_widget_dialog_geometry_%s_%s'%(category, name)
|
||||||
|
geom = gprefs.get(conf_name, None)
|
||||||
d.setWindowTitle(_('Configure ') + name)
|
d.setWindowTitle(_('Configure ') + name)
|
||||||
d.setWindowIcon(QIcon(I('config.png')))
|
d.setWindowIcon(QIcon(I('config.png')))
|
||||||
bb = QDialogButtonBox(d)
|
bb = QDialogButtonBox(d)
|
||||||
@ -345,7 +348,11 @@ def show_config_widget(category, name, gui=None, show_restart_msg=False,
|
|||||||
mygui = True
|
mygui = True
|
||||||
w.genesis(gui)
|
w.genesis(gui)
|
||||||
w.initialize()
|
w.initialize()
|
||||||
|
if geom is not None:
|
||||||
|
d.restoreGeometry(geom)
|
||||||
d.exec_()
|
d.exec_()
|
||||||
|
geom = bytearray(d.saveGeometry())
|
||||||
|
gprefs[conf_name] = geom
|
||||||
rr = getattr(d, 'restart_required', False)
|
rr = getattr(d, 'restart_required', False)
|
||||||
if show_restart_msg and rr:
|
if show_restart_msg and rr:
|
||||||
from calibre.gui2 import warning_dialog
|
from calibre.gui2 import warning_dialog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user