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 10-04-2016, 04:23 PM   #1
notbuu
Junior Member
notbuu began at the beginning.
 
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!
notbuu is offline   Reply With Quote
Old 10-04-2016, 05:53 PM   #2
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 5,270
Karma: 12221060
Join Date: Sep 2009
Location: UK
Device: PRS-350, Kobo: Aura6", H2O, GloHD, KA1, ClaraHD, Forma
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.
jackie_w is offline   Reply With Quote
Advert
Old 10-04-2016, 06:26 PM   #3
notbuu
Junior Member
notbuu began at the beginning.
 
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!
notbuu is offline   Reply With Quote
Old 10-04-2016, 10:36 PM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 18,378
Karma: 30661118
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.
davidfor is online now   Reply With Quote
Old 10-04-2016, 10:45 PM   #5
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: 36,044
Karma: 15014823
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
kovidgoyal is online now   Reply With Quote
Advert
Old 10-05-2016, 01:10 AM   #6
notbuu
Junior Member
notbuu began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Oct 2016
Device: none
Thank you Kovid! That's what I'am looking for! Great!
notbuu is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Metadata Writer Plugin] Embed Comic Metadata dickloraine Plugins 95 09-22-2019 10:49 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


All times are GMT -4. The time now is 08:54 AM.


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