diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MuonAnalysis.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MuonAnalysis.h index eea253f4b172..cd9c92533715 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MuonAnalysis.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MuonAnalysis.h @@ -237,15 +237,18 @@ private slots: private: - // Types of entities we are dealing with + /// Types of entities we are dealing with enum ItemType { Pair, Group }; - // Possible plot types users might request + /// Possible plot types users might request enum PlotType { Asymmetry, Counts, Logorithm }; - // Types of periods + /// Types of periods enum PeriodType { First, Second }; + /// Types of new plot policies + enum NewPlotPolicy { NewWindow, PreviousWindow }; + /// Initialize local Python environment void initLocalPython(); @@ -505,6 +508,9 @@ private slots: /// When data loaded set various buttons etc to active void nowDataAvailable(); + /// Return currently selected new plot policy + NewPlotPolicy newPlotPolicy(); + /// handles option tab work MantidQt::CustomInterfaces::Muon::MuonAnalysisOptionTab* m_optionTab; /// handles fit data work diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp index cd13cc71db8c..b9481823ed56 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp @@ -399,8 +399,9 @@ void MuonAnalysis::plotItem(ItemType itemType, int tableRow, PlotType plotType) setCurrentDataName( wsNameQ ); } - catch(...) + catch(std::exception& e) { + g_log.error(e.what()); QMessageBox::critical( this, "MuonAnalysis - Error", "Unable to plot the item. Check log for details." ); } @@ -3546,6 +3547,26 @@ void MuonAnalysis::nowDataAvailable() m_uiForm.guessAlphaButton->setEnabled(true); } +/** + * @return Currently selected new plot policy + */ +MuonAnalysis::NewPlotPolicy MuonAnalysis::newPlotPolicy() +{ + QMap policyMap; + policyMap["Create new window"] = NewWindow; + policyMap["Use previous window"] = PreviousWindow; + + QString selectedPolicy = m_uiForm.newPlotPolicy->currentText(); + if ( !policyMap.contains(selectedPolicy) ) + { + throw std::runtime_error("Unknown new plot policy selection"); + } + else + { + return policyMap[selectedPolicy]; + } +} + void MuonAnalysis::openDirectoryDialog() {