#1784 Add plot title option when pasting new summary curve

This commit is contained in:
Bjørnar Grip Fjær
2017-08-18 09:42:04 +02:00
parent aa2123d05d
commit bbb3e937d3
3 changed files with 40 additions and 8 deletions

View File

@@ -74,10 +74,18 @@ bool RicPasteAsciiDataToSummaryPlotFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicPasteAsciiDataToSummaryPlotFeature::onActionTriggered(bool isChecked)
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
RimSummaryPlot* summaryPlot = nullptr;
destinationObject->firstAncestorOrThisOfType(summaryPlot);
RicPasteAsciiDataToSummaryPlotFeatureUi pasteOptions;
if (!summaryPlot) pasteOptions.createNewPlot();
caf::PdmSettings::readFieldsFromApplicationStore(&pasteOptions);
caf::PdmUiPropertyViewDialog propertyDialog(NULL, &pasteOptions, "Set Paste Options", "");
if (propertyDialog.exec() != QDialog::Accepted) return;
if (!summaryPlot)
{
RimSummaryPlotCollection* summaryPlotCollection = nullptr;
@@ -91,14 +99,9 @@ void RicPasteAsciiDataToSummaryPlotFeature::onActionTriggered(bool isChecked)
{
return;
}
summaryPlot->setDescription(pasteOptions.plotTitle());
}
RicPasteAsciiDataToSummaryPlotFeatureUi pasteOptions;
caf::PdmSettings::readFieldsFromApplicationStore(&pasteOptions);
caf::PdmUiPropertyViewDialog propertyDialog(NULL, &pasteOptions, "Set Paste Options", "");
if (propertyDialog.exec() != QDialog::Accepted) return;
caf::PdmSettings::writeFieldsToApplicationStore(&pasteOptions);
QString text = getPastedData();