Skip to content

Commit

Permalink
Only replot when new filename has been entered
Browse files Browse the repository at this point in the history
Refs #10299
  • Loading branch information
DanNixon committed Oct 10, 2014
1 parent 05adfa1 commit 3490ff3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Expand Up @@ -75,6 +75,9 @@ namespace CustomInterfaces
void updatePreviewPlot();
void sliceAlgDone(bool error);

private:
QString m_lastDiagFilename;

};
} // namespace CustomInterfaces
} // namespace Mantid
Expand Down
Expand Up @@ -21,7 +21,7 @@ namespace CustomInterfaces
/** Constructor
*/
IndirectDiagnostics::IndirectDiagnostics(Ui::IndirectDataReduction& uiForm, QWidget * parent) :
IndirectDataReductionTab(uiForm, parent)
IndirectDataReductionTab(uiForm, parent), m_lastDiagFilename("")
{
// Property Tree
m_propTrees["SlicePropTree"] = new QtTreePropertyBrowser();
Expand Down Expand Up @@ -227,14 +227,21 @@ namespace CustomInterfaces
*/
void IndirectDiagnostics::slicePlotRaw()
{
QString filename = m_uiForm.slice_inputFile->getFirstFilename();

// Only update if we have a different file
if(filename == m_lastDiagFilename)
return;

m_lastDiagFilename = filename;

disconnect(m_dblManager, SIGNAL(valueChanged(QtProperty*, double)), this, SLOT(updatePreviewPlot()));
disconnect(m_blnManager, SIGNAL(valueChanged(QtProperty*, bool)), this, SLOT(updatePreviewPlot()));

setDefaultInstDetails();

if ( m_uiForm.slice_inputFile->isValid() )
{
QString filename = m_uiForm.slice_inputFile->getFirstFilename();
QFileInfo fi(filename);
QString wsname = fi.baseName();

Expand Down

0 comments on commit 3490ff3

Please sign in to comment.