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, 03: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, 04: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: 6,171
Karma: 16228536
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.
jackie_w is offline   Reply With Quote
Advert
Old 10-04-2016, 05: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, 09: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: 24,908
Karma: 47303748
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 offline   Reply With Quote
Old 10-04-2016, 09: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: 43,776
Karma: 22666666
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 offline   Reply With Quote
Advert
Old 10-05-2016, 12: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
[GUI Plugin] Embed Comic Metadata dickloraine Plugins 113 02-22-2024 01:01 PM
Sample Plugin for the Editor DiapDealer Editor 77 12-10-2014 07:16 AM
Editor plugin question DiapDealer Development 2 07-28-2014 10:23 PM
Regarding using metadata objects in identify method of metadata download plugin api aprekates Development 1 07-06-2014 03:35 AM
[Metadata Download Plugin] Goodreads Metadata **Deprecated** kiwidude Plugins 30 04-23-2011 02:10 PM


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


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