Fixed Draft utilities menu

This commit is contained in:
Yorik van Havre 2014-02-21 18:16:25 -03:00
parent ce13d2cbab
commit 3bebf0dcea
4 changed files with 24 additions and 15 deletions

View File

@ -93,7 +93,8 @@ class ArchWorkbench(Workbench):
"Draft_SelectGroup","Draft_SelectPlane",
"Draft_ShowSnapBar","Draft_ToggleGrid","Draft_UndoLine",
"Draft_FinishLine","Draft_CloseLine"]
self.draftutils = ["Draft_Heal","Draft_FlipDimension"]
self.draftutils = ["Draft_Heal","Draft_FlipDimension",
"Draft_ToggleConstructionMode","Draft_ToggleContinueMode"]
self.snapList = ['Draft_Snap_Lock','Draft_Snap_Midpoint','Draft_Snap_Perpendicular',
'Draft_Snap_Grid','Draft_Snap_Intersection','Draft_Snap_Parallel',
'Draft_Snap_Endpoint','Draft_Snap_Angle','Draft_Snap_Center',

View File

@ -1304,18 +1304,23 @@ class DraftToolBar:
self.constrMode = checked
def toggleContinue(self):
self.continueCmd.toggle()
if hasattr(self,"panel"):
if hasattr(self.panel,"form"):
if isinstance(self.panel.form,list):
for w in self.panel.form:
c = w.findChild(QtGui.QCheckBox,"ContinueCmd")
self.continueMode = not self.continueMode
try:
if hasattr(self,"continueCmd"):
self.continueCmd.toggle()
if hasattr(self,"panel"):
if hasattr(self.panel,"form"):
if isinstance(self.panel.form,list):
for w in self.panel.form:
c = w.findChild(QtGui.QCheckBox,"ContinueCmd")
if c:
c.toggle()
else:
c = self.panel.form.findChild(QtGui.QCheckBox,"ContinueCmd")
if c:
c.toggle()
else:
c = self.panel.form.findChild(QtGui.QCheckBox,"ContinueCmd")
if c:
c.toggle()
except:
pass
def isConstructionMode(self):
if self.tray or (not self.taskmode):

View File

@ -2944,7 +2944,8 @@ class ToggleConstructionMode():
"The Draft_ToggleConstructionMode FreeCAD command definition"
def GetResources(self):
return {'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode", "Toggle construcion Mode"),
return {'Pixmap' : 'Draft_Construction',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode", "Toggle construcion Mode"),
'Accel' : "C, M",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode", "Toggles the Construction Mode for next objects.")}
@ -2956,11 +2957,12 @@ class ToggleContinueMode():
"The Draft_ToggleContinueMode FreeCAD command definition"
def GetResources(self):
return {'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_ToggleContinueMode", "Toggle continue Mode"),
return {'Pixmap' : 'Draft_Rotate',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_ToggleContinueMode", "Toggle Continue Mode"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_ToggleContinueMode", "Toggles the Continue Mode for next commands.")}
def Activated(self):
FreeCADGui.draftToolBar.continueCmd.toggle()
FreeCADGui.draftToolBar.toggleContinue()
class Drawing(Modifier):

View File

@ -118,7 +118,8 @@ class DraftWorkbench (Workbench):
"Draft_SelectGroup","Draft_SelectPlane",
"Draft_ShowSnapBar","Draft_ToggleGrid"]
self.lineList = ["Draft_UndoLine","Draft_FinishLine","Draft_CloseLine"]
self.utils = ["Draft_Heal","Draft_FlipDimension"]
self.utils = ["Draft_Heal","Draft_FlipDimension",
"Draft_ToggleConstructionMode","Draft_ToggleContinueMode"]
self.snapList = ['Draft_Snap_Lock','Draft_Snap_Midpoint','Draft_Snap_Perpendicular',
'Draft_Snap_Grid','Draft_Snap_Intersection','Draft_Snap_Parallel',
'Draft_Snap_Endpoint','Draft_Snap_Angle','Draft_Snap_Center',