Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-06-2021, 06:56 PM   #1
SilverWolf1793
Junior Member
SilverWolf1793 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2021
Device: none
Hi! noob question about names

So... yea... as the title said, I'm new with calibre plugin api, I think I have an idea of mostly everything except one thing...

In the example code of the documentation the ui.py file has this line:

name = 'Interface Plugin Demo'

I don't seem to be able to modify it in any way without the UI unloading although my settings are still accesible.

I'm really confused because I have already changed the name in my __init__.py and modified everything with the string or name "Interface Plugin Demo" and it works, except when I touch that single line in ui.py

why does this happen?
SilverWolf1793 is offline   Reply With Quote
Old 03-06-2021, 10:17 PM   #2
SilverWolf1793
Junior Member
SilverWolf1793 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2021
Device: none
a slight update, Im now even more confused, this simple code doesn't work:
Code:
__init__.py

from calibre.customize import InterfaceActionBase

class AdvancedSeriesCreator(InterfaceActionBase):
    name                = 'Advanced Series Creator'
    description         = 'An advanced plugin'
    supported_platforms = ['windows', 'osx', 'linux']
    author              = 'SilverWolf'
    version             = (1, 0, 0)
    minimum_calibre_version = (0, 7, 53)

    actual_plugin       = 'calibre_plugins.advanced_series_creator.ui:InterfacePlugin'
-----------------------------------------
ui.py

from calibre.gui2.actions import InterfaceAction

class InterfacePlugin(InterfaceAction):

    #name = 'Interface Plugin Demo'
    name = 'Interface Plugin Demo aasd'
    action_spec = ("Create New Series", None, 'Create a new series', 'Ctrl+Shift+F1')

    def genesis(self):
        icon = get_icons('images/icon.png')
        self.qaction.setIcon(icon)

Last edited by PeterT; 03-07-2021 at 12:39 AM.
SilverWolf1793 is offline   Reply With Quote
Old 03-06-2021, 10:56 PM   #3
SilverWolf1793
Junior Member
SilverWolf1793 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2021
Device: none
Okey.... Im hitting my self in the forehead, if anyone ever gets this issue I'll tell you how to fix it, and also this REALLY SHOULD be on the official documentation but its never mentioned.

Plugins don't add the menus by themselves, you have to activate them ON the calibre settings on preferences>interface.

If you do not do that, the plugin itself has been loaded and it may be fully functional but its prevented from showing itself on the main gui rendering its own interface "hidden" as there its no way to access to the plugin functions, the reason that the example was working to me was that I imported it as a zip from the official site, of course I just clicked next... next... next... without really realizing that I was also activating manually the menus....

so much for three days of frustration... hahaha
SilverWolf1793 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: noob question geekmaster Kindle Developer's Corner 2 07-25-2012 08:34 PM
Noob question Phoul Sony Reader 11 11-26-2010 12:38 PM
Noob question DiapDealer Kindle Developer's Corner 5 09-10-2010 01:08 AM
Hi! I'm a NOOB with a question Stacey34 Sony Reader 28 02-10-2009 08:13 PM
Noob question wgarider Calibre 2 02-07-2009 08:56 AM


All times are GMT -4. The time now is 11:18 AM.


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