Fix accessibility of some group commands

Several group commands are active but require an active document to work. This PR overrides the method isActive() to
disable the commands if no active document exists.

The affected commands are:
* Std_ViewGroup
* Std_LinkActions
* PartDesign_CompDatums
* PartDesign_CompSketches
This commit is contained in:
wmayer
2024-05-21 13:31:45 +02:00
committed by wwmayer
parent 68889f05ec
commit 0484592835
3 changed files with 24 additions and 1 deletions

View File

@@ -892,7 +892,15 @@ public:
addCommand(new StdCmdLinkImportAll());
}
const char* className() const override {return "StdCmdLinkActions";}
const char* className() const override
{
return "StdCmdLinkActions";
}
bool isActive() override
{
return hasActiveDocument();
}
};
//===========================================================================

View File

@@ -1648,6 +1648,11 @@ public:
{
return "StdCmdViewGroup";
}
bool isActive() override
{
return hasActiveDocument();
}
};
//===========================================================================

View File

@@ -2422,6 +2422,11 @@ public:
{
return "CmdPartDesignCompDatums";
}
bool isActive() override
{
return hasActiveDocument();
}
};
// Command group for datums =============================================
@@ -2452,6 +2457,11 @@ public:
{
return "CmdPartDesignCompSketches";
}
bool isActive() override
{
return hasActiveDocument();
}
};
//===========================================================================