pick position remembers selected destination graph; closes #62
This commit is contained in:
parent
45d319834b
commit
753cd06dd1
@ -187,9 +187,15 @@ class PointSelectWidget(QtWidgets.QWidget, Ui_Form):
|
||||
self.peaktable.blockSignals(False)
|
||||
|
||||
def set_graphs(self, graphs: list):
|
||||
last_graph = self.graph_combobox.currentData()
|
||||
self.graph_combobox.clear()
|
||||
for g in graphs:
|
||||
idx = 0
|
||||
for i, g in enumerate(graphs):
|
||||
self.graph_combobox.addItem(g[1], userData=g[0])
|
||||
if g[0] == last_graph:
|
||||
idx = i
|
||||
|
||||
self.graph_combobox.setCurrentIndex(idx)
|
||||
|
||||
@QtCore.pyqtSlot(int, name='on_graph_checkbox_stateChanged')
|
||||
def changed_state(self, checked):
|
||||
|
@ -239,6 +239,8 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow):
|
||||
|
||||
self.actionConcatenate_sets.triggered.connect(lambda : self.management.cat())
|
||||
|
||||
self.management.graphs.valueChanged.connect(self.update_graph_list)
|
||||
|
||||
@QtCore.pyqtSlot(name='on_action_open_triggered')
|
||||
def open(self):
|
||||
filedialog = OpenFileDialog(directory=self.path, caption='Open files',
|
||||
@ -412,6 +414,12 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow):
|
||||
if self.area.subWindowList():
|
||||
self.area.activateNextSubWindow()
|
||||
|
||||
@QtCore.pyqtSlot()
|
||||
def update_graph_list(self):
|
||||
graph_list = self.management.graphs.list()
|
||||
self.t1tauwidget.set_graphs(graph_list)
|
||||
self.ptsselectwidget.set_graphs(graph_list)
|
||||
|
||||
@QtCore.pyqtSlot(str)
|
||||
def set_graph(self, key: str):
|
||||
w = self.management.graphs[key]
|
||||
|
Loading…
Reference in New Issue
Block a user