aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--InitGui.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/InitGui.py b/InitGui.py
index 316d1ea..978950f 100644
--- a/InitGui.py
+++ b/InitGui.py
@@ -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):