Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-12-2011, 06:59 AM   #16
kiwidude
Calibre Plugins 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,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Have a look at the gui.json file, and if necessary edit the dictionary values in there if you cannot do it through the gui itself.

The dialog will only appear if it does not find that plugin name already on a menu/toolbar. The idea being that when you upgrade you don't get nagged. So if you want to test with the gui box part make sure the plugin is not on any of the four menus/toolbars, and then do Add plugin.
kiwidude is offline   Reply With Quote
Old 03-12-2011, 07:15 AM   #17
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Ok, that makes sense. On my main system I definitely added it to both toolbars before while testing (removing the dont_add_to line). So on this system, if I remove the plugin, everything looks gone. But when I add it I don't get prompted and it appears on both toolbars.

After editing the gui.json to remove all traces of the new/old version, I get the expected behaviour - I get prompted only on the initial install and it goes where I tell it.

I see that I also need to add 'context-menu-device' to the dont_add_to set since I only want users to be able to select the main toolbar when device is connected. And I'll update my instructions after doing that since users won't have to select it manually.

Thanks again.
meme is offline   Reply With Quote
Old 03-12-2011, 09:11 AM   #18
kiwidude
Calibre Plugins 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,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by kiwidude View Post
Quote:
Originally Posted by meme View Post
By the way, in preferences->customize the toolbar how do I put my custom icon next to the text name of the icon like the built-in entries?
Your other question about the icons for the Preferences->Customize the toolbar is something that has been bugging me for a while. I did look at the code once and found the reason why it would not display them - there is nothing we as plugin developers can do, it needs Calibre code changes.
I just took another look at this to remind myself what the issue is. The way the code is written currently (in gui2\preferences\toolbar.py line 50), it uses the action_spec of the InterfaceAction to get a name of the icon.

Unfortunately in our plugins we have to set the icon name in that action spec to None, because our icons are coming from the plugin zip file. Your plugin used to have an icon appear for it because you used to set that action_spec value to the name of an icon that was in Calibre.

One workaround for this that comes to mind is if the Calibre code was to support grabbing the icon from the .qaction of the InterfaceAction. I added these lines of code at line 58:
Code:
            if hasattr(self._data[row], 'qaction'):
                icon = self._data[row].qaction.icon()
                if not icon.isNull():
                    return QVariant(icon)
And as per the screenshot icons magically appear
Click image for larger version

Name:	CustomiseToolbar.png
Views:	376
Size:	82.3 KB
ID:	68208
kiwidude is offline   Reply With Quote
Old 03-12-2011, 11:49 AM   #19
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Committed.
kovidgoyal is offline   Reply With Quote
Old 03-12-2011, 04:00 PM   #20
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
I'll look forward to the release
meme is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting Menu option for "Create New Collection" is greyed out, why? geekgeek Amazon Kindle 19 10-10-2016 09:38 PM
Possible new feature: Adding a r/c menu option to add to user category items kiwidude Calibre 29 11-30-2010 09:14 AM
Error Adding Plugin modkindle Plugins 14 05-16-2010 12:14 PM
Power Mode option in diagnostics menu? scarab1 Ectaco jetBook 0 02-28-2010 10:59 PM
Microsoft to Offer Downgrade Option for Vista Business Users Azayzel Deals and Resources (No Self-Promotion or Affiliate Links) 22 09-27-2007 10:26 PM


All times are GMT -4. The time now is 08:34 AM.


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