Skip to content

Commit

Permalink
Draft: replaced the Draft OK task button with a more clear 'Create Po…
Browse files Browse the repository at this point in the history
…int' button.
  • Loading branch information
yorikvanhavre committed Feb 9, 2016
1 parent 7ff4e28 commit 45f059d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Mod/Draft/DraftGui.py
Expand Up @@ -201,7 +201,7 @@ def __init__(self,widget,extra=None):
else:
self.form = widget
def getStandardButtons(self):
return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Close)
return int(QtGui.QDialogButtonBox.Close)
def accept(self):
if hasattr(FreeCADGui,"draftToolBar"):
return FreeCADGui.draftToolBar.validatePoint()
Expand Down Expand Up @@ -384,9 +384,11 @@ def setupToolBar(self,task=False):
xl = QtGui.QHBoxLayout()
yl = QtGui.QHBoxLayout()
zl = QtGui.QHBoxLayout()
bl = QtGui.QHBoxLayout()
self.layout.addLayout(xl)
self.layout.addLayout(yl)
self.layout.addLayout(zl)
self.layout.addLayout(bl)
self.labelx = self._label("labelx", xl)
self.xValue = self._inputfield("xValue", xl) #width=60
self.xValue.setText(self.FORMAT % 0)
Expand All @@ -396,6 +398,7 @@ def setupToolBar(self,task=False):
self.labelz = self._label("labelz", zl)
self.zValue = self._inputfield("zValue", zl)
self.zValue.setText(self.FORMAT % 0)
self.pointButton = self._pushbutton("addButton", bl, icon="Draft_AddPoint", width=100)

# text

Expand Down Expand Up @@ -491,6 +494,7 @@ def setupToolBar(self,task=False):
QtCore.QObject.connect(self.zValue,QtCore.SIGNAL("textEdited(QString)"),self.checkSpecialChars)
QtCore.QObject.connect(self.radiusValue,QtCore.SIGNAL("textEdited(QString)"),self.checkSpecialChars)
QtCore.QObject.connect(self.zValue,QtCore.SIGNAL("returnPressed()"),self.validatePoint)
QtCore.QObject.connect(self.pointButton,QtCore.SIGNAL("clicked()"),self.validatePoint)
QtCore.QObject.connect(self.radiusValue,QtCore.SIGNAL("returnPressed()"),self.validatePoint)
QtCore.QObject.connect(self.angleValue,QtCore.SIGNAL("returnPressed()"),self.validatePoint)
QtCore.QObject.connect(self.textValue,QtCore.SIGNAL("textChanged(QString)"),self.storeCurrentText)
Expand Down Expand Up @@ -613,6 +617,8 @@ def retranslateUi(self, widget=None):
self.labelz.setText(translate("draft", "Z"))
self.yValue.setToolTip(translate("draft", "Y coordinate of next point"))
self.zValue.setToolTip(translate("draft", "Z coordinate of next point"))
self.pointButton.setText(translate("draft", "Enter point"))
self.pointButton.setToolTip(translate("draft", "Enter a new point with the given coordinates"))
self.labellength.setText(translate("draft", "Length"))
self.labelangle.setText(translate("draft", "Angle"))
self.lengthValue.setToolTip(translate("draft", "Length of current segment"))
Expand Down Expand Up @@ -765,6 +771,7 @@ def hideXYZ(self):
self.xValue.hide()
self.yValue.hide()
self.zValue.hide()
self.pointButton.hide()
self.lengthValue.hide()
self.angleValue.hide()
self.angleLock.hide()
Expand Down Expand Up @@ -820,6 +827,7 @@ def pointUi(self,title=translate("draft","Point"),cancel=None,extra=None,getcoor
self.xValue.show()
self.yValue.show()
self.zValue.show()
self.pointButton.show()
if rel: self.isRelative.show()
self.xValue.setFocus()
self.xValue.selectAll()
Expand Down

0 comments on commit 45f059d

Please sign in to comment.