mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Summary context menu cleanup and fixes (#9165)
* Make summary plot ctx menu items show up for the plot you right-click on, not the one selected in the project tree.
This commit is contained in:
committed by
Magne Sjaastad
parent
97d1b7b36f
commit
0c7fe7da1a
@@ -59,7 +59,17 @@ void RiuSummaryPlot::showContextMenu( QPoint pos )
|
||||
QMenu menu;
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
|
||||
menuBuilder << "RicShowPlotDataFeature";
|
||||
RimSummaryPlot* plot = dynamic_cast<RimSummaryPlot*>( plotWidget()->plotDefinition() );
|
||||
if ( plot )
|
||||
{
|
||||
QVariant plotVariant( QVariant::fromValue( static_cast<void*>( plot ) ) );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicShowPlotDataCtxFeature", "Show Plot Data", plotVariant );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicEditSummaryPlotCtxFeature", "Edit Plot", plotVariant );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicSplitMultiPlotFeature", "Split into Multiple Plots", plotVariant );
|
||||
menuBuilder.addSeparator();
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicDeleteSubPlotCtxFeature", "Delete Plot", plotVariant );
|
||||
}
|
||||
menuBuilder.addSeparator();
|
||||
|
||||
double distanceFromClick = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -192,16 +202,6 @@ void RiuSummaryPlot::showContextMenu( QPoint pos )
|
||||
}
|
||||
}
|
||||
|
||||
menuBuilder.addSeparator();
|
||||
|
||||
RimSummaryPlot* plot = dynamic_cast<RimSummaryPlot*>( plotWidget()->plotDefinition() );
|
||||
if ( plot )
|
||||
{
|
||||
QVariant plotVariant( QVariant::fromValue( static_cast<void*>( plot ) ) );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicSplitMultiPlotFeature", "Split into Multiple Plots", plotVariant );
|
||||
menuBuilder.addCmdFeatureWithUserData( "RicDeleteSubPlotFeature", "Delete Plot", plotVariant );
|
||||
}
|
||||
|
||||
menuBuilder.appendToMenu( &menu );
|
||||
|
||||
if ( !menu.actions().empty() )
|
||||
|
||||
Reference in New Issue
Block a user