Quote:
Originally Posted by kovidgoyal
And you can have your plugin tell the calibre preferences dialog to use your custom widget by defining two methods on your plugin
Code:
def config_widget(self):
...
return QWidget
def save_setting(self, takes the widget returned previously and stores the settings)
...
|
Kovid,
I'm rewriting my "Search the internet" plugin to use a custom preferences dialog, so far progressing ok. However can you tell me if there is a way I am missing to persist/restore the size of the plugin configuration dialog itself? I have a grid that could be resized rather wide to show more stuff on screen, but don't want to force it super wide by default.
I figured out all the necessary code to saveGeometry() etc into the JSON file. However of course inside the config_widget() function I have no handle to the config_dialog instance that the widget will be added to. So as far as I can tell, using restoreGeometry() on a widget that does not yet have a parent is effectively useless.
It seems that at best I can set a minimumSize.
Am I missing something? Or will it require a change to Calibre so that instead Calibre takes care of persisting/restoring the size of configuration windows per plugin? (Which would be a better solution anyway so every plugin developer does not have to repeat this code)?