mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2170 Summary Cross Plot : Show/hide toolbar based on active view
This commit is contained in:
@@ -121,7 +121,7 @@ void RiuMainPlotWindow::cleanupGuiBeforeProjectClose()
|
||||
|
||||
cleanUpTemporaryWidgets();
|
||||
|
||||
m_summaryPlotToolBar->clear();
|
||||
m_summaryPlotToolBarEditor->clear();
|
||||
|
||||
setWindowTitle("Plots - ResInsight");
|
||||
}
|
||||
@@ -307,7 +307,8 @@ void RiuMainPlotWindow::createToolBars()
|
||||
}
|
||||
}
|
||||
|
||||
m_summaryPlotToolBar = new caf::PdmUiToolBarEditor("Summary Plot", this);
|
||||
m_summaryPlotToolBarEditor = new caf::PdmUiToolBarEditor("Summary Plot", this);
|
||||
m_summaryPlotToolBarEditor->hide();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -525,6 +526,24 @@ void RiuMainPlotWindow::slotSubWindowActivated(QMdiSubWindow* subWindow)
|
||||
|
||||
m_activePlotViewWindow = viewWindow;
|
||||
}
|
||||
|
||||
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>(viewWindow);
|
||||
if (summaryPlot)
|
||||
{
|
||||
std::vector<caf::PdmFieldHandle*> toolBarFields;
|
||||
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
||||
|
||||
m_summaryPlotToolBarEditor->setFields(toolBarFields);
|
||||
m_summaryPlotToolBarEditor->updateUi();
|
||||
|
||||
m_summaryPlotToolBarEditor->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_summaryPlotToolBarEditor->clear();
|
||||
|
||||
m_summaryPlotToolBarEditor->hide();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -598,19 +617,6 @@ void RiuMainPlotWindow::selectedObjectsChanged()
|
||||
}
|
||||
m_pdmUiPropertyView->showProperties(firstSelectedObject);
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> toolBarFields;
|
||||
if (firstSelectedObject)
|
||||
{
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
firstSelectedObject->firstAncestorOrThisOfType(summaryPlot);
|
||||
if (summaryPlot)
|
||||
{
|
||||
toolBarFields = summaryPlot->summaryCurveCollection()->fieldsToShowInToolbar();
|
||||
}
|
||||
}
|
||||
m_summaryPlotToolBar->setFields(toolBarFields);
|
||||
m_summaryPlotToolBar->updateUi();
|
||||
|
||||
if (uiItems.size() == 1)
|
||||
{
|
||||
// Find the reservoir view or the Plot that the selected item is within
|
||||
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
QMenu* m_windowMenu;
|
||||
|
||||
caf::PdmUiTreeView* m_projectTreeView;
|
||||
caf::PdmUiToolBarEditor* m_summaryPlotToolBar;
|
||||
caf::PdmUiToolBarEditor* m_summaryPlotToolBarEditor;
|
||||
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
||||
|
||||
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
||||
|
||||
Reference in New Issue
Block a user