disable/enable tool without deleting/installing extensions?



  • As in the topic:
    Is it possible to enable/disable the tool by code without deleting/installing the extension? Is there a list of available tools that are waiting to be activated or deactivated?

    It would be wonderful for me :D


  • admin

    hello @RafaŁ-Buchner,

    have a look at the MyToolActivator example here.

    does this solve your problem?

    cheers!



  • delayed Thanks!

    Btw: is it possible to load the list of tool objects, that are appearing in glyph window toolbar without opening glyph window?

    right now in order to get those tools, I'm creating an observer for glyphWindowDidOpen event. So the list self.tools is created when the glyph window is opened for the first time. I'm doing it because I don't know the other way of getting tool objects than getActiveEventTool.

    def glyphWindowDidOpenCallback(self, info):
         toolNames = getToolOrder()
         currentToolName = getActiveEventTool().__class__.__name__
         # populating self.tools list
         for toolName in toolNames:
             setActiveEventTool(toolName)
             toolObj = getActiveEventTool()
             self.tools += [toolObj]
         # Resetting the tool, to the one that was active before th loop
         setActiveEventTool(currTool)
         removeObserver(self, 'glyphWindowDidOpen')
    

  • admin

    Why do you need those tool objects? Im trying to understand your question ;)