mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1784 Add plot title option when pasting new summary curve
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user