Fixed double clicking bug in the viewprovider
This commit is contained in:
parent
0a743b27da
commit
3ff550f977
|
@ -69,19 +69,13 @@ class HoleGui:
|
||||||
hole = Hole(feature)
|
hole = Hole(feature)
|
||||||
body.addFeature(feature)
|
body.addFeature(feature)
|
||||||
|
|
||||||
ViewProviderHole(feature.ViewObject)
|
vp = ViewProviderHole(feature.ViewObject)
|
||||||
feature.touch()
|
feature.touch()
|
||||||
FreeCAD.ActiveDocument.recompute()
|
FreeCAD.ActiveDocument.recompute()
|
||||||
# Fit view (remove after the testing phase)
|
# Fit view (remove after the testing phase)
|
||||||
FreeCADGui.SendMsgToActiveView("ViewFit")
|
FreeCADGui.SendMsgToActiveView("ViewFit")
|
||||||
|
|
||||||
panel = TaskHole(feature)
|
vp.setEdit(vp, 1)
|
||||||
|
|
||||||
FreeCADGui.Control.showDialog(panel)
|
|
||||||
if panel.setupUi():
|
|
||||||
FreeCADGui.Control.closeDialog(panel)
|
|
||||||
return None
|
|
||||||
return panel
|
|
||||||
|
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
IconPath = FreeCAD.ConfigGet("AppHomePath") + "Mod/PartDesign/FeatureHole/PartDesign_Hole.svg"
|
IconPath = FreeCAD.ConfigGet("AppHomePath") + "Mod/PartDesign/FeatureHole/PartDesign_Hole.svg"
|
||||||
|
|
|
@ -185,6 +185,7 @@ class TaskHole:
|
||||||
|
|
||||||
# Update the UI
|
# Update the UI
|
||||||
self.updateUI()
|
self.updateUI()
|
||||||
|
return True
|
||||||
|
|
||||||
def getRefText(self, ref):
|
def getRefText(self, ref):
|
||||||
(obj, element) = ref
|
(obj, element) = ref
|
||||||
|
|
|
@ -65,16 +65,15 @@ class ViewProviderHole:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def setEdit(self,vp,mode):
|
def setEdit(self,vp,mode):
|
||||||
FreeCAD.Console.PrintMessage("setEdit\n")
|
|
||||||
panel = TaskHole(self.Object)
|
panel = TaskHole(self.Object)
|
||||||
|
|
||||||
FreeCADGui.Control.showDialog(panel)
|
FreeCADGui.Control.showDialog(panel)
|
||||||
if panel.setupUi():
|
if not panel.setupUi():
|
||||||
FreeCADGui.Control.closeDialog(panel)
|
FreeCADGui.Control.closeDialog(panel)
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def unsetEdit(self,vp,mode):
|
def unsetEdit(self,vp,mode):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user