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_SelectGroup","Draft_SelectPlane",
"Draft_ShowSnapBar","Draft_ToggleGrid","Draft_UndoLine", "Draft_ShowSnapBar","Draft_ToggleGrid","Draft_UndoLine",
"Draft_FinishLine","Draft_CloseLine"] "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', self.snapList = ['Draft_Snap_Lock','Draft_Snap_Midpoint','Draft_Snap_Perpendicular',
'Draft_Snap_Grid','Draft_Snap_Intersection','Draft_Snap_Parallel', 'Draft_Snap_Grid','Draft_Snap_Intersection','Draft_Snap_Parallel',
'Draft_Snap_Endpoint','Draft_Snap_Angle','Draft_Snap_Center', 'Draft_Snap_Endpoint','Draft_Snap_Angle','Draft_Snap_Center',

View File

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

View File

@ -2944,7 +2944,8 @@ class ToggleConstructionMode():
"The Draft_ToggleConstructionMode FreeCAD command definition" "The Draft_ToggleConstructionMode FreeCAD command definition"
def GetResources(self): 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", 'Accel' : "C, M",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode", "Toggles the Construction Mode for next objects.")} '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" "The Draft_ToggleContinueMode FreeCAD command definition"
def GetResources(self): 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.")} 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_ToggleContinueMode", "Toggles the Continue Mode for next commands.")}
def Activated(self): def Activated(self):
FreeCADGui.draftToolBar.continueCmd.toggle() FreeCADGui.draftToolBar.toggleContinue()
class Drawing(Modifier): class Drawing(Modifier):

View File

@ -118,7 +118,8 @@ class DraftWorkbench (Workbench):
"Draft_SelectGroup","Draft_SelectPlane", "Draft_SelectGroup","Draft_SelectPlane",
"Draft_ShowSnapBar","Draft_ToggleGrid"] "Draft_ShowSnapBar","Draft_ToggleGrid"]
self.lineList = ["Draft_UndoLine","Draft_FinishLine","Draft_CloseLine"] 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', self.snapList = ['Draft_Snap_Lock','Draft_Snap_Midpoint','Draft_Snap_Perpendicular',
'Draft_Snap_Grid','Draft_Snap_Intersection','Draft_Snap_Parallel', 'Draft_Snap_Grid','Draft_Snap_Intersection','Draft_Snap_Parallel',
'Draft_Snap_Endpoint','Draft_Snap_Angle','Draft_Snap_Center', 'Draft_Snap_Endpoint','Draft_Snap_Angle','Draft_Snap_Center',