Skip to content

Commit

Permalink
Draft: fixed bug in task panels
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Jan 31, 2016
1 parent d1a02e8 commit 87da750
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
12 changes: 7 additions & 5 deletions src/Mod/Arch/ArchComponent.py
Expand Up @@ -766,11 +766,13 @@ def claimChildren(self):
return []

def setEdit(self,vobj,mode):
taskd = ComponentTaskPanel()
taskd.obj = self.Object
taskd.update()
FreeCADGui.Control.showDialog(taskd)
return True
if mode == 0:
taskd = ComponentTaskPanel()
taskd.obj = self.Object
taskd.update()
FreeCADGui.Control.showDialog(taskd)
return True
return False

def unsetEdit(self,vobj,mode):
FreeCADGui.Control.closeDialog()
Expand Down
6 changes: 4 additions & 2 deletions src/Mod/Draft/Draft.py
Expand Up @@ -3288,8 +3288,10 @@ def execute(self,vobj):
return

def setEdit(self,vobj,mode=0):
FreeCADGui.runCommand("Draft_Edit")
return True
if mode == 0:
FreeCADGui.runCommand("Draft_Edit")
return True
return False

def unsetEdit(self,vobj,mode=0):
if FreeCAD.activeDraftCommand:
Expand Down
6 changes: 4 additions & 2 deletions src/Mod/Draft/DraftGui.py
Expand Up @@ -204,8 +204,8 @@ def getStandardButtons(self):
return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Close)
def accept(self):
if hasattr(FreeCADGui,"draftToolBar"):
print "validating"
FreeCADGui.draftToolBar.validatePoint()
return True
else:
FreeCADGui.ActiveDocument.resetEdit()
return True
Expand Down Expand Up @@ -1192,7 +1192,7 @@ def validatePoint(self):
pass
else:
self.sourceCmd.offsetHandler(offset)
else:
elif (self.labelx.isVisible()):
try:
#numx=float(self.xValue.text())
numx = self.x
Expand Down Expand Up @@ -1223,6 +1223,8 @@ def validatePoint(self):
numy = last.y + v.y
numz = last.z + v.z
self.sourceCmd.numericInput(numx,numy,numz)
else:
FreeCADGui.ActiveDocument.resetEdit()

def validateSNumeric(self):
''' send valid numeric parameters to ShapeString '''
Expand Down

0 comments on commit 87da750

Please sign in to comment.