diff --git a/ResultsToolbar.py b/ResultsToolbar.py index ac49aca..8f477d4 100644 --- a/ResultsToolbar.py +++ b/ResultsToolbar.py @@ -9,12 +9,7 @@ translate = App.Qt.translate def toolbarAction(nfo): act = nfo["action"] - print( - "show toolbar " - + act["toolbar"] - + " from workbenches " - + repr(act["workbenches"]) - ) + print("show toolbar " + act["toolbar"] + " from workbenches " + repr(act["workbenches"])) def subToolAction(nfo): @@ -50,10 +45,7 @@ def subToolAction(nfo): return True elif action is not None: print( - "Run action of tool " - + toolPath - + " available in workbenches " - + repr(act["workbenches"]) + "Run action of tool " + toolPath + " available in workbenches " + repr(act["workbenches"]) ) action.trigger() return True @@ -64,25 +56,21 @@ def subToolAction(nfo): else: for workbench in act["workbenches"]: print("Activating workbench " + workbench + " to access tool " + toolPath) - FreeCADGui.activateWorkbench(workbench) + try: + FreeCADGui.activateWorkbench(workbench) + except Exception: + print("Workbench not present") + return if runTool(): return - print( - "Tool " - + toolPath - + " not found, was it offered by an extension that is no longer present?" - ) + print("Tool " + toolPath + " not found, was it offered by an extension that is no longer present?") def toolbarToolTip(nfo, setParent): workbenches = FreeCADGui.listWorkbenches() in_workbenches = [ "
" - + nfo["toolTip"] - + "
" - ) + return Serialize_SearchBar.iconToHTML(nfo["icon"], 32) + "" + nfo["toolTip"] + "
" def getAllToolbars(): diff --git a/package.xml b/package.xml index 0b0e04a..c6e15d8 100644 --- a/package.xml +++ b/package.xml @@ -5,7 +5,7 @@