Tux: apply clang format

This commit is contained in:
wmayer
2023-09-04 20:04:22 +02:00
committed by wwmayer
parent 728b2ec841
commit f1ef5c4729
5 changed files with 318 additions and 97 deletions

View File

@@ -16,6 +16,7 @@ files: |
src/Mod/Surface|
src/Mod/Start|
src/Mod/Test|
src/Mod/Tux|
src/Mod/Web
)
exclude: |

View File

@@ -30,4 +30,3 @@ INSTALL(
DESTINATION
Mod/Tux
)

View File

@@ -33,4 +33,3 @@ if p.GetGroup("PersistentToolbars").GetBool("Enabled", 1):
import PersistentToolbarsGui
else:
pass

View File

@@ -36,7 +36,9 @@ try:
def translate(context, text):
"convenience function for Qt 4 translator"
return QtGui.QApplication.translate(context, text, None, _encoding)
except AttributeError:
def translate(context, text):
"convenience function for Qt 5 translator"
return QtGui.QApplication.translate(context, text, None)
@@ -44,6 +46,7 @@ except AttributeError:
class IndicatorButton(QtGui.QPushButton):
"""Detect language change events."""
def __init__(self, parent=None):
super(IndicatorButton, self).__init__()
@@ -56,7 +59,7 @@ class IndicatorButton(QtGui.QPushButton):
return super(IndicatorButton, self).changeEvent(event)
def onChange(self, paramGrp, param):
if(param == "NavigationStyle"):
if param == "NavigationStyle":
setCurrent()
@@ -78,14 +81,27 @@ def retranslateUi():
t0 = translate("NavigationIndicator", "Navigation style not recognized.")
global t1
t1 = "<p align='center'><b>Blender</b> " + text06 + """</p>
t1 = (
"<p align='center'><b>Blender</b> "
+ text06
+ """</p>
<table>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationBlender_Select.svg'></td>
@@ -95,17 +111,35 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationBlender_PanAlt.svg'></td>
</tr>
</table>
<b>""" + text08 + ":</b> " + text10 + "</small></p>"
<b>"""
+ text08
+ ":</b> "
+ text10
+ "</small></p>"
)
global t2
t2 = "<p align='center'><b>CAD</b> " + text06 + """</p>
t2 = (
"<p align='center'><b>CAD</b> "
+ text06
+ """</p>
<table>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationCAD_Select.svg'></td>
@@ -115,18 +149,38 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationCAD_Pan.svg'></td>
</tr>
</table>
<b>""" + text08 + ":</b> " + text10 + "</small></p>"
<b>"""
+ text08
+ ":</b> "
+ text10
+ "</small></p>"
)
global t3
t3 = "<p align='center'><b>Gesture</b> " + text06 + """</p>
t3 = (
"<p align='center'><b>Gesture</b> "
+ text06
+ """</p>
<table>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>""" + text05 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
<th><small>"""
+ text05
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationGesture_Select.svg'></td>
@@ -137,12 +191,24 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationGesture_Tilt.svg'></td>
</tr>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>""" + text05 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
<th><small>"""
+ text05
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationGesture_SelectTouch.svg'></td>
@@ -153,19 +219,43 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationGesture_TiltTouch.svg'></td>
</tr>
</table>
<p><small><b>""" + text02 + ":</b> " + text07 + """<br>
<b>""" + text08 + ":</b> " + text09 + "</small></p>"
<p><small><b>"""
+ text02
+ ":</b> "
+ text07
+ """<br>
<b>"""
+ text08
+ ":</b> "
+ text09
+ "</small></p>"
)
global t4
t4 = "<p align='center'><b>MayaGesture</b> " + text06 + """</p>
t4 = (
"<p align='center'><b>MayaGesture</b> "
+ text06
+ """</p>
<table>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>""" + text05 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
<th><small>"""
+ text05
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationMayaGesture_Select.svg'></td>
@@ -176,12 +266,24 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationMayaGesture_Tilt.svg'></td>
</tr>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>""" + text05 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
<th><small>"""
+ text05
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationMayaGesture_SelectTouch.svg'></td>
@@ -192,19 +294,43 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationMayaGesture_TiltTouch.svg'></td>
</tr>
</table>
<p><small><b>""" + text02 + ":</b> " + text07 + """<br>
<b>""" + text08 + ":</b> " + text09 + "</small></p>"
<p><small><b>"""
+ text02
+ ":</b> "
+ text07
+ """<br>
<b>"""
+ text08
+ ":</b> "
+ text09
+ "</small></p>"
)
global t5
t5 = "<p align='center'><b>OpenCascade</b> " + text06 + """</p>
t5 = (
"<p align='center'><b>OpenCascade</b> "
+ text06
+ """</p>
<table>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationOpenCascade_Select.svg'></td>
@@ -215,16 +341,30 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationOpenCascade_PanAlt.svg'></td>
</tr>
</table>"""
)
global t6
t6 = "<p align='center'><b>OpenInventor</b> " + text06 + """</p>
t6 = (
"<p align='center'><b>OpenInventor</b> "
+ text06
+ """</p>
<table>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationOpenInventor_Select.svg'></td>
@@ -234,17 +374,35 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationOpenInventor_Pan.svg'></td>
</tr>
</table>
<b>""" + text08 + ":</b> " + text10 + "</small></p>"
<b>"""
+ text08
+ ":</b> "
+ text10
+ "</small></p>"
)
global t7
t7 = "<p align='center'><b>OpenSCAD</b> " + text06 + """</p>
t7 = (
"<p align='center'><b>OpenSCAD</b> "
+ text06
+ """</p>
<table>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationOpenSCAD_Select.svg'></td>
@@ -254,16 +412,30 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationOpenSCAD_Pan.svg'></td>
</tr>
</table>"""
)
global t8
t8 = "<p align='center'><b>Revit</b> " + text06 + """</p>
t8 = (
"<p align='center'><b>Revit</b> "
+ text06
+ """</p>
<table>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationBlender_Select.svg'></td>
@@ -273,16 +445,32 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationBlender_PanAlt.svg'></td>
</tr>
</table>
<b>""" + text08 + ":</b> " + text10 + "</small></p>"
<b>"""
+ text08
+ ":</b> "
+ text10
+ "</small></p>"
)
global t9
t9 = "<p align='center'><b>TinkerCAD</b> " + text06 + """</p>
t9 = (
"<p align='center'><b>TinkerCAD</b> "
+ text06
+ """</p>
<table>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationTinkerCAD_Select.svg'></td>
@@ -291,17 +479,33 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationTinkerCAD_Pan.svg'></td>
</tr>
</table>"""
)
global t10
t10 = "<p align='center'><b>Touchpad</b> " + text06 + """</p>
t10 = (
"<p align='center'><b>Touchpad</b> "
+ text06
+ """</p>
<table>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationTouchpad_Select.svg'></td>
@@ -312,11 +516,21 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationTouchpad_Pan.svg'></td>
</tr>
<tr>
<th><small>""" + text01 + """</small></th>
<th><small>""" + text02 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text03 + """</small></th>
<th><small>""" + text04 + """</small></th>
<th><small>"""
+ text01
+ """</small></th>
<th><small>"""
+ text02
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text03
+ """</small></th>
<th><small>"""
+ text04
+ """</small></th>
</tr>
<tr>
<td align='center'><img src=':/icons/NavigationTouchpad_SelectTouch.svg'></td>
@@ -326,7 +540,12 @@ def retranslateUi():
<td align='center'><img src=':/icons/NavigationTouchpad_PanTouch.svg'></td>
</tr>
</table>
<p><small><b>""" + text02 + ":</b> " + text07 + "</p>"
<p><small><b>"""
+ text02
+ ":</b> "
+ text07
+ "</p>"
)
menuSettings.setTitle(translate("NavigationIndicator", "Settings"))
menuOrbit.setTitle(translate("NavigationIndicator", "Orbit style"))
@@ -389,7 +608,7 @@ a1.setData("Gui::BlenderNavigationStyle")
a1.setObjectName("Indicator_NavigationBlender")
a2 = QtGui.QAction(gStyle)
a2.setIcon(QtGui.QIcon(':/icons/NavigationCAD_dark.svg'))
a2.setIcon(QtGui.QIcon(":/icons/NavigationCAD_dark.svg"))
a2.setText("CAD ")
a2.setData("Gui::CADNavigationStyle")
a2.setObjectName("Indicator_NavigationCAD")

View File

@@ -28,6 +28,7 @@ conectedToolbars = []
timer = QtCore.QTimer()
mw = Gui.getMainWindow()
def pythonToolbars():
"""Manage Python based toolbar in BIM workbench."""
@@ -85,10 +86,12 @@ def onRestore(active):
# Reduce flickering.
for i in toolbars:
if (i not in topRestore and
i not in leftRestore and
i not in rightRestore and
i not in bottomRestore):
if (
i not in topRestore
and i not in leftRestore
and i not in rightRestore
and i not in bottomRestore
):
area = mw.toolBarArea(toolbars[i])