12-10-2015, 03:51 PM | #1 |
Member
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 ?
|
12-10-2015, 04:06 PM | #2 |
Ex-Helpdesk Junkie
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. |
Advert | |
|
12-10-2015, 04:44 PM | #3 |
Member
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 |
12-10-2015, 04:58 PM | #4 | |
Well trained by Cats
Posts: 29,809
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:
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 |
|
12-10-2015, 05:04 PM | #5 |
Member
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. |
Advert | |
|
12-10-2015, 05:08 PM | #6 |
Ex-Helpdesk Junkie
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... |
12-10-2015, 05:18 PM | #7 |
null operator (he/him)
Posts: 20,575
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 |
12-10-2015, 05:23 PM | #8 | |
Well trained by Cats
Posts: 29,809
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:
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 |
|
12-10-2015, 06:21 PM | #9 |
Ex-Helpdesk Junkie
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. |
12-10-2015, 08:11 PM | #10 |
Grand Sorcerer
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. |
12-11-2015, 10:08 AM | #11 |
Member
Posts: 11
Karma: 10
Join Date: Dec 2015
Device: Amazon Kindle 4
|
I've done exactly that
Thanks for help. |
|
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 |