The CommandManager class This class manage all available commands in FreeCAD. More...
#include <Command.h>
Public Member Functions | |
void | addCommand (Command *pCom) |
Insert a new command into the manager. More... | |
void | addCommandMode (const char *sContext, const char *sName) |
bool | addTo (const char *Name, QWidget *pcWidget) |
Adds the given command to a given widget. More... | |
CommandManager () | |
Construction. More... | |
std::vector< Command * > | getAllCommands (void) const |
Returns all commands registered in the manager delivers a vector of all commands. More... | |
Command * | getCommandByName (const char *sName) const |
Returns the command registered in the manager with the name sName If nothing is found it returns a null pointer. More... | |
const std::map< std::string, Command * > & | getCommands () const |
method is OBSOLETE use GetModuleCommands() or GetAllCommands() More... | |
std::vector< Command * > | getGroupCommands (const char *sGrpName) const |
Returns all commands of a group delivers a vector of all commands in the given group. More... | |
std::vector< Command * > | getModuleCommands (const char *sModName) const |
Returns all commands of a special App Module delivers a vector of all commands in the given application module. More... | |
void | removeCommand (Command *pCom) |
Remove a command from the manager. More... | |
void | runCommandByName (const char *sName) const |
Runs the command. More... | |
void | testActive (void) |
get frequently called by the AppWnd to check the commands are active. More... | |
void | updateCommands (const char *sContext, int mode) |
~CommandManager () | |
Destruction. More... | |
Detailed Description
The CommandManager class This class manage all available commands in FreeCAD.
All Commands will registered here, also commands from Application modules. Also activation / deactivation, Icons Tooltips and so on are handles here. Further the Building of Toolbars and (Context) menus (connecting to a QAction) is done here.
- See also
- Command
Constructor & Destructor Documentation
◆ CommandManager()
CommandManager::CommandManager | ( | ) |
Construction.
◆ ~CommandManager()
CommandManager::~CommandManager | ( | ) |
Destruction.
Member Function Documentation
◆ addCommand()
void CommandManager::addCommand | ( | Command * | pCom | ) |
Insert a new command into the manager.
References Gui::Command::getName().
Referenced by Gui::GroupCommand::addCommand(), Gui::CreateDocCommands(), Gui::CreateFeatCommands(), Gui::CreateLinkCommands(), Gui::CreateMacroCommands(), Gui::CreateStdCommands(), Gui::CreateStructureCommands(), Gui::CreateTestCommands(), Gui::CreateViewStdCommands(), Gui::CreateWindowStdCommands(), Gui::MacroCommand::load(), Gui::Dialog::DlgCustomActionsImp::on_buttonAddAction_clicked(), Gui::Application::sAddCommand(), and StdViewDockUndockFullscreen::StdViewDockUndockFullscreen().
◆ addCommandMode()
void CommandManager::addCommandMode | ( | const char * | sContext, |
const char * | sName | ||
) |
References Gui::Command::sName.
◆ addTo()
Adds the given command to a given widget.
References Gui::Command::addTo(), Base::Console(), Base::ConsoleSingleton::Error(), and Base::ConsoleSingleton::Warning().
Referenced by Gui::Dialog::DlgCustomToolbarsImp::addCustomCommand(), Mod.PartDesign.WizardShaft.Shaft.Shaft::equilibrium(), Gui::ToolBoxManager::setup(), Gui::ToolBarManager::setup(), and SandboxGui::TaskPanelView::TaskPanelView().
◆ getAllCommands()
std::vector< Command * > CommandManager::getAllCommands | ( | void | ) | const |
Returns all commands registered in the manager delivers a vector of all commands.
If you intereted in commands of of a special app module use GetModuleCommands()
- See also
- Command
Referenced by Gui::MainWindow::changeEvent(), Gui::Dialog::DlgCustomKeyboardImp::on_buttonResetAll_clicked(), Gui::Dialog::DlgCustomKeyboardImp::on_editShortcut_textChanged(), and Gui::Application::sListCommands().
◆ getCommandByName()
Command * CommandManager::getCommandByName | ( | const char * | sName | ) | const |
Returns the command registered in the manager with the name sName If nothing is found it returns a null pointer.
- See also
- Command
References Gui::Command::sName.
Referenced by Gui::PythonGroupCommand::activated(), Gui::GroupCommand::addCommand(), Gui::MDITabbar::contextMenuEvent(), Gui::PythonGroupCommand::createAction(), StdViewDockUndockFullscreen::createAction(), NaviCubeImplementation::createContextMenu(), Gui::Workbench::createLinkMenu(), Gui::MainWindow::createPopupMenu(), Gui::MainWindow::event(), Gui::Dialog::CommandModel::goAddMacro(), Gui::PythonGroupCommand::languageChange(), Gui::Dialog::DlgCustomActionsImp::on_actionListWidget_itemActivated(), Gui::Dialog::DlgCustomActionsImp::on_buttonReplaceAction_clicked(), Gui::Dialog::DlgCustomKeyboardImp::on_buttonReset_clicked(), Gui::Dialog::DlgCustomKeyboardImp::on_commandTreeWidget_currentItemChanged(), Gui::Dialog::DlgCustomKeyboardImp::on_editShortcut_textChanged(), Gui::Dialog::DemoMode::on_fullscreen_toggled(), Gui::Dialog::DlgCustomCommandsImp::onAddMacroAction(), Gui::Dialog::DlgCustomKeyboardImp::onAddMacroAction(), Gui::Dialog::DlgCustomToolbars::onAddMacroAction(), Gui::Dialog::DlgCustomCommandsImp::onModifyMacroAction(), Gui::Dialog::DlgCustomKeyboardImp::onModifyMacroAction(), Gui::Dialog::DlgCustomToolbars::onModifyMacroAction(), Gui::TaskCSysDragger::open(), Gui::Dialog::DlgCustomKeyboardImp::setShortcutOfCurrentAction(), MeshGui::Workbench::setupMenuBar(), Gui::Application::sGetCommandInfo(), Gui::Application::sGetCommandShortcut(), Gui::Application::sIsCommandActive(), Gui::Application::sRunCommand(), FemGui::TaskPostClip::TaskPostClip(), FemGui::TaskPostCut::TaskPostCut(), Gui::TaskView::TaskWatcherCommands::TaskWatcherCommands(), Gui::TaskView::TaskWatcherPython::TaskWatcherPython(), Gui::Command::testActive(), Gui::MainWindow::updateEditorActions(), and Gui::TaskCSysDragger::~TaskCSysDragger().
◆ getCommands()
const std::map<std::string, Command*>& Gui::CommandManager::getCommands | ( | ) | const |
method is OBSOLETE use GetModuleCommands() or GetAllCommands()
Referenced by Gui::Dialog::DlgCustomCommandsImp::DlgCustomCommandsImp(), Gui::Dialog::DlgCustomKeyboardImp::DlgCustomKeyboardImp(), and Gui::Dialog::DlgCustomToolbars::DlgCustomToolbars().
◆ getGroupCommands()
std::vector< Command * > CommandManager::getGroupCommands | ( | const char * | sGrpName | ) | const |
Returns all commands of a group delivers a vector of all commands in the given group.
Referenced by Gui::Dialog::DlgCustomCommandsImp::changeEvent(), Gui::Dialog::DlgCustomKeyboardImp::changeEvent(), Gui::Dialog::DlgCustomToolbars::changeEvent(), Gui::Dialog::DlgCustomActionsImp::on_buttonRemoveAction_clicked(), Gui::Dialog::DlgCustomKeyboardImp::on_categoryBox_activated(), Gui::Dialog::DlgCustomToolbars::on_categoryBox_activated(), Gui::Dialog::DlgMacroExecuteImp::on_toolbarButton_clicked(), Gui::Dialog::DlgCustomCommandsImp::onGroupActivated(), and Gui::MacroCommand::save().
◆ getModuleCommands()
std::vector< Command * > CommandManager::getModuleCommands | ( | const char * | sModName | ) | const |
◆ removeCommand()
void CommandManager::removeCommand | ( | Command * | pCom | ) |
Remove a command from the manager.
References Gui::Command::getName().
Referenced by Gui::Dialog::DlgCustomActionsImp::on_buttonRemoveAction_clicked().
◆ runCommandByName()
void CommandManager::runCommandByName | ( | const char * | sName | ) | const |
Runs the command.
References Gui::Command::invoke(), and Gui::Command::sName.
Referenced by PartDesignGui::WorkflowManager::determineWorkflow(), Gui::MainWindow::event(), Gui::Dialog::DlgMacroExecuteImp::on_addonsButton_clicked(), SketcherGui::TaskSketcherConstrains::on_listWidgetConstraints_updateActiveStatus(), and SketcherGui::TaskSketcherConstrains::on_listWidgetConstraints_updateDrivingStatus().
◆ testActive()
void CommandManager::testActive | ( | void | ) |
get frequently called by the AppWnd to check the commands are active.
◆ updateCommands()
void CommandManager::updateCommands | ( | const char * | sContext, |
int | mode | ||
) |
References Gui::Command::updateAction().
The documentation for this class was generated from the following files:
- src/Gui/Command.h
- src/Gui/Command.cpp