Skip to content

Commit

Permalink
refs #6279. Fix. Should return to consistent state.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Dec 11, 2012
1 parent de2026a commit aa786a3
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Code/Mantid/MantidQt/SliceViewer/src/SliceViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2182,10 +2182,24 @@ void SliceViewer::peakOverlay_toggled(bool checked)
{
IPeaksWorkspace_sptr peaksWS = AnalysisDataService::Instance().retrieveWS<IPeaksWorkspace>(list[i].toStdString());
PeakOverlayViewFactory_sptr viewFactory = boost::make_shared<PeakOverlayFactory>(m_plot, m_plot->canvas(), m_peaksPresenter->size());
m_peaksPresenter->addPeaksPresenter(boost::make_shared<ConcretePeaksPresenter>(viewFactory, peaksWS, transformFactory));
try
{
m_peaksPresenter->addPeaksPresenter(boost::make_shared<ConcretePeaksPresenter>(viewFactory, peaksWS, transformFactory));
}
catch(std::invalid_argument& e)
{
// Uncheck the button for consistency.
ui.btnPeakOverlay->setChecked(false);
throw e;
}
}
updatePeakOverlaySliderWidget();
}
else
{
// Uncheck the button for consistency.
ui.btnPeakOverlay->setChecked(false);
}
}
}
else
Expand Down

0 comments on commit aa786a3

Please sign in to comment.