| 
			
			 | 
		#1 | 
| 
			
			
			
			 Sigil developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274 
				Karma: 1101600 
				Join Date: Jan 2011 
				Location: UK 
				
				
				Device: Kindle PW, K4 NT, K3, Kobo Touch 
				
				
				 | 
	
	
	
		
		
			
			 
				
				Launching plugin routines from keyboard or icons
			 
			
			
			One question that's come up about my plugin from kiwidude is customizing the plugin's icon to change the default action when clicked - this is if I split my toolbar icon so that it can be clicked and have a drop down menu.  Right now its just a drop down menu.  There is code I can borrow, though I'm not sure if I'll change it yet.  (I know I'm not a typical user as I'm always using all the menu options while testing, but when originally using calibre - it seems so long ago - it wasn't clear that clicking on the down arrow gave a menu and it can be fiddly to make sure you click the arrow instead of the icon). 
		
	
		
		
		
		
		
		
		
		
		
		
	
	While thinking about this I was wondering if there was a central list of keyboard shortcuts that users could use to assign to plugin's to save adding (borrowed) code myself? And more than just launching the default routine launched by the plugin, I was wondering if you could choose any one of the menu options to link the shortcut to. It might be that the routines might need to be registered with calibre at startup to make them available to assign to a shortcut. And in addition to keyboard shortcuts, is it possible to add a separate icon to the toolbar for any particular menu item in a plugin (or on the new optional toolbar - whether default text/user-defined text or even an icon). This way the user can decide what function is run when clicking an icon. Maybe that needs another plugin - one that just calls the specific routine of another plugin? would that be possible?  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			There's no way for a plugin to add more than one icon to a toolbar. But you can create multiple plugins that call each other. The problem there is that you have to handle the case of both plugins not being installed simultaneously.  
		
	
		
		
		
		
		
		
		
		
		
		
	
	As for keyboard shortcuts, if you set the QAction to pave self.gui as its parent and assign it a shortcut, then the shortcut will work globally. However, calibre currently has no central clearing house for shortcuts and if you happen to conflict with an existing shorcut bad things ranging from neither shortcut working to calibre crashing will happen. This is because shortcuts in Qt are a mess. At some point I will have to create a cenrtl clearing house and refactor everything to use, it, but not some time soon  
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Sigil developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274 
				Karma: 1101600 
				Join Date: Jan 2011 
				Location: UK 
				
				
				Device: Kindle PW, K4 NT, K3, Kobo Touch 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Thanks.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| How do I change Plugin Images/Icons? | Steppa | Plugins | 8 | 01-22-2013 07:37 PM | 
| [GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 01:27 PM | 
| Your vote - keyboard or no keyboard on Kindle | mrzerga | Amazon Kindle | 56 | 03-10-2011 08:22 PM | 
| New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 01:11 PM | 
| Sony Reader Icons, Other Reader Icons and much more! | TheHeartlessHero | Deals and Resources (No Self-Promotion or Affiliate Links) | 27 | 11-21-2008 07:21 AM |