#4258 Rename Grid Cross Plot "Curve Sets" to "Data Sets". Also renamed code

* Kept XML-strings to avoid breaking compatibility
This commit is contained in:
Gaute Lindkvist
2019-03-29 13:17:39 +01:00
parent 014f389fe3
commit 59229b89b7
25 changed files with 266 additions and 266 deletions

View File

@@ -0,0 +1,61 @@
#include "RicSwapGridCrossPlotDataSetAxesFeature.h"
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotDataSet.h"
#include <cafSelectionManager.h>
#include <QAction>
CAF_CMD_SOURCE_INIT(RicSwapGridCrossPlotDataSetAxesFeature, "RicSwapGridCrossPlotDataSetAxesFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicSwapGridCrossPlotDataSetAxesFeature::isCommandEnabled()
{
if (caf::SelectionManager::instance()->selectedItemOfType<RimGridCrossPlotDataSet>())
{
return true;
}
else if (caf::SelectionManager::instance()->selectedItemOfType<RimGridCrossPlot>())
{
auto plot = caf::SelectionManager::instance()->selectedItemOfType<RimGridCrossPlot>();
if (!plot->dataSets().empty())
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSwapGridCrossPlotDataSetAxesFeature::onActionTriggered(bool isChecked)
{
if (caf::SelectionManager::instance()->selectedItemOfType<RimGridCrossPlotDataSet>())
{
auto dataSet = caf::SelectionManager::instance()->selectedItemOfType<RimGridCrossPlotDataSet>();
dataSet->swapAxisProperties(true);
}
else if (caf::SelectionManager::instance()->selectedItemOfType<RimGridCrossPlot>())
{
auto plot = caf::SelectionManager::instance()->selectedItemOfType<RimGridCrossPlot>();
plot->swapAxes();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSwapGridCrossPlotDataSetAxesFeature::setupActionLook(QAction* actionToSetup)
{
if (caf::SelectionManager::instance()->selectedItemOfType<RimGridCrossPlotDataSet>())
{
actionToSetup->setText("Swap Axis Properties");
}
else
{
actionToSetup->setText("Swap Axis Properties for all Data Sets in Plot");
}
actionToSetup->setIcon(QIcon(":/Swap.png"));
}