10-04-2016, 04:23 PM | #1 |
Junior Member
Posts: 5
Karma: 10
Join Date: Oct 2016
Device: none
|
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! |
10-04-2016, 05:53 PM | #2 |
Grand Sorcerer
Posts: 6,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
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.
|
Advert | |
|
10-04-2016, 06:26 PM | #3 |
Junior Member
Posts: 5
Karma: 10
Join Date: Oct 2016
Device: none
|
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!
|
10-04-2016, 10:36 PM | #4 |
Grand Sorcerer
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
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. |
10-04-2016, 10:45 PM | #5 |
creator of calibre
Posts: 44,561
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
See the bottom of metadata/single.py for an example of how to invoke the edit metadata dialog
|
Advert | |
|
10-05-2016, 01:10 AM | #6 |
Junior Member
Posts: 5
Karma: 10
Join Date: Oct 2016
Device: none
|
Thank you Kovid! That's what I'am looking for! Great!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Embed Comic Metadata | dickloraine | Plugins | 114 | 07-14-2024 10:21 AM |
Sample Plugin for the Editor | DiapDealer | Editor | 77 | 12-10-2014 08:16 AM |
Editor plugin question | DiapDealer | Development | 2 | 07-28-2014 11:23 PM |
Regarding using metadata objects in identify method of metadata download plugin api | aprekates | Development | 1 | 07-06-2014 04:35 AM |
[Metadata Download Plugin] Goodreads Metadata **Deprecated** | kiwidude | Plugins | 30 | 04-23-2011 03:10 PM |