Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 07-19-2012, 02:43 AM   #1
SauliusP.
Plugin developer
SauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notes
 
SauliusP.'s Avatar
 
Posts: 108
Karma: 24394
Join Date: Feb 2012
Location: Lithuania
Device: Kindle
External plugin: how to add PluginWidget into conversion window?

After pressing "C" and bringing up the conversion windows, on the left sidebar one can choose various options. According to selected output format there is also a button for the output, e.g. "EPUB Output" or "MOBI Output". When converting from some specific formats, like PDF, there is also "PDF Input". I've found these panels are developed as PluginWidgets with UI_Form.

I am working on DOCX Input plugin, which I would like to have such "DOCX Input" widget. I have created it, added to package initialization, but it does not appear. Then I've checked Calibre's code and found, what in my opinion shows it, that only "native" plugins can have those PluginWidgets. The code snippet here:

def config_widget_for_input_plugin(plugin):
name = plugin.name.lower().replace(' ', '_')
try:
return importlib.import_module(
'calibre.gui2.convert.'+name).PluginWidget
except ImportError:
pass

Not sure, if this same procedure should load also external plugin's Widgets. Also, I believe, this widget should appear in "Common Options" to set some properties to be "sticky" or "default". Currenly my workaround is simple ConfigWidget. But it is very inconvenient, when for some particular document one wants to check particular options and needs to navigate deeply into plugin's configuration via "Customize Plugin"...

So is there a possibility for external plugin to have PluginWidget and if yes, how to properly do that? When it is simply put into dependencies, it does not appear. And if it is not possible, could I request such a feature in "some next" Calibre version?

The root cause, I believe, my DOCX Input is the only external InputFormatPlugin and I'm facing a lot of pioneering problems.

And the last question. Is it possible to use JSON config for PluginWidget? Currently all those widgets use OptionRecommendation.

Regards.
SauliusP. is offline   Reply With Quote
Old 07-19-2012, 03:29 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: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC there's no way to do that, can you open a bug report for it and I'll look into adding that when I have some time.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-19-2012, 03:32 AM   #3
SauliusP.
Plugin developer
SauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notesSauliusP. can name that song in three notes
 
SauliusP.'s Avatar
 
Posts: 108
Karma: 24394
Join Date: Feb 2012
Location: Lithuania
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post
can you open a bug report for it
Allright, will do.
SauliusP. is offline   Reply With Quote
Reply

Tags
docx, inputformatplugin, pluginwidget

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin ideas... add yours here kiwidude Plugins 1855 04-11-2024 12:03 PM
Using external application (or library) as calibre plugin janzamyslny Plugins 1 04-28-2012 10:45 AM
How do I add a Table view in my plugin? katsu Development 3 10-24-2011 12:05 PM
Can Calibre's conversion modules be used in an external console application? stodge Calibre 6 03-23-2011 08:23 PM
Plugin for external converters jjje555 Plugins 2 12-20-2009 12:27 PM


All times are GMT -4. The time now is 03:03 PM.


MobileRead.com is a privately owned, operated and funded community.