#1293 Added "Show Plot Data" to context menu of plots

This commit is contained in:
Magne Sjaastad
2017-03-16 08:23:27 +01:00
parent 19e988925a
commit 141257c83e
6 changed files with 638 additions and 601 deletions

View File

@@ -402,15 +402,10 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
dynamic_cast<RimSummaryCurveFilter*>(uiItem) )
{
commandIds << "RicSummaryCurveSwitchAxisFeature";
}
else if (dynamic_cast<RimSummaryPlot*>(uiItem))
{
// Do not add twice to make sure the first position in the menu is used for the action
if (!commandIds.contains("RicAsciiExportSummaryPlotFeature"))
{
commandIds << "RicAsciiExportSummaryPlotFeature";
}
commandIds << "RicAsciiExportSummaryPlotFeature";
}
else if (dynamic_cast<RimWellLogPlot*>(uiItem))
{
@@ -501,6 +496,13 @@ void RimContextCommandBuilder::appendCommandsToMenu(const QStringList& commandId
QAction* act = commandManager->action(commandIds[i]);
CVF_ASSERT(act);
for (QAction* existingAct : menu->actions())
{
// If action exist, continue to make sure the action is positioned at the first
// location of a command ID
if (existingAct == act) continue;
}
menu->addAction(act);
}
}