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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user