![]() |
Open Metadata Editor from plugin
Hi!
I would like to open the Metadata Editor from my plugin. I've the bookid and I guess it has something to do with calibre/src/calibre/gui2/actions/edit_metadata.py and the InterfaceAction class. Maybe it is possible via self.gui.iactions but I cannot find the way to get used to it. Does anyone know how to do it? Is it possible? Many thanks! |
Until someone more knowledgeable comes along with a better answer you could try looking at the code in one of the other calibre user interface plugins. For instance, I know the Count Pages plugin can do metadata updates on custom columns for PageCount and WordCount.
|
Thank you for your response! I've looked at the count pages plugin, but this plugin uses the table view from the main gui. I use my own view in my dialog and therefore i would like to use the metadata editor from my book selection. Nevertheless thank you for your response!
|
No, the count pages plugin is directly updating the books metadata with data it calculates or downloads. Then it triggers an update to the interface to get the list refreshed.
calibre/src/calibre/gui2/actions/edit_metadata.py isn't exactly what you want, but it does have the clues. "edit_metadata" appears to be what happens when you press the toolbar button. This collects the list of selected books and calls "edit_metadata_for". That then calls "do_edit_metadata" with the list. And that calls "edit_metadata" from "calibre.gui2.metadata.single". And that appears to be what opens the actual metadata editor. Looking at that, the problem is going to be making sure you pass the correct objects through to the editor. |
See the bottom of metadata/single.py for an example of how to invoke the edit metadata dialog
|
Thank you Kovid! That's what I'am looking for! Great!
|
| All times are GMT -4. The time now is 08:50 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.