forked from M-Labs/artiq
1
0
Fork 0

gui/experiments: fix text entry update problem with shortcuts

This commit is contained in:
Sebastien Bourdeauducq 2015-12-01 18:31:56 +08:00
parent 03f92f2de2
commit 9baf54d25e
2 changed files with 9 additions and 9 deletions

View File

@ -18,9 +18,9 @@ class _StringEntry(QtGui.QLineEdit):
def __init__(self, argument):
QtGui.QLineEdit.__init__(self)
self.setText(argument["state"])
def update():
argument["state"] = self.text()
self.editingFinished.connect(update)
def update(text):
argument["state"] = text()
self.textEdited.connect(update)
@staticmethod
def state_to_value(state):
@ -220,9 +220,9 @@ class _ExperimentDock(dockarea.Dock):
self.addWidget(pipeline_name, 1, 3)
pipeline_name.setText(scheduling["pipeline_name"])
def update_pipeline_name():
scheduling["pipeline_name"] = pipeline_name.text()
pipeline_name.editingFinished.connect(update_pipeline_name)
def update_pipeline_name(text):
scheduling["pipeline_name"] = text
pipeline_name.textEdited.connect(update_pipeline_name)
priority = QtGui.QSpinBox()
priority.setRange(-99, 99)

View File

@ -104,9 +104,9 @@ class _Explicit(LayoutWidget):
self.value))
self.value.setText(" ".join([str(x) for x in state["sequence"]]))
def update():
state["sequence"] = [float(x) for x in self.value.text().split()]
self.value.editingFinished.connect(update)
def update(text):
state["sequence"] = [float(x) for x in text.split()]
self.value.textEdited.connect(update)
class ScanController(LayoutWidget):