Persistent toolbars error handling

Improved handling of potential (future) issues concerning Python based toolbars in Arch/Draft workbench.

Forum discussion:

https://forum.freecadweb.org/viewtopic.php?f=3&t=26256
This commit is contained in:
triplus
2018-01-08 19:55:18 +01:00
committed by wmayer
parent a35dd3feea
commit 3d9efc129c

View File

@@ -28,7 +28,6 @@ conectedToolbars = []
timer = QtCore.QTimer()
mw = Gui.getMainWindow()
def pythonToolbars():
"""Manage Python based toolbars in Arch and Draft workbench."""
@@ -36,9 +35,17 @@ def pythonToolbars():
if active == "DraftWorkbench" or active == "ArchWorkbench":
if hasattr(Gui, "draftToolBar"):
Gui.draftToolBar.Activated()
try:
Gui.draftToolBar.Activated()
except:
m = "Persistent toolbars: draftToolBar toolbar not managed.\n"
App.Console.PrintMessage(m)
if hasattr(Gui, "Snapper"):
Gui.Snapper.show()
try:
Gui.Snapper.show()
except:
m = "Persistent toolbars: Snapper toolbar not managed\n."
App.Console.PrintMessage(m)
else:
pass