Merge remote-tracking branch 'origin/2018.11.01-patch' into dev

This commit is contained in:
Magne Sjaastad
2018-12-21 08:46:27 +01:00
38 changed files with 1676 additions and 181 deletions
@@ -22,6 +22,7 @@
#include "RiaBaseDefs.h"
#include "RiaPreferences.h"
#include "RimEnsembleCurveSetCollection.h"
#include "RimProject.h"
#include "RimSummaryCurveCollection.h"
#include "RimSummaryPlot.h"
@@ -43,6 +44,7 @@
#include "cafPdmUiToolBarEditor.h"
#include "cafPdmUiTreeView.h"
#include "cafQTreeViewStateSerializer.h"
#include "cafSelectionManager.h"
#include <QCloseEvent>
#include <QDockWidget>
@@ -494,18 +496,39 @@ void RiuPlotMainWindow::updateWellLogPlotToolBar()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::updateSummaryPlotToolBar()
void RiuPlotMainWindow::updateSummaryPlotToolBar(bool forceUpdateUi)
{
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>(m_activePlotViewWindow.p());
if (summaryPlot)
{
std::vector<caf::PdmFieldHandle*> toolBarFields;
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
RimEnsembleCurveSetCollection* ensembleCurveSetColl = nullptr;
caf::PdmObjectHandle* selectedObj =
dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
if (selectedObj)
{
selectedObj->firstAncestorOrThisOfType(ensembleCurveSetColl);
}
if (ensembleCurveSetColl)
{
toolBarFields = ensembleCurveSetColl->fieldsToShowInToolbar();
}
else
{
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
}
if (!m_summaryPlotToolBarEditor->isEditorDataValid(toolBarFields))
{
m_summaryPlotToolBarEditor->setFields(toolBarFields);
}
else if (forceUpdateUi)
{
m_summaryPlotToolBarEditor->updateUi();
}
m_summaryPlotToolBarEditor->updateUi();
@@ -694,6 +717,16 @@ void RiuPlotMainWindow::selectedObjectsChanged()
m_pdmUiPropertyView->showProperties(firstSelectedObject);
if (firstSelectedObject)
{
RimSummaryPlot* summaryPlot = nullptr;
firstSelectedObject->firstAncestorOrThisOfType(summaryPlot);
if (summaryPlot)
{
updateSummaryPlotToolBar();
}
}
if (uiItems.size() == 1 && m_allowActiveViewChangeFromSelection)
{
// Find the reservoir view or the Plot that the selected item is within