Skip to content

Commit f250908

Browse files
committed
Separate the calculation-preview from the saving beahviour witha new button
1 parent 0bcea5f commit f250908

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/sas/qtgui/Calculators/DataOperationUtilityPanel.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def __init__(self, parent=None):
5050
self.cmdHelp.clicked.connect(self.onHelp)
5151
self.cmdCompute.clicked.connect(self.onCompute)
5252
self.cmdReset.clicked.connect(self.onReset)
53+
self.cmdSaveData.clicked.connect(self.onSaveData)
5354

5455
self.cmdCompute.setEnabled(False)
5556

@@ -141,13 +142,15 @@ def onCompute(self):
141142
# if outputname was unused, write output result to it
142143
# and display plot
143144
if self.onCheckOutputName():
144-
# add outputname to self.filenames
145-
self.list_data_items.append(str(self.txtOutputData.text()))
146-
# send result to DataExplorer
147-
self.onPrepareOutputData()
148145
# plot result
149146
self.updatePlot(self.graphOutput, self.layoutOutput, self.output)
150147

148+
def onSaveData(self):
149+
""" Save current output in data file and add it to the DataExplorer"""
150+
# add outputname to self.filenames
151+
self.list_data_items.append(str(self.txtOutputData.text()))
152+
# send result to DataExplorer
153+
self.onPrepareOutputData()
151154
# Add the new plot to the comboboxes
152155
self.cbData1.addItem(self.output.name)
153156
self.cbData2.addItem(self.output.name)

src/sas/qtgui/Calculators/UI/DataOperationUtilityUI.ui

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@
8686
</property>
8787
</widget>
8888
</item>
89+
<item>
90+
<widget class="QPushButton" name="cmdSaveData">
91+
<property name="text">
92+
<string>Save</string>
93+
</property>
94+
</widget>
95+
</item>
8996
<item>
9097
<widget class="QPushButton" name="cmdClose">
9198
<property name="minimumSize">

0 commit comments

Comments
 (0)