diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fdc40a316b..8568d5c631 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,7 @@ files: | src/Mod/Surface| src/Mod/Start| src/Mod/Test| + src/Mod/Tux| src/Mod/Web ) exclude: | diff --git a/src/Mod/Tux/CMakeLists.txt b/src/Mod/Tux/CMakeLists.txt index 656e883fc2..78995ffec2 100644 --- a/src/Mod/Tux/CMakeLists.txt +++ b/src/Mod/Tux/CMakeLists.txt @@ -30,4 +30,3 @@ INSTALL( DESTINATION Mod/Tux ) - diff --git a/src/Mod/Tux/InitGui.py b/src/Mod/Tux/InitGui.py index 86e1c49dcf..e02e7da59a 100644 --- a/src/Mod/Tux/InitGui.py +++ b/src/Mod/Tux/InitGui.py @@ -33,4 +33,3 @@ if p.GetGroup("PersistentToolbars").GetBool("Enabled", 1): import PersistentToolbarsGui else: pass - diff --git a/src/Mod/Tux/NavigationIndicatorGui.py b/src/Mod/Tux/NavigationIndicatorGui.py index 243a6a8d89..e20c0be897 100644 --- a/src/Mod/Tux/NavigationIndicatorGui.py +++ b/src/Mod/Tux/NavigationIndicatorGui.py @@ -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 = "
Blender " + text06 + """
+ t1 = ( + "Blender " + + text06 + + """
| """ + text01 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text04 + """ | -""" + text04 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ | +""" + + text04 + + """ |
|---|---|---|---|---|---|---|---|---|---|
CAD " + text06 + """
+ t2 = ( + "CAD " + + text06 + + """
| """ + text01 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text03 + """ | -""" + text04 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ |
|---|---|---|---|---|---|---|---|---|---|
Gesture " + text06 + """
+ t3 = ( + "Gesture " + + text06 + + """
| """ + text01 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text03 + """ | -""" + text04 + """ | -""" + text05 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ | +""" + + text05 + + """ |
|---|---|---|---|---|---|---|---|---|---|---|---|
| """ + text01 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text04 + """ | -""" + text04 + """ | -""" + text05 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ | +""" + + text04 + + """ | +""" + + text05 + + """ |
""" + text02 + ": " + text07 + """
- """ + text08 + ": " + text09 + "
"""
+ + text02
+ + ": "
+ + text07
+ + """
+ """
+ + text08
+ + ": "
+ + text09
+ + "
MayaGesture " + text06 + """
+ t4 = ( + "MayaGesture " + + text06 + + """
| """ + text01 + """ | -""" + text02 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text04 + """ | -""" + text05 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ | +""" + + text05 + + """ |
|---|---|---|---|---|---|---|---|---|---|---|---|
| """ + text01 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text04 + """ | -""" + text04 + """ | -""" + text05 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ | +""" + + text04 + + """ | +""" + + text05 + + """ |
""" + text02 + ": " + text07 + """
- """ + text08 + ": " + text09 + "
"""
+ + text02
+ + ": "
+ + text07
+ + """
+ """
+ + text08
+ + ": "
+ + text09
+ + "
OpenCascade " + text06 + """
+ t5 = ( + "OpenCascade " + + text06 + + """
| """ + text01 + """ | -""" + text02 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text04 + """ | -""" + text04 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ | +""" + + text04 + + """ |
|---|---|---|---|---|---|---|---|---|---|---|---|
OpenInventor " + text06 + """
+ t6 = ( + "OpenInventor " + + text06 + + """
| """ + text01 + """ | -""" + text02 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text04 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ |
|---|---|---|---|---|---|---|---|---|---|
OpenSCAD " + text06 + """
+ t7 = ( + "OpenSCAD " + + text06 + + """
| """ + text01 + """ | -""" + text02 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text04 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ |
|---|---|---|---|---|---|---|---|---|---|
Revit " + text06 + """
+ t8 = ( + "Revit " + + text06 + + """
| """ + text01 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text04 + """ | -""" + text04 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ | +""" + + text04 + + """ |
|---|---|---|---|---|---|---|---|---|---|
TinkerCAD " + text06 + """
+ t9 = ( + "TinkerCAD " + + text06 + + """
| """ + text01 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text04 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ |
|---|---|---|---|---|---|---|---|
Touchpad " + text06 + """
+ t10 = ( + "Touchpad " + + text06 + + """
| """ + text01 + """ | -""" + text02 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text03 + """ | -""" + text04 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ |
|---|---|---|---|---|---|---|---|---|---|---|---|
| """ + text01 + """ | -""" + text02 + """ | -""" + text03 + """ | -""" + text03 + """ | -""" + text04 + """ | +""" + + text01 + + """ | +""" + + text02 + + """ | +""" + + text03 + + """ | +""" + + text03 + + """ | +""" + + text04 + + """ | ||
""" + text02 + ": " + text07 + "
" +""" + + text02 + + ": " + + text07 + + "
" + ) 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") diff --git a/src/Mod/Tux/PersistentToolbarsGui.py b/src/Mod/Tux/PersistentToolbarsGui.py index 5f3b4c0ed1..781766d3ba 100644 --- a/src/Mod/Tux/PersistentToolbarsGui.py +++ b/src/Mod/Tux/PersistentToolbarsGui.py @@ -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])