Commit 937840f8 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui][display components] Add fileDialog for saving components

parent bf090093
......@@ -100,7 +100,7 @@ class DisplayComponentsWidget(qt.QMainWindow):
layout.addWidget(self._toolbar, 2, 5, 2, 1)
self.saveB = qt.QPushButton("Save")
self.saveB.pressed.connect(self._saveComp)
layout.addWidget(self.saveB, 3, 0)
layout.addWidget(self.saveB, 4, 0)
widget.setLayout(layout)
self.setCentralWidget(widget)
......@@ -162,8 +162,17 @@ class DisplayComponentsWidget(qt.QMainWindow):
self._scatter_rocking_curves.show()
def _saveComp(self):
write_process('/users/garrigaf/Documents/tests/Nexus/test_process1.hdf5',
'entry', self.dimensions, self.W, self.components, 1)
"""
Loads the file from a FileDialog.
"""
fileDialog = qt.QFileDialog()
fileDialog.setFileMode(fileDialog.AnyFile)
fileDialog.setAcceptMode(fileDialog.AcceptSave)
fileDialog.setOption(fileDialog.DontUseNativeDialog)
if fileDialog.exec_():
write_process(fileDialog.selectedFiles()[0], 'entry',
self.dimensions, self.W, self.components, 1)
def _activeCurveChanged(self, prev_legend=None, legend=None):
if legend:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment