The DlgMacroExecuteImp class implements a dialog to execute or edit a recorded macro. More...
#include <DlgMacroExecuteImp.h>
Public Slots | |
void on_addonsButton_clicked () | |
convenience link button to open tools -> addon manager from within macro dialog More... | |
void on_createButton_clicked () | |
Creates a new macro file. More... | |
void on_deleteButton_clicked () | |
Deletes the selected macro file from your harddisc. More... | |
void on_duplicateButton_clicked () | |
Duplicates selected macro New file has same name as original but with "@" and 3-digit number appended Begins with "@001" and increments until available name is found "MyMacro.FCMacro" becomes "MyMacro@001.FCMacro" "MyMacro@002.FCMacro.py" becomes "MyMacro@003.FCMacro.py" unless there is no already existing "MyMacro@001.FCMacro.py". More... | |
void on_editButton_clicked () | |
Opens the macro file in an editor. More... | |
void on_fileChooser_fileNameChanged (const QString &) | |
Specify the location of your macro files. More... | |
void on_renameButton_clicked () | |
renames the selected macro More... | |
void on_toolbarButton_clicked () | |
Walk user through process of adding macro to global custom toolbar We create a custom customize dialog with instructions embedded within the dialog itself for the user, and the buttons to push in red text There are 2 dialogs we need to create: the macros dialog and the toolbar dialog. More... | |
Public Member Functions | |
void accept () | |
Executes the selected macro file. More... | |
DlgMacroExecuteImp (QWidget *parent=0, Qt::WindowFlags fl=0) | |
Constructs a DlgMacroExecuteImp which is a child of 'parent', with the name 'name' and widget flags set to 'f'. More... | |
~DlgMacroExecuteImp () | |
Destroys the object and frees any allocated resources. More... | |
![]() | |
ParameterGrp::handle getWindowParameter (void) | |
return the parameter group of this window More... | |
void OnChange (Base::Subject< const char * > &rCaller, const char *sReason) | |
bool setGroupName (const char *name) | |
Sets the group of the window to name. More... | |
WindowParameter (const char *name) | |
virtual ~WindowParameter () | |
Protected Slots | |
void on_systemMacroListBox_currentItemChanged (QTreeWidgetItem *) | |
void on_tabMacroWidget_currentChanged (int index) | |
void on_userMacroListBox_currentItemChanged (QTreeWidgetItem *) | |
Selects a macro file in the list view. More... | |
Protected Member Functions | |
void fillUpList (void) | |
Fills up the list with all macro files found in the specified location. More... | |
Protected Attributes | |
QString macroPath | |
Additional Inherited Members | |
![]() | |
static ParameterGrp::handle getDefaultParameter (void) | |
get the parameters More... | |
Detailed Description
The DlgMacroExecuteImp class implements a dialog to execute or edit a recorded macro.
Constructor & Destructor Documentation
◆ DlgMacroExecuteImp()
DlgMacroExecuteImp::DlgMacroExecuteImp | ( | QWidget * | parent = 0 , |
Qt::WindowFlags | fl = 0 |
||
) |
Constructs a DlgMacroExecuteImp which is a child of 'parent', with the name 'name' and widget flags set to 'f'.
The dialog will by default be modeless, unless you set 'modal' to true to construct a modal dialog.
References fillUpList(), ParameterGrp::GetASCII(), App::Application::getUserMacroDir(), Gui::WindowParameter::getWindowParameter(), and macroPath.
◆ ~DlgMacroExecuteImp()
DlgMacroExecuteImp::~DlgMacroExecuteImp | ( | ) |
Destroys the object and frees any allocated resources.
Member Function Documentation
◆ accept()
void DlgMacroExecuteImp::accept | ( | ) |
Executes the selected macro file.
References Gui::Application::activeDocument(), Gui::MacroManager::File, App::GetApplication(), Gui::Document::getDocument(), Gui::Application::Instance, Gui::Application::macroManager(), macroPath, App::Document::recompute(), Gui::MacroManager::run(), and Gui::Dialog::MacroItem::systemWide.
Referenced by ArchComponent.ComponentTaskPanel::editObject().
◆ fillUpList()
|
protected |
Fills up the list with all macro files found in the specified location.
References App::GetApplication(), and macroPath.
Referenced by DlgMacroExecuteImp(), on_addonsButton_clicked(), on_duplicateButton_clicked(), and on_fileChooser_fileNameChanged().
◆ on_addonsButton_clicked
|
slot |
convenience link button to open tools -> addon manager from within macro dialog
References Gui::Application::commandManager(), fillUpList(), Gui::Application::Instance, and Gui::CommandManager::runCommandByName().
◆ on_createButton_clicked
|
slot |
Creates a new macro file.
References Gui::MainWindow::addWindow(), Gui::BitmapFactory(), Gui::getMainWindow(), macroPath, and Gui::EditorView::open().
◆ on_deleteButton_clicked
|
slot |
Deletes the selected macro file from your harddisc.
References macroPath, and Gui::Dialog::MacroItem::systemWide.
◆ on_duplicateButton_clicked
|
slot |
Duplicates selected macro New file has same name as original but with "@" and 3-digit number appended Begins with "@001" and increments until available name is found "MyMacro.FCMacro" becomes "MyMacro@001.FCMacro" "MyMacro@002.FCMacro.py" becomes "MyMacro@003.FCMacro.py" unless there is no already existing "MyMacro@001.FCMacro.py".
References fillUpList(), and macroPath.
◆ on_editButton_clicked
|
slot |
Opens the macro file in an editor.
References Gui::MainWindow::addWindow(), Gui::BitmapFactory(), Gui::EditorView::FileName, App::GetApplication(), Gui::getMainWindow(), macroPath, Gui::EditorView::open(), Gui::EditorView::setDisplayName(), and Gui::Dialog::MacroItem::systemWide.
◆ on_fileChooser_fileNameChanged
|
slot |
Specify the location of your macro files.
The default location is FreeCAD's home path.
References fillUpList(), Gui::WindowParameter::getWindowParameter(), macroPath, and ParameterGrp::SetASCII().
◆ on_renameButton_clicked
|
slot |
renames the selected macro
References macroPath.
◆ on_systemMacroListBox_currentItemChanged
|
protectedslot |
◆ on_tabMacroWidget_currentChanged
|
protectedslot |
◆ on_toolbarButton_clicked
|
slot |
Walk user through process of adding macro to global custom toolbar We create a custom customize dialog with instructions embedded within the dialog itself for the user, and the buttons to push in red text There are 2 dialogs we need to create: the macros dialog and the toolbar dialog.
advise user of what we are doing, offer chance to cancel unless user already said not to show this messagebox again
check if user already has custom toolbar, so we can tailor instructions accordingly
check if user already has this macro command created, if so skip dialog 1
first the custom macros page dialog
title is normally "Customize"
normally the groupbox title is "Setup Custom Macros", but we change it here
now for the toolbar selection dialog
tailor instructions depending on whether user already has custom toolbar created if not he needs to click New button to create one first
find the Global workbench and select it for the user
"label" normally says "Note: the changes become active the next time you load the appropriate workbench"
find Macros category and select it for the user
expand custom toolbar items
preselect macro command for user
References Gui::Application::commandManager(), Base::Console(), App::GetApplication(), ParameterGrp::GetBool(), Gui::CommandManager::getGroupCommands(), Gui::CommandBase::getMenuText(), App::Application::GetParameterGroupByPath(), Gui::MacroCommand::getScriptName(), Gui::Application::Instance, ParameterGrp::SetBool(), and Base::ConsoleSingleton::Warning().
◆ on_userMacroListBox_currentItemChanged
|
protectedslot |
Selects a macro file in the list view.
Member Data Documentation
◆ macroPath
|
protected |
The documentation for this class was generated from the following files:
- src/Gui/DlgMacroExecuteImp.h
- src/Gui/DlgMacroExecuteImp.cpp