diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.cpp index 5f0a67f1647bcef0965c1c1ff41def002018d5bc..780043b72424b1a368647ff6eec3191b3f2017e3 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.cpp @@ -37,8 +37,7 @@ void ExperimentPresenter::notifySettingsChanged() { } void ExperimentPresenter::notifyRestoreDefaultsRequested() { - m_model = experimentDefaults(m_mainPresenter->instrument()); - updateViewFromModel(); + restoreDefaults(); m_mainPresenter->notifySettingsChanged(); } @@ -112,7 +111,12 @@ void ExperimentPresenter::instrumentChanged( std::string const &instrumentName, Mantid::Geometry::Instrument_const_sptr instrument) { UNUSED_ARG(instrumentName); - m_model = experimentDefaults(instrument); + UNUSED_ARG(instrument); + restoreDefaults(); +} + +void ExperimentPresenter::restoreDefaults() { + m_model = experimentDefaults(m_mainPresenter->instrument()); updateViewFromModel(); } diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.h index 416fa6b34b68e90ccdb790836d1f198aace0f89a..42f073cd5118f3e80fc20a43d7ef974f2f29cf21 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentPresenter.h @@ -68,6 +68,9 @@ public: private: IBatchPresenter *m_mainPresenter; + + void restoreDefaults(); + ExperimentValidationResult validateExperimentFromView(); PolarizationCorrections polarizationCorrectionsFromView(); FloodCorrections floodCorrectionsFromView(); diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentPresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentPresenter.cpp index 91515da51d4569525236f2e4a9652892edaea005..7649ebcce51a19127e19708d1e1ed6d4de3392ce 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentPresenter.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentPresenter.cpp @@ -39,8 +39,7 @@ void InstrumentPresenter::notifySettingsChanged() { } void InstrumentPresenter::notifyRestoreDefaultsRequested() { - m_model = instrumentDefaults(m_mainPresenter->instrument()); - updateViewFromModel(); + restoreDefaults(); m_mainPresenter->notifySettingsChanged(); } @@ -106,7 +105,12 @@ void InstrumentPresenter::instrumentChanged( std::string const &instrumentName, Mantid::Geometry::Instrument_const_sptr instrument) { UNUSED_ARG(instrumentName); - m_model = instrumentDefaults(instrument); + UNUSED_ARG(instrument); + restoreDefaults(); +} + +void InstrumentPresenter::restoreDefaults() { + m_model = instrumentDefaults(m_mainPresenter->instrument()); updateViewFromModel(); } diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentPresenter.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentPresenter.h index dac58657f60550b1e6560e723d97b008c91fe838..9236c3037fc7c1337390293297593a02f2fbad00 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentPresenter.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentPresenter.h @@ -48,6 +48,7 @@ private: Instrument m_model; IBatchPresenter *m_mainPresenter; + void restoreDefaults(); boost::optional<RangeInLambda> wavelengthRangeFromView(); boost::optional<RangeInLambda> monitorBackgroundRangeFromView(); boost::optional<RangeInLambda> monitorIntegralRangeFromView();