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=nullptr, Qt::WindowFlags fl=Qt::WindowFlags()) | |
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... | |
Public Member Functions inherited from Gui::WindowParameter | |
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 Public Member Functions inherited from Gui::WindowParameter | |
static ParameterGrp::handle | getDefaultParameter (void) |
get the parameters More... | |
The DlgMacroExecuteImp class implements a dialog to execute or edit a recorded macro.
DlgMacroExecuteImp::DlgMacroExecuteImp | ( | QWidget * | parent = nullptr , |
Qt::WindowFlags | fl = Qt::WindowFlags() |
||
) |
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 | ( | ) |
Destroys the object and frees any allocated resources.
void DlgMacroExecuteImp::accept | ( | ) |
Executes the selected macro file.
References Gui::Application::activeDocument(), Gui::MainWindow::appendRecentMacro(), Gui::MacroManager::File, Gui::Document::getDocument(), App::Application::getHomePath(), Gui::getMainWindow(), Gui::Application::Instance, Gui::Application::macroManager(), macroPath, App::Document::recompute(), Gui::MacroManager::run(), and Gui::Dialog::MacroItem::systemWide.
Referenced by femexamples.examplesgui.FemExamples::clicked(), femexamples.examplesgui.FemExamples::double_clicked(), ArchComponent.ComponentTaskPanel::editObject(), and PathScripts.PathToolBitLibraryGui.ToolBitLibrary::toolEdit().
|
protected |
Fills up the list with all macro files found in the specified location.
References App::Application::getHomePath(), and macroPath.
Referenced by DlgMacroExecuteImp(), on_addonsButton_clicked(), on_duplicateButton_clicked(), and on_fileChooser_fileNameChanged().
|
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().
|
slot |
Creates a new macro file.
References Gui::MainWindow::addWindow(), Gui::MainWindow::appendRecentMacro(), Gui::BitmapFactory(), App::GetApplication(), ParameterGrp::GetBool(), Gui::getMainWindow(), App::Application::GetParameterGroupByPath(), draftfunctions.svgtext::getText(), macroPath, Gui::EditorView::open(), and ParameterGrp::SetBool().
|
slot |
Deletes the selected macro file from your harddisc.
References macroPath, and Gui::Dialog::MacroItem::systemWide.
|
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(), App::GetApplication(), ParameterGrp::GetBool(), App::Application::GetParameterGroupByPath(), draftfunctions.svgtext::getText(), macroPath, and ParameterGrp::SetBool().
|
slot |
Opens the macro file in an editor.
References Gui::MainWindow::addWindow(), Gui::MainWindow::appendRecentMacro(), Gui::BitmapFactory(), Gui::EditorView::FileName, App::Application::getHomePath(), Gui::getMainWindow(), macroPath, Gui::EditorView::open(), Gui::EditorView::setDisplayName(), and Gui::Dialog::MacroItem::systemWide.
|
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().
|
slot |
renames the selected macro
References App::GetApplication(), ParameterGrp::GetBool(), App::Application::GetParameterGroupByPath(), draftfunctions.svgtext::getText(), macroPath, and ParameterGrp::SetBool().
|
protectedslot |
|
protectedslot |
|
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, they need 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().
|
protectedslot |
Selects a macro file in the list view.
|
protected |