Skip to content

Commit

Permalink
Improved persistent toolbars start logic
Browse files Browse the repository at this point in the history
  • Loading branch information
triplus authored and wwmayer committed May 6, 2017
1 parent 65c7138 commit d27afa1
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/Mod/Tux/PersistentToolbarsGui.py
Expand Up @@ -233,10 +233,19 @@ def onWorkbenchActivated():

def onStart():
"""Start persistent toolbars."""

onWorkbenchActivated()
mw.mainWindowClosed.connect(onClose)
mw.workbenchActivated.connect(onWorkbenchActivated)
if mw.property("eventLoop"):
start = False
try:
mw.mainWindowClosed
mw.workbenchActivated
start = True
except AttributeError:
pass
if start:
timer.stop()
onWorkbenchActivated()
mw.mainWindowClosed.connect(onClose)
mw.workbenchActivated.connect(onWorkbenchActivated)


def onClose():
Expand All @@ -246,6 +255,5 @@ def onClose():
p.RemGroup("System")


timer.setSingleShot(True)
timer.timeout.connect(onStart)
timer.start()
timer.start(500)

0 comments on commit d27afa1

Please sign in to comment.