Improve CmdFeature base class

Add default implementation of isEnabled() and add const
This commit is contained in:
Magne Sjaastad 2023-06-26 14:28:46 +02:00 committed by GitHub
parent 59ca0b943c
commit 1da509166a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
786 changed files with 638 additions and 1857 deletions

View File

@ -37,7 +37,7 @@ CAF_CMD_SOURCE_INIT( RicNewAnalysisPlotFeature, "RicNewAnalysisPlotFeature" );
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicNewAnalysisPlotFeature::isCommandEnabled() bool RicNewAnalysisPlotFeature::isCommandEnabled() const
{ {
if ( caf::firstAncestorOfTypeFromSelectedObject<RimAnalysisPlotCollection>() ) return true; if ( caf::firstAncestorOfTypeFromSelectedObject<RimAnalysisPlotCollection>() ) return true;
if ( caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlot>() ) return true; if ( caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlot>() ) return true;

View File

@ -28,7 +28,7 @@ class RicNewAnalysisPlotFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -34,7 +34,7 @@ CAF_CMD_SOURCE_INIT( RicNewPlotDataFilterFeature, "RicNewPlotDataFilterFeature"
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicNewPlotDataFilterFeature::isCommandEnabled() bool RicNewPlotDataFilterFeature::isCommandEnabled() const
{ {
RimAnalysisPlot* analysisPlot = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimAnalysisPlot>(); RimAnalysisPlot* analysisPlot = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimAnalysisPlot>();

View File

@ -28,7 +28,7 @@ class RicNewPlotDataFilterFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -41,7 +41,7 @@ CAF_CMD_SOURCE_INIT( RicCreateReachCircleAnnotationFeature, "RicCreateReachCircl
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicCreateReachCircleAnnotationFeature::isCommandEnabled() bool RicCreateReachCircleAnnotationFeature::isCommandEnabled() const
{ {
auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>(); auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>(); auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();

View File

@ -32,7 +32,7 @@ class RicCreateReachCircleAnnotationFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -38,7 +38,7 @@ CAF_CMD_SOURCE_INIT( RicCreateTextAnnotationFeature, "RicCreateTextAnnotationFea
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicCreateTextAnnotationFeature::isCommandEnabled() bool RicCreateTextAnnotationFeature::isCommandEnabled() const
{ {
auto selObjsGlobal = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>(); auto selObjsGlobal = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selObjs2InView = caf::selectedObjectsByTypeStrict<RimAnnotationInViewCollection*>(); auto selObjs2InView = caf::selectedObjectsByTypeStrict<RimAnnotationInViewCollection*>();

View File

@ -34,7 +34,7 @@ class RicCreateTextAnnotationFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -39,14 +39,6 @@
CAF_CMD_SOURCE_INIT( RicCreateTextAnnotationIn3dViewFeature, "RicCreateTextAnnotationIn3dViewFeature" ); CAF_CMD_SOURCE_INIT( RicCreateTextAnnotationIn3dViewFeature, "RicCreateTextAnnotationIn3dViewFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCreateTextAnnotationIn3dViewFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicCreateTextAnnotationIn3dViewFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -41,7 +41,7 @@ CAF_CMD_SOURCE_INIT( RicCreateUserDefinedPolylinesAnnotationFeature, "RicCreateU
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicCreateUserDefinedPolylinesAnnotationFeature::isCommandEnabled() bool RicCreateUserDefinedPolylinesAnnotationFeature::isCommandEnabled() const
{ {
auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>(); auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>(); auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();

View File

@ -32,7 +32,7 @@ class RicCreateUserDefinedPolylinesAnnotationFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -39,7 +39,7 @@ CAF_CMD_SOURCE_INIT( RicImportPolylinesAnnotationFeature, "RicImportPolylinesAnn
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicImportPolylinesAnnotationFeature::isCommandEnabled() bool RicImportPolylinesAnnotationFeature::isCommandEnabled() const
{ {
auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>(); auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>(); auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();

View File

@ -28,7 +28,7 @@ class RicImportPolylinesAnnotationFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -24,14 +24,6 @@
CAF_CMD_SOURCE_INIT( RicCloseProjectFeature, "RicCloseProjectFeature" ); CAF_CMD_SOURCE_INIT( RicCloseProjectFeature, "RicCloseProjectFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCloseProjectFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicCloseProjectFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -35,14 +35,6 @@
CAF_CMD_SOURCE_INIT( RicEditPreferencesFeature, "RicEditPreferencesFeature" ); CAF_CMD_SOURCE_INIT( RicEditPreferencesFeature, "RicEditPreferencesFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicEditPreferencesFeature::isCommandEnabled()
{
return true;
}
std::vector<caf::FontHolderInterface*> findFontObjects() std::vector<caf::FontHolderInterface*> findFontObjects()
{ {
auto project = RimProject::current(); auto project = RimProject::current();

View File

@ -31,7 +31,6 @@ class RicEditPreferencesFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -27,14 +27,6 @@
CAF_CMD_SOURCE_INIT( RicExitApplicationFeature, "RicExitApplicationFeature" ); CAF_CMD_SOURCE_INIT( RicExitApplicationFeature, "RicExitApplicationFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicExitApplicationFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicExitApplicationFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -35,14 +35,6 @@
CAF_CMD_SOURCE_INIT( RicExportObjectAndFieldKeywordsFeature, "RicExportObjectAndFieldKeywordsFeature" ); CAF_CMD_SOURCE_INIT( RicExportObjectAndFieldKeywordsFeature, "RicExportObjectAndFieldKeywordsFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicExportObjectAndFieldKeywordsFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicExportObjectAndFieldKeywordsFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -46,14 +46,6 @@ CAF_CMD_SOURCE_INIT( RicSearchHelpFeature, "RicSearchHelpFeature" );
CAF_CMD_SOURCE_INIT( RicSearchIssuesHelpFeature, "RicSearchIssuesHelpFeature" ); CAF_CMD_SOURCE_INIT( RicSearchIssuesHelpFeature, "RicSearchIssuesHelpFeature" );
CAF_CMD_SOURCE_INIT( RicCreateNewIssueHelpFeature, "RicCreateNewIssueHelpFeature" ); CAF_CMD_SOURCE_INIT( RicCreateNewIssueHelpFeature, "RicCreateNewIssueHelpFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicHelpAboutFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -205,14 +197,6 @@ QString RicHelpAboutFeature::getPythonVersion( const QString& pathToPythonExecut
return versionString; return versionString;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicHelpCommandLineFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -234,14 +218,6 @@ void RicHelpCommandLineFeature::setupActionLook( QAction* actionToSetup )
actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) ); actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicHelpSummaryCommandLineFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -263,14 +239,6 @@ void RicHelpSummaryCommandLineFeature::setupActionLook( QAction* actionToSetup )
actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) ); actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicHelpOpenUsersGuideFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -291,14 +259,6 @@ void RicHelpOpenUsersGuideFeature::setupActionLook( QAction* actionToSetup )
actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) ); actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicSearchHelpFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -337,14 +297,6 @@ void RicSearchHelpFeature::setupActionLook( QAction* actionToSetup )
applyShortcutWithHintToAction( actionToSetup, QKeySequence::HelpContents ); applyShortcutWithHintToAction( actionToSetup, QKeySequence::HelpContents );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicSearchIssuesHelpFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -363,14 +315,6 @@ void RicSearchIssuesHelpFeature::setupActionLook( QAction* actionToSetup )
actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) ); actionToSetup->setIcon( QIcon( ":/HelpCircle.svg" ) );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCreateNewIssueHelpFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,6 @@ class RicHelpAboutFeature : public caf::CmdFeature
static QString getPythonVersion( const QString& pathToPythonExecutable ); static QString getPythonVersion( const QString& pathToPythonExecutable );
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };
@ -43,7 +42,6 @@ class RicHelpCommandLineFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };
@ -56,7 +54,6 @@ class RicHelpSummaryCommandLineFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };
@ -69,7 +66,6 @@ class RicHelpOpenUsersGuideFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };
@ -82,7 +78,6 @@ class RicSearchHelpFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };
@ -95,7 +90,6 @@ class RicSearchIssuesHelpFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };
@ -108,7 +102,6 @@ class RicCreateNewIssueHelpFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -27,14 +27,6 @@
CAF_CMD_SOURCE_INIT( RicLaunchRegressionTestsFeature, "RicLaunchRegressionTestsFeature" ); CAF_CMD_SOURCE_INIT( RicLaunchRegressionTestsFeature, "RicLaunchRegressionTestsFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicLaunchRegressionTestsFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -73,14 +65,6 @@ void RicLaunchRegressionTestDialogFeature::showRegressionTestDialog()
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicLaunchRegressionTestDialogFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicLaunchRegressionTestsFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
private: private:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };
@ -43,7 +42,6 @@ class RicLaunchRegressionTestDialogFeature : public caf::CmdFeature
static void showRegressionTestDialog(); static void showRegressionTestDialog();
private: private:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -25,14 +25,6 @@
CAF_CMD_SOURCE_INIT( RicLaunchUnitTestsFeature, "RicLaunchUnitTestsFeature" ); CAF_CMD_SOURCE_INIT( RicLaunchUnitTestsFeature, "RicLaunchUnitTestsFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicLaunchUnitTestsFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -29,7 +29,6 @@ class RicLaunchUnitTestsFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -56,14 +56,6 @@ void RicOpenInTextEditorFeature::openFileInTextEditor( const QString& filePath,
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicOpenInTextEditorFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -30,7 +30,6 @@ class RicOpenInTextEditorFeature : public caf::CmdFeature
static void openFileInTextEditor( const QString& filePath, QObject* parent ); static void openFileInTextEditor( const QString& filePath, QObject* parent );
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -27,14 +27,6 @@
CAF_CMD_SOURCE_INIT( RicOpenLastUsedFileFeature, "RicOpenLastUsedFileFeature" ); CAF_CMD_SOURCE_INIT( RicOpenLastUsedFileFeature, "RicOpenLastUsedFileFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicOpenLastUsedFileFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicOpenLastUsedFileFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -29,14 +29,6 @@
CAF_CMD_SOURCE_INIT( RicOpenProjectFeature, "RicOpenProjectFeature" ); CAF_CMD_SOURCE_INIT( RicOpenProjectFeature, "RicOpenProjectFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicOpenProjectFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicOpenProjectFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -28,14 +28,6 @@
CAF_CMD_SOURCE_INIT( RicRunCommandFileFeature, "RicRunCommandFileFeature" ); CAF_CMD_SOURCE_INIT( RicRunCommandFileFeature, "RicRunCommandFileFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicRunCommandFileFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicRunCommandFileFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
private: private:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -51,14 +51,6 @@ caf::PdmScriptResponse RicSaveProjectAsFeature::execute()
return caf::PdmScriptResponse(); return caf::PdmScriptResponse();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicSaveProjectAsFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -35,7 +35,6 @@ public:
caf::PdmScriptResponse execute() override; caf::PdmScriptResponse execute() override;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -60,14 +60,6 @@ caf::PdmScriptResponse RicSaveProjectFeature::execute()
return caf::PdmScriptResponse(); return caf::PdmScriptResponse();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicSaveProjectFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -35,7 +35,6 @@ public:
caf::PdmScriptResponse execute() override; caf::PdmScriptResponse execute() override;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -25,14 +25,6 @@
CAF_CMD_SOURCE_INIT( RicSaveProjectNoGlobalPathsFeature, "RicSaveProjectNoGlobalPathsFeature" ); CAF_CMD_SOURCE_INIT( RicSaveProjectNoGlobalPathsFeature, "RicSaveProjectNoGlobalPathsFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicSaveProjectNoGlobalPathsFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicSaveProjectNoGlobalPathsFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
private: private:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -27,14 +27,6 @@
CAF_CMD_SOURCE_INIT( RicShowClassNamesFeature, "RicShowClassNamesFeature" ); CAF_CMD_SOURCE_INIT( RicShowClassNamesFeature, "RicShowClassNamesFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicShowClassNamesFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -59,7 +51,7 @@ void RicShowClassNamesFeature::setupActionLook( QAction* actionToSetup )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicShowClassNamesFeature::isCommandChecked() bool RicShowClassNamesFeature::isCommandChecked() const
{ {
return RiaPreferences::current()->systemPreferences()->appendClassNameToUiText(); return RiaPreferences::current()->systemPreferences()->appendClassNameToUiText();
} }

View File

@ -28,8 +28,7 @@ class RicShowClassNamesFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandChecked() override; bool isCommandChecked() const override;
}; };

View File

@ -75,14 +75,6 @@ void RicShowMainWindowFeature::showMainWindow()
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicShowMainWindowFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -31,7 +31,6 @@ public:
static void showMainWindow(); static void showMainWindow();
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -32,14 +32,6 @@
CAF_CMD_SOURCE_INIT( RicShowMemoryCleanupDialogFeature, "RicShowMemoryCleanupDialogFeature" ); CAF_CMD_SOURCE_INIT( RicShowMemoryCleanupDialogFeature, "RicShowMemoryCleanupDialogFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicShowMemoryCleanupDialogFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicShowMemoryCleanupDialogFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -23,7 +23,7 @@ CAF_CMD_SOURCE_INIT( RicShowPlotDataCtxFeature, "RicShowPlotDataCtxFeature" );
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicShowPlotDataCtxFeature::isCommandEnabled() bool RicShowPlotDataCtxFeature::isCommandEnabled() const
{ {
return true; return true;
} }

View File

@ -28,5 +28,5 @@ class RicShowPlotDataCtxFeature : public RicShowPlotDataFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
}; };

View File

@ -168,7 +168,7 @@ private:
/// ///
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicShowPlotDataFeature::isCommandEnabled() bool RicShowPlotDataFeature::isCommandEnabled() const
{ {
QString content = RiaFeatureCommandContext::instance()->contentString(); QString content = RiaFeatureCommandContext::instance()->contentString();
if ( !content.isEmpty() ) if ( !content.isEmpty() )
@ -355,7 +355,7 @@ void RicShowPlotDataFeature::showTextWindow( const QString& title, const QString
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicShowPlotDataFeature::getSelection( std::vector<RimPlotWindow*>& selection ) void RicShowPlotDataFeature::getSelection( std::vector<RimPlotWindow*>& selection ) const
{ {
if ( sender() ) if ( sender() )
{ {

View File

@ -33,12 +33,12 @@ class RicShowPlotDataFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
private: private:
void getSelection( std::vector<RimPlotWindow*>& selection ); void getSelection( std::vector<RimPlotWindow*>& selection ) const;
public: public:
static void showTabbedTextWindow( RiuTabbedTextProvider* textProvider ); static void showTabbedTextWindow( RiuTabbedTextProvider* textProvider );

View File

@ -24,14 +24,6 @@
CAF_CMD_SOURCE_INIT( RicShowPlotWindowFeature, "RicShowPlotWindowFeature" ); CAF_CMD_SOURCE_INIT( RicShowPlotWindowFeature, "RicShowPlotWindowFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicShowPlotWindowFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicShowPlotWindowFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -56,7 +56,7 @@ void RicTileWindowsFeature::applyTiling( RiuMainWindow* mainWindow, RiaDefines::
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTileWindowsFeature::isCommandEnabled() bool RicTileWindowsFeature::isCommandEnabled() const
{ {
auto* mainWindow = RiuMainWindow::instance(); auto* mainWindow = RiuMainWindow::instance();
if ( mainWindow ) if ( mainWindow )
@ -91,7 +91,7 @@ void RicTileWindowsFeature::setupActionLook( QAction* actionToSetup )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTileWindowsFeature::isCommandChecked() bool RicTileWindowsFeature::isCommandChecked() const
{ {
auto proj = RimProject::current(); auto proj = RimProject::current();
@ -124,7 +124,7 @@ void RicTilePlotWindowsFeature::applyTiling( RiuPlotMainWindow* mainWindow, RiaD
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTilePlotWindowsFeature::isCommandEnabled() bool RicTilePlotWindowsFeature::isCommandEnabled() const
{ {
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow(); RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
if ( mainPlotWindow ) if ( mainPlotWindow )
@ -159,7 +159,7 @@ void RicTilePlotWindowsFeature::setupActionLook( QAction* actionToSetup )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTilePlotWindowsFeature::isCommandChecked() bool RicTilePlotWindowsFeature::isCommandChecked() const
{ {
auto proj = RimProject::current(); auto proj = RimProject::current();
@ -171,7 +171,7 @@ CAF_CMD_SOURCE_INIT( RicTileWindowsVerticallyFeature, "RicTileWindowsVerticallyF
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTileWindowsVerticallyFeature::isCommandEnabled() bool RicTileWindowsVerticallyFeature::isCommandEnabled() const
{ {
RiuMainWindow* mainWindow = RiuMainWindow::instance(); RiuMainWindow* mainWindow = RiuMainWindow::instance();
if ( mainWindow ) if ( mainWindow )
@ -205,7 +205,7 @@ void RicTileWindowsVerticallyFeature::setupActionLook( QAction* actionToSetup )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTileWindowsVerticallyFeature::isCommandChecked() bool RicTileWindowsVerticallyFeature::isCommandChecked() const
{ {
auto proj = RimProject::current(); auto proj = RimProject::current();
@ -217,7 +217,7 @@ CAF_CMD_SOURCE_INIT( RicTileWindowsHorizontallyFeature, "RicTileWindowsHorizonta
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTileWindowsHorizontallyFeature::isCommandEnabled() bool RicTileWindowsHorizontallyFeature::isCommandEnabled() const
{ {
RiuMainWindow* mainWindow = RiuMainWindow::instance(); RiuMainWindow* mainWindow = RiuMainWindow::instance();
if ( mainWindow ) if ( mainWindow )
@ -251,7 +251,7 @@ void RicTileWindowsHorizontallyFeature::setupActionLook( QAction* actionToSetup
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTileWindowsHorizontallyFeature::isCommandChecked() bool RicTileWindowsHorizontallyFeature::isCommandChecked() const
{ {
auto proj = RimProject::current(); auto proj = RimProject::current();
@ -269,7 +269,7 @@ CAF_CMD_SOURCE_INIT( RicTilePlotWindowsVerticallyFeature, "RicTilePlotWindowsVer
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTilePlotWindowsVerticallyFeature::isCommandEnabled() bool RicTilePlotWindowsVerticallyFeature::isCommandEnabled() const
{ {
auto* mainWindow = RiuPlotMainWindow::instance(); auto* mainWindow = RiuPlotMainWindow::instance();
if ( mainWindow ) if ( mainWindow )
@ -303,7 +303,7 @@ void RicTilePlotWindowsVerticallyFeature::setupActionLook( QAction* actionToSetu
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTilePlotWindowsVerticallyFeature::isCommandChecked() bool RicTilePlotWindowsVerticallyFeature::isCommandChecked() const
{ {
auto proj = RimProject::current(); auto proj = RimProject::current();
@ -315,7 +315,7 @@ CAF_CMD_SOURCE_INIT( RicTilePlotWindowsHorizontallyFeature, "RicTilePlotWindowsH
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTilePlotWindowsHorizontallyFeature::isCommandEnabled() bool RicTilePlotWindowsHorizontallyFeature::isCommandEnabled() const
{ {
auto* mainWindow = RiuPlotMainWindow::instance(); auto* mainWindow = RiuPlotMainWindow::instance();
if ( mainWindow ) if ( mainWindow )
@ -349,7 +349,7 @@ void RicTilePlotWindowsHorizontallyFeature::setupActionLook( QAction* actionToSe
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicTilePlotWindowsHorizontallyFeature::isCommandChecked() bool RicTilePlotWindowsHorizontallyFeature::isCommandChecked() const
{ {
auto proj = RimProject::current(); auto proj = RimProject::current();

View File

@ -37,10 +37,10 @@ public:
static void applyTiling( RiuMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode ); static void applyTiling( RiuMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode );
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandChecked() override; bool isCommandChecked() const override;
}; };
//================================================================================================== //==================================================================================================
@ -51,10 +51,10 @@ class RicTileWindowsVerticallyFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandChecked() override; bool isCommandChecked() const override;
}; };
//================================================================================================== //==================================================================================================
@ -65,10 +65,10 @@ class RicTileWindowsHorizontallyFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandChecked() override; bool isCommandChecked() const override;
}; };
//================================================================================================== //==================================================================================================
@ -82,10 +82,10 @@ public:
static void applyTiling( RiuPlotMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode ); static void applyTiling( RiuPlotMainWindow* mainWindow, RiaDefines::WindowTileMode requestedTileMode );
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandChecked() override; bool isCommandChecked() const override;
}; };
//================================================================================================== //==================================================================================================
@ -96,10 +96,10 @@ class RicTilePlotWindowsVerticallyFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandChecked() override; bool isCommandChecked() const override;
}; };
//================================================================================================== //==================================================================================================
@ -110,8 +110,8 @@ class RicTilePlotWindowsHorizontallyFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandChecked() override; bool isCommandChecked() const override;
}; };

View File

@ -32,14 +32,6 @@
CAF_CMD_SOURCE_INIT( RicNewPolygonFilter3dviewFeature, "RicNewPolygonFilter3dviewFeature" ); CAF_CMD_SOURCE_INIT( RicNewPolygonFilter3dviewFeature, "RicNewPolygonFilter3dviewFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewPolygonFilter3dviewFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicNewPolygonFilter3dviewFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -30,14 +30,6 @@
CAF_CMD_SOURCE_INIT( RicNewPolygonFilterFeature, "RicNewPolygonFilterFeature" ); CAF_CMD_SOURCE_INIT( RicNewPolygonFilterFeature, "RicNewPolygonFilterFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewPolygonFilterFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicNewPolygonFilterFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -35,7 +35,7 @@ CAF_CMD_SOURCE_INIT( RicNewRangeFilterSlice3dviewFeature, "RicNewRangeFilterSlic
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicNewRangeFilterSlice3dviewFeature::isCommandEnabled() bool RicNewRangeFilterSlice3dviewFeature::isCommandEnabled() const
{ {
RimGridView* view = RiaApplication::instance()->activeGridView(); RimGridView* view = RiaApplication::instance()->activeGridView();
if ( !view ) return false; if ( !view ) return false;

View File

@ -28,7 +28,7 @@ class RicNewRangeFilterSlice3dviewFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -34,14 +34,6 @@ RicNewRangeFilterSliceFeature::RicNewRangeFilterSliceFeature( QString cmdText, i
{ {
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewRangeFilterSliceFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -29,7 +29,6 @@ protected:
RicNewRangeFilterSliceFeature( QString cmdText, int sliceDirection ); RicNewRangeFilterSliceFeature( QString cmdText, int sliceDirection );
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -30,14 +30,6 @@
CAF_CMD_SOURCE_INIT( RicNewUserDefinedFilterFeature, "RicNewUserDefinedFilterFeature" ); CAF_CMD_SOURCE_INIT( RicNewUserDefinedFilterFeature, "RicNewUserDefinedFilterFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewUserDefinedFilterFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -28,7 +28,6 @@ class RicNewUserDefinedFilterFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -34,7 +34,7 @@ CAF_CMD_SOURCE_INIT( RicCopyStandardLegendFeature, "RicCopyStandardLegendFeature
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicCopyStandardLegendFeature::isCommandEnabled() bool RicCopyStandardLegendFeature::isCommandEnabled() const
{ {
return selectedColorLegend() != nullptr; return selectedColorLegend() != nullptr;
} }

View File

@ -30,10 +30,10 @@ class RicCopyStandardLegendFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
private: private:
RimColorLegend* selectedColorLegend(); static RimColorLegend* selectedColorLegend();
}; };

View File

@ -42,7 +42,7 @@ CAF_CMD_SOURCE_INIT( RicImportColorCategoriesFeature, "RicImportColorCategoriesF
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicImportColorCategoriesFeature::isCommandEnabled() bool RicImportColorCategoriesFeature::isCommandEnabled() const
{ {
return caf::firstAncestorOfTypeFromSelectedObject<RimColorLegendCollection>() != nullptr; return caf::firstAncestorOfTypeFromSelectedObject<RimColorLegendCollection>() != nullptr;
} }

View File

@ -28,7 +28,7 @@ class RicImportColorCategoriesFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -33,7 +33,7 @@ CAF_CMD_SOURCE_INIT( RicInsertColorLegendFeature, "RicInsertColorLegendFeature"
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicInsertColorLegendFeature::isCommandEnabled() bool RicInsertColorLegendFeature::isCommandEnabled() const
{ {
return selectedColorLegendCollection() != nullptr; return selectedColorLegendCollection() != nullptr;
} }

View File

@ -30,10 +30,10 @@ class RicInsertColorLegendFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
private: private:
RimColorLegendCollection* selectedColorLegendCollection(); static RimColorLegendCollection* selectedColorLegendCollection();
}; };

View File

@ -35,7 +35,7 @@ CAF_CMD_SOURCE_INIT( RicInsertColorLegendItemFeature, "RicInsertColorLegendItemF
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// Disallows insert of color legend item in standard color legends /// Disallows insert of color legend item in standard color legends
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicInsertColorLegendItemFeature::isCommandEnabled() bool RicInsertColorLegendItemFeature::isCommandEnabled() const
{ {
RimColorLegend* legend = selectedColorLegend(); RimColorLegend* legend = selectedColorLegend();

View File

@ -30,10 +30,10 @@ class RicInsertColorLegendItemFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
private: private:
RimColorLegend* selectedColorLegend(); static RimColorLegend* selectedColorLegend();
}; };

View File

@ -31,7 +31,7 @@ CAF_CMD_SOURCE_INIT( RicDeleteValveTemplateFeature, "RicDeleteValveTemplateFeatu
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicDeleteValveTemplateFeature::isCommandEnabled() bool RicDeleteValveTemplateFeature::isCommandEnabled() const
{ {
return caf::SelectionManager::instance()->selectedItemOfType<RimValveTemplate>() != nullptr; return caf::SelectionManager::instance()->selectedItemOfType<RimValveTemplate>() != nullptr;
} }

View File

@ -28,7 +28,7 @@ class RicDeleteValveTemplateFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -34,7 +34,7 @@ CAF_CMD_SOURCE_INIT( RicEditPerforationCollectionFeature, "RicEditPerforationCol
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicEditPerforationCollectionFeature::isCommandEnabled() bool RicEditPerforationCollectionFeature::isCommandEnabled() const
{ {
return selectedPerforationCollection() != nullptr; return selectedPerforationCollection() != nullptr;
} }

View File

@ -30,7 +30,7 @@ class RicEditPerforationCollectionFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -123,7 +123,7 @@ void RicExportFishbonesLateralsFeature::setupActionLook( QAction* actionToSetup
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicExportFishbonesLateralsFeature::isCommandEnabled() bool RicExportFishbonesLateralsFeature::isCommandEnabled() const
{ {
return selectedFishbonesCollection() != nullptr; return selectedFishbonesCollection() != nullptr;
} }

View File

@ -47,7 +47,7 @@ class RicExportFishbonesLateralsFeature : public caf::CmdFeature
protected: protected:
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override; bool isCommandEnabled() const override;
private: private:
static RimFishbonesCollection* selectedFishbonesCollection(); static RimFishbonesCollection* selectedFishbonesCollection();

View File

@ -42,14 +42,6 @@ CAF_CMD_SOURCE_INIT( RicImportEnsembleFractureStatisticsFeature, "RicImportEnsem
QString RicImportEnsembleFractureStatisticsFeature::m_pathFilter = "*"; QString RicImportEnsembleFractureStatisticsFeature::m_pathFilter = "*";
QString RicImportEnsembleFractureStatisticsFeature::m_fileNameFilter = "*"; QString RicImportEnsembleFractureStatisticsFeature::m_fileNameFilter = "*";
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicImportEnsembleFractureStatisticsFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -40,7 +40,6 @@ public:
protected: protected:
static void importSingleEnsembleFractureStatistics( const QStringList& fileNames ); static void importSingleEnsembleFractureStatistics( const QStringList& fileNames );
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -74,7 +74,7 @@ void RicNewFishbonesSubsAtMeasuredDepthFeature::setupActionLook( QAction* action
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicNewFishbonesSubsAtMeasuredDepthFeature::isCommandEnabled() bool RicNewFishbonesSubsAtMeasuredDepthFeature::isCommandEnabled() const
{ {
return RiuWellPathSelectionItem::wellPathSelectionItem() != nullptr; return RiuWellPathSelectionItem::wellPathSelectionItem() != nullptr;
} }

View File

@ -30,5 +30,5 @@ class RicNewFishbonesSubsAtMeasuredDepthFeature : public caf::CmdFeature
protected: protected:
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override; bool isCommandEnabled() const override;
}; };

View File

@ -131,7 +131,7 @@ void RicNewFishbonesSubsFeature::setupActionLook( QAction* actionToSetup )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicNewFishbonesSubsFeature::isCommandEnabled() bool RicNewFishbonesSubsFeature::isCommandEnabled() const
{ {
return selectedFishbonesCollection() != nullptr; return selectedFishbonesCollection() != nullptr;
} }

View File

@ -35,7 +35,7 @@ public:
protected: protected:
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override; bool isCommandEnabled() const override;
private: private:
static RimFishbonesCollection* selectedFishbonesCollection(); static RimFishbonesCollection* selectedFishbonesCollection();

View File

@ -77,7 +77,7 @@ void RicNewPerforationIntervalAtMeasuredDepthFeature::setupActionLook( QAction*
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicNewPerforationIntervalAtMeasuredDepthFeature::isCommandEnabled() bool RicNewPerforationIntervalAtMeasuredDepthFeature::isCommandEnabled() const
{ {
return RiuWellPathSelectionItem::wellPathSelectionItem() != nullptr; return RiuWellPathSelectionItem::wellPathSelectionItem() != nullptr;
} }

View File

@ -32,5 +32,5 @@ class RicNewPerforationIntervalAtMeasuredDepthFeature : public caf::CmdFeature
protected: protected:
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override; bool isCommandEnabled() const override;
}; };

View File

@ -39,7 +39,7 @@ CAF_CMD_SOURCE_INIT( RicNewPerforationIntervalFeature, "RicNewPerforationInterva
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicNewPerforationIntervalFeature::isCommandEnabled() bool RicNewPerforationIntervalFeature::isCommandEnabled() const
{ {
return selectedPerforationCollection() != nullptr; return selectedPerforationCollection() != nullptr;
} }

View File

@ -31,10 +31,10 @@ class RicNewPerforationIntervalFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
private: private:
RimPerforationCollection* selectedPerforationCollection(); static RimPerforationCollection* selectedPerforationCollection();
}; };

View File

@ -171,14 +171,6 @@ RimStimPlanModelPlot* RicNewStimPlanModelPlotFeature::createPlot( RimStimPlanMod
return plot; return plot;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewStimPlanModelPlotFeature::isCommandEnabled()
{
return true;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -43,7 +43,6 @@ public:
static RimStimPlanModelPlot* createPlot( RimStimPlanModel* stimPlanModel ); static RimStimPlanModelPlot* createPlot( RimStimPlanModel* stimPlanModel );
protected: protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

View File

@ -88,7 +88,7 @@ void RicNewValveAtMeasuredDepthFeature::setupActionLook( QAction* actionToSetup
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicNewValveAtMeasuredDepthFeature::isCommandEnabled() bool RicNewValveAtMeasuredDepthFeature::isCommandEnabled() const
{ {
auto wellPathSelectionItem = RiuWellPathSelectionItem::wellPathSelectionItem(); auto wellPathSelectionItem = RiuWellPathSelectionItem::wellPathSelectionItem();
return wellPathSelectionItem && dynamic_cast<RimPerforationInterval*>( wellPathSelectionItem->m_wellPathComponent ); return wellPathSelectionItem && dynamic_cast<RimPerforationInterval*>( wellPathSelectionItem->m_wellPathComponent );

View File

@ -30,5 +30,5 @@ class RicNewValveAtMeasuredDepthFeature : public caf::CmdFeature
protected: protected:
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override; bool isCommandEnabled() const override;
}; };

View File

@ -16,7 +16,7 @@ CAF_CMD_SOURCE_INIT( RicNewValveFeature, "RicNewValveFeature" );
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicNewValveFeature::isCommandEnabled() bool RicNewValveFeature::isCommandEnabled() const
{ {
std::vector<caf::PdmUiItem*> allSelectedItems; std::vector<caf::PdmUiItem*> allSelectedItems;
caf::SelectionManager::instance()->selectedItems( allSelectedItems ); caf::SelectionManager::instance()->selectedItems( allSelectedItems );

View File

@ -28,7 +28,7 @@ class RicNewValveFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
}; };

View File

@ -120,11 +120,3 @@ void RicNewValveTemplateFeature::setupActionLook( QAction* actionToSetup )
actionToSetup->setIcon( QIcon( ":/ICDValve16x16.png" ) ); actionToSetup->setIcon( QIcon( ":/ICDValve16x16.png" ) );
actionToSetup->setText( "New Valve Template" ); actionToSetup->setText( "New Valve Template" );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewValveTemplateFeature::isCommandEnabled()
{
return true;
}

View File

@ -41,5 +41,4 @@ protected:
static RimValveTemplate* createNewValveTemplate(); static RimValveTemplate* createNewValveTemplate();
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
}; };

View File

@ -42,7 +42,7 @@ CAF_CMD_SOURCE_INIT( RicWellPathImportPerforationIntervalsFeature, "RicWellPathI
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicWellPathImportPerforationIntervalsFeature::isCommandEnabled() bool RicWellPathImportPerforationIntervalsFeature::isCommandEnabled() const
{ {
return RicWellPathImportPerforationIntervalsFeature::selectedWellPathCollection() != nullptr; return RicWellPathImportPerforationIntervalsFeature::selectedWellPathCollection() != nullptr;
} }

View File

@ -30,7 +30,7 @@ class RicWellPathImportPerforationIntervalsFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT; CAF_CMD_HEADER_INIT;
protected: protected:
bool isCommandEnabled() override; bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override; void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override; void setupActionLook( QAction* actionToSetup ) override;

Some files were not shown because too many files have changed in this diff Show More