mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-02 20:30:46 -06:00
#4926 Summary Plot : Add push button to edit plot
This commit is contained in:
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();
|
||||
};
|
||||
Reference in new issue
Block a user