View Single Post
Old 04-22-2015, 04:48 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can add any buttons you like to the viewer toolbars, see the documentation of the ViewerPlugin.customize_ui method on how to do that.

Those buttons can trigger any action you like, including showing a dialog with config options. You will just need to use the standard PyQt QDialog class to create such a dialog.

As for how to store the configuration options, you can store them in any way that you like, just choose a unique name for the config file, so that it does not conflict with the rest of calibre's config files. Use the calibre JSONConfig class to manage the config file easily.
kovidgoyal is online now   Reply With Quote