View Single Post
Old 11-10-2010, 09:35 PM   #13
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1345754
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Ok, got my action plugged into the menu. For anyone else's info who follows in my footsteps (and for Kovid to tell me if I did wrong) I did these steps:

1. Add your implementation class file into \src\calibre\gui2\actions

2. Edit src\calibre\customize\builtins.py to add the wrapper class implementation pointing to the above. Also add the name of that wrapper class to the 'plugins' variable array.

3. Edit src\calibre\gui2\__init__.py to ensure the context menu item actually physically appears in the 'action-layout-context-menu' array in appropriate place you want it to appear in the menu. The value you add here matches that of the 'name' property of the implementation class.

4. Begin many iterations of opening and closing calibre as you learn how to write code in Python

I've got a working (crude) implementation though of launching the webpage for fantasticfiction for the current selected author which was the first goal so stoked with that. Thanks for the help to get up and running!
kiwidude is offline   Reply With Quote