Gui: fix -Wclazy-connect-by-name
This commit is contained in:
@@ -81,6 +81,8 @@ DlgMacroExecuteImp::DlgMacroExecuteImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
, ui(new Ui_DlgMacroExecute)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
// retrieve the macro path from parameter or use the user data as default
|
||||
{
|
||||
QSignalBlocker blocker(ui->fileChooser);
|
||||
@@ -107,6 +109,32 @@ DlgMacroExecuteImp::~DlgMacroExecuteImp()
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
void DlgMacroExecuteImp::setupConnections()
|
||||
{
|
||||
connect(ui->fileChooser, &FileChooser::fileNameChanged,
|
||||
this, &DlgMacroExecuteImp::onFileChooserFileNameChanged);
|
||||
connect(ui->createButton, &QPushButton::clicked,
|
||||
this, &DlgMacroExecuteImp::onCreateButtonClicked);
|
||||
connect(ui->deleteButton, &QPushButton::clicked,
|
||||
this, &DlgMacroExecuteImp::onDeleteButtonClicked);
|
||||
connect(ui->editButton, &QPushButton::clicked,
|
||||
this, &DlgMacroExecuteImp::onEditButtonClicked);
|
||||
connect(ui->renameButton, &QPushButton::clicked,
|
||||
this, &DlgMacroExecuteImp::onRenameButtonClicked);
|
||||
connect(ui->duplicateButton, &QPushButton::clicked,
|
||||
this, &DlgMacroExecuteImp::onDuplicateButtonClicked);
|
||||
connect(ui->toolbarButton, &QPushButton::clicked,
|
||||
this, &DlgMacroExecuteImp::onToolbarButtonClicked);
|
||||
connect(ui->addonsButton, &QPushButton::clicked,
|
||||
this, &DlgMacroExecuteImp::onAddonsButtonClicked);
|
||||
connect(ui->userMacroListBox, &QTreeWidget::currentItemChanged,
|
||||
this, &DlgMacroExecuteImp::onUserMacroListBoxCurrentItemChanged);
|
||||
connect(ui->systemMacroListBox, &QTreeWidget::currentItemChanged,
|
||||
this, &DlgMacroExecuteImp::onSystemMacroListBoxCurrentItemChanged);
|
||||
connect(ui->tabMacroWidget, &QTabWidget::currentChanged,
|
||||
this, &DlgMacroExecuteImp::onTabMacroWidgetCurrentChanged);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fills up the list with all macro files found in the specified location.
|
||||
*/
|
||||
@@ -137,7 +165,7 @@ void DlgMacroExecuteImp::fillUpList()
|
||||
/**
|
||||
* Selects a macro file in the list view.
|
||||
*/
|
||||
void DlgMacroExecuteImp::on_userMacroListBox_currentItemChanged(QTreeWidgetItem* item)
|
||||
void DlgMacroExecuteImp::onUserMacroListBoxCurrentItemChanged(QTreeWidgetItem* item)
|
||||
{
|
||||
if (item) {
|
||||
ui->LineEditMacroName->setText(item->text(0));
|
||||
@@ -161,7 +189,7 @@ void DlgMacroExecuteImp::on_userMacroListBox_currentItemChanged(QTreeWidgetItem*
|
||||
}
|
||||
}
|
||||
|
||||
void DlgMacroExecuteImp::on_systemMacroListBox_currentItemChanged(QTreeWidgetItem* item)
|
||||
void DlgMacroExecuteImp::onSystemMacroListBoxCurrentItemChanged(QTreeWidgetItem* item)
|
||||
{
|
||||
if (item) {
|
||||
ui->LineEditMacroName->setText(item->text(0));
|
||||
@@ -185,7 +213,7 @@ void DlgMacroExecuteImp::on_systemMacroListBox_currentItemChanged(QTreeWidgetIte
|
||||
}
|
||||
}
|
||||
|
||||
void DlgMacroExecuteImp::on_tabMacroWidget_currentChanged(int index)
|
||||
void DlgMacroExecuteImp::onTabMacroWidgetCurrentChanged(int index)
|
||||
{
|
||||
QTreeWidgetItem* item;
|
||||
|
||||
@@ -292,7 +320,7 @@ void DlgMacroExecuteImp::accept()
|
||||
/**
|
||||
* Specify the location of your macro files. The default location is FreeCAD's home path.
|
||||
*/
|
||||
void DlgMacroExecuteImp::on_fileChooser_fileNameChanged(const QString& fn)
|
||||
void DlgMacroExecuteImp::onFileChooserFileNameChanged(const QString& fn)
|
||||
{
|
||||
if (!fn.isEmpty())
|
||||
{
|
||||
@@ -307,7 +335,7 @@ void DlgMacroExecuteImp::on_fileChooser_fileNameChanged(const QString& fn)
|
||||
/**
|
||||
* Opens the macro file in an editor.
|
||||
*/
|
||||
void DlgMacroExecuteImp::on_editButton_clicked()
|
||||
void DlgMacroExecuteImp::onEditButtonClicked()
|
||||
{
|
||||
QDir dir;
|
||||
QTreeWidgetItem* item = nullptr;
|
||||
@@ -348,7 +376,7 @@ void DlgMacroExecuteImp::on_editButton_clicked()
|
||||
}
|
||||
|
||||
/** Creates a new macro file. */
|
||||
void DlgMacroExecuteImp::on_createButton_clicked()
|
||||
void DlgMacroExecuteImp::onCreateButtonClicked()
|
||||
{
|
||||
// query file name
|
||||
bool replaceSpaces = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro")->GetBool("ReplaceSpaces", true);
|
||||
@@ -400,7 +428,7 @@ void DlgMacroExecuteImp::on_createButton_clicked()
|
||||
}
|
||||
|
||||
/** Deletes the selected macro file from your harddisc. */
|
||||
void DlgMacroExecuteImp::on_deleteButton_clicked()
|
||||
void DlgMacroExecuteImp::onDeleteButtonClicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->userMacroListBox->currentItem();
|
||||
if (!item)
|
||||
@@ -435,7 +463,7 @@ void DlgMacroExecuteImp::on_deleteButton_clicked()
|
||||
* toolbar dialog.
|
||||
*/
|
||||
|
||||
void DlgMacroExecuteImp::on_toolbarButton_clicked()
|
||||
void DlgMacroExecuteImp::onToolbarButtonClicked()
|
||||
{
|
||||
/**
|
||||
* advise user of what we are doing, offer chance to cancel
|
||||
@@ -668,7 +696,7 @@ Note: your changes will be applied when you next switch workbenches\n"));
|
||||
/**
|
||||
* renames the selected macro
|
||||
*/
|
||||
void DlgMacroExecuteImp::on_renameButton_clicked()
|
||||
void DlgMacroExecuteImp::onRenameButtonClicked()
|
||||
{
|
||||
QDir dir;
|
||||
QTreeWidgetItem* item = nullptr;
|
||||
@@ -718,6 +746,7 @@ void DlgMacroExecuteImp::on_renameButton_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
|
||||
@@ -725,7 +754,7 @@ void DlgMacroExecuteImp::on_renameButton_clicked()
|
||||
* "MyMacro@002.FCMacro.py" becomes "MyMacro@003.FCMacro.py" unless there is
|
||||
* no already existing "MyMacro@001.FCMacro.py"
|
||||
*/
|
||||
void DlgMacroExecuteImp::on_duplicateButton_clicked()
|
||||
void DlgMacroExecuteImp::onDuplicateButtonClicked()
|
||||
{
|
||||
QDir dir;
|
||||
QTreeWidgetItem* item = nullptr;
|
||||
@@ -854,7 +883,7 @@ void DlgMacroExecuteImp::on_duplicateButton_clicked()
|
||||
* convenience link button to open tools -> addon manager
|
||||
* from within macro dialog
|
||||
*/
|
||||
void DlgMacroExecuteImp::on_addonsButton_clicked()
|
||||
void DlgMacroExecuteImp::onAddonsButtonClicked()
|
||||
{
|
||||
CommandManager& rMgr=Application::Instance->commandManager();
|
||||
rMgr.runCommandByName("Std_AddonMgr");
|
||||
|
||||
Reference in New Issue
Block a user