Merge branch 'Develop' of https://github.com/APEbbers/SearchBar into Develop

This commit is contained in:
Paul Ebbers 2025-01-11 15:44:30 +01:00
commit e4a112be97

View File

@ -9,7 +9,12 @@ translate = App.Qt.translate
def toolbarAction(nfo): def toolbarAction(nfo):
act = nfo["action"] 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): def subToolAction(nfo):
@ -45,7 +50,10 @@ def subToolAction(nfo):
return True return True
elif action is not None: elif action is not None:
print( 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() action.trigger()
return True return True
@ -63,14 +71,22 @@ def subToolAction(nfo):
return return
if runTool(): if runTool():
return 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): def toolbarToolTip(nfo, setParent):
workbenches = FreeCADGui.listWorkbenches() workbenches = FreeCADGui.listWorkbenches()
in_workbenches = [ in_workbenches = [
"<li>" "<li>"
+ (Serialize_SearchBar.iconToHTML(QtGui.QIcon(workbenches[wb].Icon)) if wb in workbenches else "? ") + (
Serialize_SearchBar.iconToHTML(QtGui.QIcon(workbenches[wb].Icon))
if wb in workbenches
else "? "
)
+ wb + wb
+ "</li>" + "</li>"
for wb in nfo["action"]["workbenches"] for wb in nfo["action"]["workbenches"]
@ -85,7 +101,12 @@ def toolbarToolTip(nfo, setParent):
def subToolToolTip(nfo, setParent): def subToolToolTip(nfo, setParent):
return Serialize_SearchBar.iconToHTML(nfo["icon"], 32) + "<p>" + nfo["toolTip"] + "</p>" return (
Serialize_SearchBar.iconToHTML(nfo["icon"], 32)
+ "<p>"
+ nfo["toolTip"]
+ "</p>"
)
def getAllToolbars(): def getAllToolbars():