From 3490ff34e827c9b33626099d2bd3c62fe93833a8 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Fri, 10 Oct 2014 10:48:15 +0100 Subject: [PATCH] Only replot when new filename has been entered Refs #10299 --- .../MantidQtCustomInterfaces/IndirectDiagnostics.h | 3 +++ .../CustomInterfaces/src/IndirectDiagnostics.cpp | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDiagnostics.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDiagnostics.h index 70397b816db5..53ad5f130fd9 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDiagnostics.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDiagnostics.h @@ -75,6 +75,9 @@ namespace CustomInterfaces void updatePreviewPlot(); void sliceAlgDone(bool error); + private: + QString m_lastDiagFilename; + }; } // namespace CustomInterfaces } // namespace Mantid diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDiagnostics.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDiagnostics.cpp index 169b2b85be68..07ca6f698d15 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDiagnostics.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDiagnostics.cpp @@ -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(); @@ -227,6 +227,14 @@ 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())); @@ -234,7 +242,6 @@ namespace CustomInterfaces if ( m_uiForm.slice_inputFile->isValid() ) { - QString filename = m_uiForm.slice_inputFile->getFirstFilename(); QFileInfo fi(filename); QString wsname = fi.baseName();