#4926 Summary Plot : Add push button to edit plot

This commit is contained in:
Magne Sjaastad committed 2019-10-25 13:53:51 +02:00
1 parent cea853b94f
commit 6110748192
4 files changed
+63 -17

No files matched your search

@@ -68,17 +68,7 @@ RicSummaryCurveCreatorDialog* RicEditSummaryPlotFeature::curveCreatorDialog()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicEditSummaryPlotFeature::isCommandEnabled()
{
if ( selectedSummaryPlot() ) return true;
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicEditSummaryPlotFeature::onActionTriggered( bool isChecked )
void RicEditSummaryPlotFeature::editSummaryPlot( RimSummaryPlot* plot )
{
auto dialog = RicEditSummaryPlotFeature::curveCreatorDialog();
@@ -91,13 +81,30 @@ void RicEditSummaryPlotFeature::onActionTriggered( bool isChecked )
dialog->raise();
}
// Set target plot
if ( selectedSummaryPlot() )
if ( plot )
{
dialog->updateFromSummaryPlot( selectedSummaryPlot() );
dialog->updateFromSummaryPlot( plot );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicEditSummaryPlotFeature::isCommandEnabled()
{
if ( selectedSummaryPlot() ) return true;
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicEditSummaryPlotFeature::onActionTriggered( bool isChecked )
{
editSummaryPlot( selectedSummaryPlot() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -110,7 +117,7 @@ void RicEditSummaryPlotFeature::setupActionLook( QAction* actionToSetup )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryPlot* RicEditSummaryPlotFeature::selectedSummaryPlot() const
RimSummaryPlot* RicEditSummaryPlotFeature::selectedSummaryPlot()
{
RimSummaryPlot* sumPlot = nullptr;
@@ -35,13 +35,13 @@ public:
void closeDialogAndResetTargetPlot();
static RicSummaryCurveCreatorDialog* curveCreatorDialog();
static void editSummaryPlot( RimSummaryPlot* plot );
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
private:
RimSummaryPlot* selectedSummaryPlot() const;
static RimSummaryPlot* selectedSummaryPlot();
};