diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/MuonAnalysis.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/MuonAnalysis.h index e763f9876d9ec0290ad66512cd95befe093074f8..792fcd97006bf6ec738644ed21f1147d5feb4935 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/MuonAnalysis.h +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/MuonAnalysis.h @@ -340,6 +340,8 @@ private: /// set labels for a single data set void updateLabels(std::string &name); + void setGroupsAndPairs(); + /// Get current plot style parameters. wsName and wsIndex are used to get /// default values if /// something is not specified diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp index 9625ee3341d3fb8539aa3ac44c48c59001a18d28..61bd89b31efdb7f2401fe124dbedd1754f11f938 100644 --- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp +++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp @@ -1528,13 +1528,26 @@ void MuonAnalysis::updateFrontAndCombo(bool updateIndexAndPlot) { if (currentI >= m_uiForm.frontGroupGroupPairComboBox->count()) { currentI = 0; } - m_uiForm.fitBrowser->setAvailableGroups(groupsAndPairs); - + setGroupsAndPairs(); if (updateIndexAndPlot) { setGroupOrPairIndexToPlot(currentI); plotCurrentGroupAndPairs(); } } +/** +* sets the selected groups and pairs +*/ +void MuonAnalysis::setGroupsAndPairs() { + auto names = m_groupingHelper.parseGroupingTable().pairNames; + auto tmp = m_groupingHelper.parseGroupingTable().groupNames; + names.insert(std::end(names), std::make_move_iterator(tmp.begin()), + std::make_move_iterator(tmp.end())); + QStringList GroupsAndPairsNames; + for (const auto &name : names) { + GroupsAndPairsNames << QString::fromStdString(name); + } + m_uiForm.fitBrowser->setAvailableGroups(GroupsAndPairsNames); +} /** * Updates widgets related to period algebra. @@ -1885,7 +1898,7 @@ void MuonAnalysis::selectMultiPeak(const QString &wsName, std::back_inserter(groupsAndPairs), &QString::fromStdString); std::transform(groups.pairNames.begin(), groups.pairNames.end(), std::back_inserter(groupsAndPairs), &QString::fromStdString); - m_uiForm.fitBrowser->setAvailableGroups(groupsAndPairs); + setGroupsAndPairs(); m_uiForm.fitBrowser->setNumPeriods(m_numPeriods); // Set the selected run, group/pair and period diff --git a/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp b/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp index 2a37c9719d476915628daa31a9e21a8a758e9b2d..02027dbc2a927b4917e1c7639ff199b3143907bc 100644 --- a/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp +++ b/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp @@ -1036,7 +1036,6 @@ void MuonFitPropertyBrowser::setAvailableGroups(const QStringList &groups) { return; } } - clearGroupCheckboxes(); QSettings settings; for (const auto group : groups) { @@ -1427,9 +1426,11 @@ void MuonFitPropertyBrowser::setAllGroupsOrPairs(const bool isItGroup) { if (isItGroup) { // all groups is index 0 m_enumManager->setValue(m_groupsToFit, 0); + setAllGroups(); } else { // all pairs is index 1 m_enumManager->setValue(m_groupsToFit, 1); + setAllPairs(); } } void MuonFitPropertyBrowser::setGroupNames(