diff options
-rw-r--r-- | InitGui.py | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,15 +1,20 @@ class ShowPanelCommandClass(): + + def __init__(self): + self.widgetAdded = False + def GetResources(self): return {'MenuText': "Show Panel"} def Activated(self): from PySide import QtCore import BoxerGui - print('ShowPanelCommandClass.Activated') - window = FreeCADGui.getMainWindow() - window.addDockWidget(QtCore.Qt.RightDockWidgetArea, BoxerGui.gui.dockWidget) - BoxerGui.gui.dockWidget.show() + if not self.widgetAdded: + window = FreeCADGui.getMainWindow() + window.addDockWidget(QtCore.Qt.RightDockWidgetArea, BoxerGui.gui.dockWidget) + self.widgetAdded = True + BoxerGui.gui.dockWidget.setVisible(True) return @@ -24,7 +29,7 @@ class BoxerWorkbench(Workbench): def Initialize(self): self.list = ["BoxerShowPanel"] - self.appendToolbar("Boxer Commands", self.list) + self.appendToolbar("Boxer", self.list) import BoxerGui # Loads the Boxer modules def Activated(self): |