Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 12-10-2015, 03:51 PM   #1
stanislas
Member
stanislas began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2015
Device: Amazon Kindle 4
Selecting option.

Hi, i am creating a calibre plugin and i want my plugin to show in options after right-clicking some book. Do you have any insights on how should i do it ?
stanislas is offline   Reply With Quote
Old 12-10-2015, 04:06 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
The right-click menu is one of the "toolbars" available for GUI plugins to register an action with. See Preferences ==> Toolbar

You don't have to do anything special.
eschwartz is offline   Reply With Quote
Advert
Old 12-10-2015, 04:44 PM   #3
stanislas
Member
stanislas began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2015
Device: Amazon Kindle 4
Wow, great, thanks.
It worked, when i registered it manually.
And how should i register this action in my plugin ? - i can;t find anything helpful
stanislas is offline   Reply With Quote
Old 12-10-2015, 04:58 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by stanislas View Post
Wow, great, thanks.
It worked, when i registered it manually.
And how should i register this action in my plugin ? - i can;t find anything helpful
The official name is 'Context Menu'

Do you just want your PI to automatically be added ti the main/(when connected) menu
OR
Do you need something during the PI functioning?
BTW This is a valid question for the Development Section as that is what you are doing
theducks is online now   Reply With Quote
Old 12-10-2015, 05:04 PM   #5
stanislas
Member
stanislas began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2015
Device: Amazon Kindle 4
Oh, sorry for that. I've not noticed.
I want my plugin to be added automatically (not manually by the user) to the context menu.
And i want to know which book was chosen.
stanislas is offline   Reply With Quote
Advert
Old 12-10-2015, 05:08 PM   #6
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I don't know of any way to specify in the plugin which toolbars to be added to by default.
Although I do know how to make sure it doesn't get added to a specific toolbar...
eschwartz is offline   Reply With Quote
Old 12-10-2015, 05:18 PM   #7
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
See the Creating Plugins link at the end of this ==>> https://www.mobileread.com/forums/sho...d.php?t=118680

I don't know if you can force the PI to appear in the book list context menu, as that would fly in the face of a basic calibre tenet - that the user is in control of what features appear in what toolbars and menus. Many users never use the context (right click) menus in calibre or anything else.

Have a look at what other PI's do - I've found the Extract ISBN a good place to start - a search for 'icon' in the code should put you on the right track

BR
BetterRed is offline   Reply With Quote
Old 12-10-2015, 05:23 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by eschwartz View Post
I don't know of any way to specify in the plugin which toolbars to be added to by default.
Although I do know how to make sure it doesn't get added to a specific toolbar...
<vaguely remember somthing>
Isn't there some code for the first run (or on adding) that suggested toolbars to add the entry?

It is a 1 shot chance. From then on MANUAL

IIRC Search the Internet PI did this
theducks is online now   Reply With Quote
Old 12-10-2015, 06:21 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
No, every plugin offers that selector. Although I think you have to use the Plugin Updater.


Now, there is a variable you can use to restrict which toolbars a plugin is capable of being attached to.
Nothing I know of that will add a toolbar to the list of preselected toolbars.
eschwartz is offline   Reply With Quote
Old 12-10-2015, 08:11 PM   #10
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,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
stanislas: Having the plugin in the context menu or as a button on a toolbar works exactly the same. The select books can be determined in both circumstances. So, leave it up to the user to decide where they want the function. Personally, my context menu is so long, that adding anything to it is useless. I should be trimming it, not expanding it.

There are lots of examples of how to do this in the various plugins. I have done it a few times. I would have used one of kiwidudes plugins as an example, most likely the Modify ePub plugin. But I think I've stolen code from most of his plugins.
davidfor is offline   Reply With Quote
Old 12-11-2015, 10:08 AM   #11
stanislas
Member
stanislas began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2015
Device: Amazon Kindle 4
I've done exactly that
Thanks for help.
stanislas is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting all books? Jwt0001 Marvin 2 07-15-2014 12:03 PM
Selecting mobi only ? Ron. Calibre 2 07-30-2011 02:41 PM
Selecting and changing fonts Circleof05ths Calibre 0 05-15-2010 06:26 PM
Classic Selecting passages pedgarcia Barnes & Noble NOOK 1 01-11-2010 04:10 PM
Selecting a reader alegria Introduce Yourself 1 08-11-2007 10:55 AM


All times are GMT -4. The time now is 09:23 AM.


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