#include <pqPythonMacroSupervisor.h>
Inherits QObject.
|
void | onMacroTriggered () |
| If the sender is a QAction managed by this class, the fileName will be looked up and the signal requestExecuteScript will be emitted. More...
|
|
void | onDeleteMacroTriggered () |
| If the sender is a QAction managed by this class, the fileName will be moved (deleted), and the macro will be removed. More...
|
|
void | onEditMacroTriggered () |
| If the sender is a QAction managed by this class, the macro file will be open in a python edit. More...
|
|
Definition at line 17 of file pqPythonMacroSupervisor.h.
◆ pqPythonMacroSupervisor()
pqPythonMacroSupervisor::pqPythonMacroSupervisor |
( |
QObject * |
p = nullptr | ) |
|
◆ ~pqPythonMacroSupervisor()
pqPythonMacroSupervisor::~pqPythonMacroSupervisor |
( |
| ) |
|
|
override |
◆ addWidgetForRunMacros()
void pqPythonMacroSupervisor::addWidgetForRunMacros |
( |
QWidget * |
widget | ) |
|
Add a widget to be given macro actions.
QActions representing script macros will be added to the widget. This could be a QToolBar, QMenu, or other type of widget.
◆ addWidgetForEditMacros()
void pqPythonMacroSupervisor::addWidgetForEditMacros |
( |
QWidget * |
widget | ) |
|
Add a widget to be given macro actions.
QActions representing script macros will be added to the widget. This could be a QToolBar, QMenu, or other type of widget.
◆ addWidgetForDeleteMacros()
void pqPythonMacroSupervisor::addWidgetForDeleteMacros |
( |
QWidget * |
widget | ) |
|
Add a widget to be given macro actions.
QActions representing script macros will be added to the widget. This could be a QToolBar, QMenu, or other type of widget.
◆ getMacro()
QAction* pqPythonMacroSupervisor::getMacro |
( |
const QString & |
fileName | ) |
|
Lookup and return a macro action by fileName (absolute path of macro file).
If it does not exist, return null.
◆ getStoredMacros()
static QMap<QString, QString> pqPythonMacroSupervisor::getStoredMacros |
( |
| ) |
|
|
static |
Get macros from known macro directories (see getMacrosFilePaths) In the returned map, the keys are fileNames and values are macro names.
◆ hideFile()
static void pqPythonMacroSupervisor::hideFile |
( |
const QString & |
fileName | ) |
|
|
static |
Hide file by prepending a `.
` to its name. Hidden file in macro directory are not loaded.
◆ macroNameFromFileName()
static QString pqPythonMacroSupervisor::macroNameFromFileName |
( |
const QString & |
fileName | ) |
|
|
static |
Get a macro name from the fileName (absolute path of macro file).
◆ setNameForMacro()
static void pqPythonMacroSupervisor::setNameForMacro |
( |
const QString & |
macroPath, |
|
|
const QString & |
name |
|
) |
| |
|
static |
◆ macroToolTipFromFileName()
static QString pqPythonMacroSupervisor::macroToolTipFromFileName |
( |
const QString & |
fileName | ) |
|
|
static |
Get a macro tooltip from the fileName (absolute path of macro file).
◆ setTooltipForMacro()
static void pqPythonMacroSupervisor::setTooltipForMacro |
( |
const QString & |
macroPath, |
|
|
const QString & |
name |
|
) |
| |
|
static |
◆ iconPathFromFileName()
static QString pqPythonMacroSupervisor::iconPathFromFileName |
( |
const QString & |
fileName | ) |
|
|
static |
Get an icon path from the fileName (absolute path of macro file).
If no corresponding icon, return an empty string.
◆ setIconForMacro()
static void pqPythonMacroSupervisor::setIconForMacro |
( |
const QString & |
macroPath, |
|
|
const QString & |
iconPath |
|
) |
| |
|
static |
◆ getMacrosFilePaths()
static QStringList pqPythonMacroSupervisor::getMacrosFilePaths |
( |
| ) |
|
|
static |
Get a list a "*.py" files from macro directories.
◆ executeScriptRequested
void pqPythonMacroSupervisor::executeScriptRequested |
( |
const QString & |
fileName | ) |
|
|
signal |
Emitted when a macro has been triggered.
◆ onAddedMacro
void pqPythonMacroSupervisor::onAddedMacro |
( |
| ) |
|
|
signal |
Emitted when a macro has been added.
◆ onEditMacro
void pqPythonMacroSupervisor::onEditMacro |
( |
const QString & |
fileName | ) |
|
|
signal |
Emitted when a macro has to be edited.
◆ addMacro [1/3]
void pqPythonMacroSupervisor::addMacro |
( |
const QString & |
macroName, |
|
|
const QString & |
tip, |
|
|
const QString & |
fileName |
|
) |
| |
|
slot |
Add an action with the given name and fileName.
If there is already a macro with the given fileName it's macroname will be updated to the one given. Macro names do not have to be unique.
◆ addMacro [2/3]
void pqPythonMacroSupervisor::addMacro |
( |
const QString & |
macroName, |
|
|
const QString & |
fileName |
|
) |
| |
|
slot |
◆ addMacro [3/3]
void pqPythonMacroSupervisor::addMacro |
( |
const QString & |
fileName | ) |
|
|
slot |
◆ removeMacro
void pqPythonMacroSupervisor::removeMacro |
( |
const QString & |
fileName | ) |
|
|
slot |
Remove an action from the UI, with the given fileName (absolute path of macro file).
Note, this does not remove the macro from a future load, you must call hideFile yourself (or manually remove the file from the settings dir).
◆ updateMacroList
void pqPythonMacroSupervisor::updateMacroList |
( |
| ) |
|
|
slot |
Update Macro list widgets and actions...
◆ onMacroTriggered
void pqPythonMacroSupervisor::onMacroTriggered |
( |
| ) |
|
|
protectedslot |
If the sender is a QAction managed by this class, the fileName will be looked up and the signal requestExecuteScript will be emitted.
◆ onDeleteMacroTriggered
void pqPythonMacroSupervisor::onDeleteMacroTriggered |
( |
| ) |
|
|
protectedslot |
If the sender is a QAction managed by this class, the fileName will be moved (deleted), and the macro will be removed.
◆ onEditMacroTriggered
void pqPythonMacroSupervisor::onEditMacroTriggered |
( |
| ) |
|
|
protectedslot |
If the sender is a QAction managed by this class, the macro file will be open in a python edit.
◆ addWidgetForMacros()
void pqPythonMacroSupervisor::addWidgetForMacros |
( |
QWidget * |
widget, |
|
|
int |
actionType |
|
) |
| |
|
protected |
Add a widget to be given macro actions.
QActions representing script macros will be added to the widget. This could be a QToolBar, QMenu, or other type of widget.
◆ resetActions()
void pqPythonMacroSupervisor::resetActions |
( |
| ) |
|
|
protected |
Removes all actions and re-adds actions for each macro stored.
The documentation for this class was generated from the following file: