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. | |
bool | addTo (const char *Name, QWidget *pcWidget) |
Adds the given command to a given widget. | |
CommandManager () | |
Construction. | |
std::vector< Command * > | getAllCommands (void) const |
Returns all commands registered in the manager delivers a vector of all comands. | |
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. | |
const std::map< std::string, Command * > & | getCommands () const |
method is OBSOLET use GetModuleCommands() or GetAllCommands() | |
std::vector< Command * > | getGroupCommands (const char *sGrpName) const |
Returns all commands of a group delivers a vector of all comands in the given group. | |
std::vector< Command * > | getModuleCommands (const char *sModName) const |
Returns all commands of a special App Module delivers a vector of all comands in the given application module. | |
void | removeCommand (Command *pCom) |
Remove a command from the manager. | |
void | runCommandByName (const char *sName) const |
Runs the command. | |
void | testActive (void) |
get frequently called by the AppWnd to check the commands are active. | |
~CommandManager () | |
Destruction. |
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.
Definition at line 412 of file Command.h.
CommandManager::CommandManager | ( | ) |
Construction.
Definition at line 844 of file Gui/Command.cpp.
CommandManager::~CommandManager | ( | ) |
Destruction.
Definition at line 848 of file Gui/Command.cpp.
void CommandManager::addCommand | ( | Command * | pCom | ) |
Insert a new command into the manager.
Definition at line 853 of file Gui/Command.cpp.
References Gui::Command::getName().
Referenced by CreateAssemblyCommands(), CreateCamCommands(), CreateCompleteCommands(), Gui::CreateDocCommands(), CreateDrawingCommands(), Gui::CreateFeatCommands(), CreateFemCommands(), CreateImageCommands(), CreateImportCommands(), CreateInspectionCommands(), Gui::CreateMacroCommands(), CreateMeshCommands(), CreateMeshPartCommands(), CreateParamPartCommands(), CreatePartCommands(), CreatePartDesignCommands(), CreatePointsCommands(), CreateRaytracingCommands(), CreateReverseEngineeringCommands(), CreateRobotCommands(), CreateRobotCommandsExport(), CreateRobotCommandsInsertRobots(), CreateRobotCommandsTrajectory(), CreateSandboxCommands(), CreateSimplePartCommands(), CreateSketcherCommands(), CreateSketcherCommandsAlterGeo(), CreateSketcherCommandsConstraints(), CreateSketcherCommandsCreateGeo(), CreateStartCommands(), Gui::CreateStdCommands(), Gui::CreateTestCommands(), Gui::CreateViewStdCommands(), CreateWebCommands(), Gui::CreateWindowStdCommands(), Gui::MacroCommand::load(), Gui::Dialog::DlgCustomActionsImp::on_buttonAddAction_clicked(), and Gui::Application::sAddCommand().
bool CommandManager::addTo | ( | const char * | Name, | |
QWidget * | pcWidget | |||
) |
Adds the given command to a given widget.
Definition at line 874 of file Gui/Command.cpp.
References Gui::Command::addTo(), and Base::Console().
Referenced by Gui::Dialog::DlgCustomToolbarsImp::addCustomCommand(), Gui::ToolBoxManager::setup(), and Gui::ToolBarManager::setup().
std::vector< Command * > CommandManager::getAllCommands | ( | void | ) | const |
Returns all commands registered in the manager delivers a vector of all comands.
If you intereted in commands of of a special app module use GetModuleCommands()
Definition at line 904 of file Gui/Command.cpp.
Referenced by Gui::MainWindow::changeEvent(), Gui::Dialog::DlgCustomKeyboardImp::on_buttonResetAll_clicked(), and Gui::Dialog::DlgCustomKeyboardImp::on_editShortcut_textChanged().
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.
Definition at line 927 of file Gui/Command.cpp.
Referenced by Gui::MDITabbar::contextMenuEvent(), Gui::MainWindow::createPopupMenu(), Gui::DockWnd::TextBrowser::dropEvent(), Gui::MainWindow::event(), Gui::Dialog::CommandModel::goAddMacro(), Gui::Dialog::DlgCustomActionsImp::on_actionListWidget_itemActivated(), Gui::Dialog::DlgCustomKeyboardImp::on_buttonAssign_clicked(), 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::DlgCustomToolbars::onAddMacroAction(), Gui::Dialog::DlgCustomKeyboardImp::onAddMacroAction(), Gui::Dialog::DlgCustomCommandsImp::onAddMacroAction(), Gui::Dialog::DlgCustomToolbars::onModifyMacroAction(), Gui::Dialog::DlgCustomKeyboardImp::onModifyMacroAction(), Gui::Dialog::DlgCustomCommandsImp::onModifyMacroAction(), runCommandByName(), CompleteGui::Workbench::setupMenuBar(), CompleteGui::Workbench::setupToolBars(), Gui::Application::sRunCommand(), and Gui::TaskView::TaskWatcherCommands::TaskWatcherCommands().
const std::map<std::string, Command*>& Gui::CommandManager::getCommands | ( | ) | const [inline] |
method is OBSOLET use GetModuleCommands() or GetAllCommands()
Definition at line 458 of file Command.h.
Referenced by Gui::Dialog::DlgCustomCommandsImp::DlgCustomCommandsImp(), Gui::Dialog::DlgCustomKeyboardImp::DlgCustomKeyboardImp(), and Gui::Dialog::DlgCustomToolbars::DlgCustomToolbars().
std::vector< Command * > CommandManager::getGroupCommands | ( | const char * | sGrpName | ) | const |
Returns all commands of a group delivers a vector of all comands in the given group.
Definition at line 915 of file Gui/Command.cpp.
Referenced by Gui::Dialog::DlgCustomToolbars::changeEvent(), Gui::Dialog::DlgCustomKeyboardImp::changeEvent(), Gui::Dialog::DlgCustomCommandsImp::changeEvent(), Gui::Dialog::DlgCustomActionsImp::on_buttonRemoveAction_clicked(), Gui::Dialog::DlgCustomToolbars::on_categoryBox_activated(), Gui::Dialog::DlgCustomKeyboardImp::on_categoryBox_activated(), Gui::Dialog::DlgCustomCommandsImp::onGroupActivated(), and Gui::MacroCommand::save().
std::vector< Command * > CommandManager::getModuleCommands | ( | const char * | sModName | ) | const |
Returns all commands of a special App Module delivers a vector of all comands in the given application module.
When no name is given the standard commands (build in ) are returned.
Definition at line 892 of file Gui/Command.cpp.
void CommandManager::removeCommand | ( | Command * | pCom | ) |
Remove a command from the manager.
Definition at line 858 of file Gui/Command.cpp.
References Gui::Command::getName().
Referenced by Gui::Dialog::DlgCustomActionsImp::on_buttonRemoveAction_clicked().
void CommandManager::runCommandByName | ( | const char * | sName | ) | const |
Runs the command.
Definition at line 933 of file Gui/Command.cpp.
References getCommandByName(), and Gui::Command::invoke().
Referenced by Gui::MainWindow::event().
void CommandManager::testActive | ( | void | ) |
get frequently called by the AppWnd to check the commands are active.
Definition at line 941 of file Gui/Command.cpp.