View Single Post
Old 06-27-2012, 03:07 PM   #1
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,246
Karma: 1445996
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
[GUI Plugin] Favourites Menu

Are you…
  • Running out of screen space on your toolbar from adding plugins?
  • Always forgetting where that xyz calibre feature is located?
  • Tired of navigating deep into some menu hierarchy?
  • Wanting a menu that you can control what order things appear on, and what they are called?
  • Looking to change your life?
Now with with the patent pending all-singing and dancing Favourites Menu plugin you can build your own menu on a button! Wow!

Here are some testimonials from our actors customers:

“Every time I want the eject option for my Kindle from calibre, I can never click on that silly side arrow, it is just too darn small. Especially after a few drinks - not that I ever do of course. But thanks to kiwidude I can now have it right there on the big ol’ Favourites button just a little clickey clickey away. Cheers!”

”Well I have just about every plugin kiwidude has written. Keep them right here next to my jar of toenail clippings since 1974. But as much as I love them all, I just can’t see them on my 3.5” screen. Now I have just one button to put all of them on – I call it calibre on a button. Thanks dude!”

”I switch libraries – a lot. But every time I open the Library menu they are in a different order. My brain just couldn’t cope, it made me want to cry. But now thanks to Favourites Menu I can have just the libraries I use the most always in the same place. So that’s less time searching, and more time spent keeping my kids out of jail. Thanks kiwidude!”

”I add books using an option from the dropdown on the toolbar button. But last time I dropped it down I sprained my neck reading the description, it was so damn long on screen. I had to take a month off work, the company closed, we lost the house and my wife left me. Thanks to the Favourites Menu plugin though I can have my own ‘Add books’ menu option so it won’t happen again. You’ve literally saved my life!”

So just how much would you expect to pay have your own Favourites Menu button?
No - wait for it - if you download the Favourites Menu plugin in the next 3.2 seconds, it is absolutely free. That’s right - free! Wow!

But wait, that’s not all! If you click twice on the download button, we’ll give you not one, but two copies of the plugin. That’s two copies of the Favourites Menu plugin for no extra cost. Wow!

Our operators are standing by to take your call… 1-800-555-KIWIDUDE

Fine Print: Yes it was a slow day at work when I wrote this nonsense intro…

Main Features:
  • Create a customisable menu button with your favourite menu options
  • You can add specific menu actions, submenus or entire plugins to your own menu.
  • Add, remove, reorder and rename the menus with separators
  • Where appropriate menu items are disabled if they are not relevant to the current context - e.g. device not plugged in.

Special Notes:
  • Requires Calibre 0.8.18 or later
  • If a menu item changes its name dynamically (such as having a count in it) then it cannot be used without changes to this plugin. For instance the Reading List plugin has several of these menu items where the list name is followed by a count of items in the list. I have now added special case handling to cater for the Reading List plugin specifically, but if other such cases come up over time let me know and I will see if I can add another workaround for them.

Installation Notes:
  1. Download the attached zip file and install the plugin/restart calibre/add to context menu as described in the Introduction to plugins thread.

Notes for other plugin developers
  1. As of v1.0.3 Favourites Menu will support a plugin with its menus being rebuilt every time it is displayed (such as to enable/disable items based on the current state of calibre). The pattern for this is that your InterfaceAction class should have a .menu property representing the QMenu, and you will ordinarily have code hooked to the aboutToShow signal. When the Favourites Menu plugin is asked to dropdown will iterate through all of the child plugins it is being asked to display items for and (once per plugin) emit the signal for any plugins that have such a .menu property.
  2. If your plugin changes the name of a child item dynamically this can cause a problem for the Favourites Menu plugin (as it uses the text name displayed by a plugin as part of the "key" identifying a menu item). For instance the Reading List plugin includes a count of the items in a child list for some of its actions. To ensure such menu items can be supported by the Reading List plugin, you should simply assign a constant identifying name for the menu item to a .favourites_menu_unique_name property on your qaction at the time you create it. The Favourites Menu plugin will look for such a property being present and use that in preference to the current text name if it is present.

Paypal Donations:
  • If you find this or any of my other plugins useful please feel free to show your appreciation. I have spent many hundreds of unpaid hours in their development and support so any encouragement for me to continue is appreciated!
Version History:

Version 1.0.4 - 24 Jul 2014
Compatibility for upcoming calibre 2.0

Version 1.0.3 - 05 Nov 2012
Ensure submenus for plugins can have their states updated by emitting the aboutToShow signal for every plugin that has an associated .menu set for it

Version 1.0.2 - 06 Aug 2012
Support dynamically named menu names if they have a .favourites_menu_unique_name attribute

Version 1.0.1 - 30 Jun 2012
Add a hack to allow menu items from the Reading List plugin that have counts in them still be used in this plugin (without the counts)

Version 1.0.0 - 27 Jun 2012
Initial release of Favourites Menu plugin

Attached Thumbnails
Click image for larger version

Name:	Screenshot_1_ToolbarMenu.png
Views:	1242
Size:	17.4 KB
ID:	88413   Click image for larger version

Name:	Screenshot_2_Customize.png
Views:	1619
Size:	72.0 KB
ID:	88414  
Attached Files
File Type: zip Favourites (22.1 KB, 53801 views)

Last edited by kovidgoyal; 07-23-2014 at 11:04 PM. Reason: v1.0.3 Released
kiwidude is offline   Reply With Quote