Gui: fix -Wclazy-connect-by-name
This commit is contained in:
@@ -59,6 +59,8 @@ DlgCustomActionsImp::DlgCustomActionsImp( QWidget* parent )
|
||||
, ui(new Ui_DlgCustomActions)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
// search for all macros
|
||||
std::string cMacroPath = App::GetApplication().
|
||||
GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro")
|
||||
@@ -92,6 +94,20 @@ DlgCustomActionsImp::~DlgCustomActionsImp()
|
||||
MacroCommand::save();
|
||||
}
|
||||
|
||||
void DlgCustomActionsImp::setupConnections()
|
||||
{
|
||||
connect(ui->actionListWidget, &QTreeWidget::itemActivated,
|
||||
this, &DlgCustomActionsImp::onActionListWidgetItemActivated);
|
||||
connect(ui->buttonChoosePixmap, &QToolButton::clicked,
|
||||
this, &DlgCustomActionsImp::onButtonChoosePixmapClicked);
|
||||
connect(ui->buttonAddAction, &QPushButton::clicked,
|
||||
this, &DlgCustomActionsImp::onButtonAddActionClicked);
|
||||
connect(ui->buttonRemoveAction, &QPushButton::clicked,
|
||||
this, &DlgCustomActionsImp::onButtonRemoveActionClicked);
|
||||
connect(ui->buttonReplaceAction, &QPushButton::clicked,
|
||||
this, &DlgCustomActionsImp::onButtonReplaceActionClicked);
|
||||
}
|
||||
|
||||
bool DlgCustomActionsImp::event(QEvent* e)
|
||||
{
|
||||
bool ok = QWidget::event(e);
|
||||
@@ -159,7 +175,7 @@ void DlgCustomActionsImp::showActions()
|
||||
}
|
||||
}
|
||||
|
||||
void DlgCustomActionsImp::on_actionListWidget_itemActivated(QTreeWidgetItem *item)
|
||||
void DlgCustomActionsImp::onActionListWidgetItemActivated(QTreeWidgetItem *item)
|
||||
{
|
||||
if (!item)
|
||||
return; // no valid item
|
||||
@@ -210,7 +226,7 @@ void DlgCustomActionsImp::on_actionListWidget_itemActivated(QTreeWidgetItem *ite
|
||||
}
|
||||
}
|
||||
|
||||
void DlgCustomActionsImp::on_buttonAddAction_clicked()
|
||||
void DlgCustomActionsImp::onButtonAddActionClicked()
|
||||
{
|
||||
if (ui->actionMacros-> currentText().isEmpty())
|
||||
{
|
||||
@@ -277,7 +293,7 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked()
|
||||
Q_EMIT addMacroAction(actionName);
|
||||
}
|
||||
|
||||
void DlgCustomActionsImp::on_buttonReplaceAction_clicked()
|
||||
void DlgCustomActionsImp::onButtonReplaceActionClicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->actionListWidget->currentItem();
|
||||
if (!item)
|
||||
@@ -353,7 +369,7 @@ void DlgCustomActionsImp::on_buttonReplaceAction_clicked()
|
||||
item->setIcon(0, Gui::BitmapFactory().pixmap(macro->getPixmap()));
|
||||
}
|
||||
|
||||
void DlgCustomActionsImp::on_buttonRemoveAction_clicked()
|
||||
void DlgCustomActionsImp::onButtonRemoveActionClicked()
|
||||
{
|
||||
// remove item from list view
|
||||
QTreeWidgetItem* item = ui->actionListWidget->currentItem();
|
||||
@@ -466,7 +482,7 @@ void IconDialog::onAddIconPath()
|
||||
}
|
||||
}
|
||||
|
||||
void DlgCustomActionsImp::on_buttonChoosePixmap_clicked()
|
||||
void DlgCustomActionsImp::onButtonChoosePixmapClicked()
|
||||
{
|
||||
// create a dialog showing all pixmaps
|
||||
Gui::Dialog::IconDialog dlg(this);
|
||||
|
||||
@@ -66,17 +66,20 @@ protected:
|
||||
bool event(QEvent* e) override;
|
||||
void changeEvent(QEvent *e) override;
|
||||
|
||||
protected Q_SLOTS:
|
||||
protected:
|
||||
void setupConnections();
|
||||
/** Enables/disables buttons for deletion */
|
||||
void on_actionListWidget_itemActivated( QTreeWidgetItem *i );
|
||||
void onActionListWidgetItemActivated( QTreeWidgetItem *i );
|
||||
/** Opens a iconview to select a pixmap */
|
||||
void on_buttonChoosePixmap_clicked();
|
||||
void onButtonChoosePixmapClicked();
|
||||
/** Adds a custom action */
|
||||
void on_buttonAddAction_clicked();
|
||||
void onButtonAddActionClicked();
|
||||
/** Deletes a custom action */
|
||||
void on_buttonRemoveAction_clicked();
|
||||
void onButtonRemoveActionClicked();
|
||||
/** Shows the setup of the action */
|
||||
void on_buttonReplaceAction_clicked();
|
||||
void onButtonReplaceActionClicked();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void onAddMacroAction(const QByteArray&) override;
|
||||
void onRemoveMacroAction(const QByteArray&) override;
|
||||
void onModifyMacroAction(const QByteArray&) override;
|
||||
@@ -102,7 +105,7 @@ public:
|
||||
void resizeEvent(QResizeEvent*) override;
|
||||
QListWidgetItem* currentItem() const;
|
||||
|
||||
private Q_SLOTS:
|
||||
private:
|
||||
void onAddIconPath();
|
||||
|
||||
private:
|
||||
@@ -118,7 +121,7 @@ public:
|
||||
~IconFolders() override;
|
||||
QStringList getPaths() const;
|
||||
|
||||
private Q_SLOTS:
|
||||
private:
|
||||
void addFolder();
|
||||
void removeFolder();
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ DlgCustomizeSpNavSettings::DlgCustomizeSpNavSettings(QWidget *parent) :
|
||||
}
|
||||
this->init = true;
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
initialize();
|
||||
}
|
||||
|
||||
@@ -54,6 +55,60 @@ DlgCustomizeSpNavSettings::~DlgCustomizeSpNavSettings()
|
||||
{
|
||||
}
|
||||
|
||||
void DlgCustomizeSpNavSettings::setupConnections()
|
||||
{
|
||||
connect(ui->CBDominant, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBDominant_clicked);
|
||||
connect(ui->CBFlipYZ, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBFlipYZ_clicked);
|
||||
connect(ui->CBRotations, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBRotations_clicked);
|
||||
connect(ui->CBTranslations, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBTranslations_clicked);
|
||||
connect(ui->SliderGlobal, &QSlider::sliderReleased,
|
||||
this, &DlgCustomizeSpNavSettings::on_SliderGlobal_sliderReleased);
|
||||
connect(ui->CBEnablePanLR, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBEnablePanLR_clicked);
|
||||
connect(ui->CBReversePanLR, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBReversePanLR_clicked);
|
||||
connect(ui->SliderPanLR, &QSlider::sliderReleased,
|
||||
this, &DlgCustomizeSpNavSettings::on_SliderPanLR_sliderReleased);
|
||||
connect(ui->CBEnablePanUD, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBEnablePanUD_clicked);
|
||||
connect(ui->CBReversePanUD, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBReversePanUD_clicked);
|
||||
connect(ui->SliderPanUD, &QSlider::sliderReleased,
|
||||
this, &DlgCustomizeSpNavSettings::on_SliderPanUD_sliderReleased);
|
||||
connect(ui->CBEnableZoom, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBEnableZoom_clicked);
|
||||
connect(ui->CBReverseZoom, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBReverseZoom_clicked);
|
||||
connect(ui->SliderZoom, &QSlider::sliderReleased,
|
||||
this, &DlgCustomizeSpNavSettings::on_SliderZoom_sliderReleased);
|
||||
connect(ui->CBEnableTilt, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBEnableTilt_clicked);
|
||||
connect(ui->CBReverseTilt, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBReverseTilt_clicked);
|
||||
connect(ui->SliderTilt, &QSlider::sliderReleased,
|
||||
this, &DlgCustomizeSpNavSettings::on_SliderTilt_sliderReleased);
|
||||
connect(ui->CBEnableRoll, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBEnableRoll_clicked);
|
||||
connect(ui->CBReverseRoll, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBReverseRoll_clicked);
|
||||
connect(ui->SliderRoll, &QSlider::sliderReleased,
|
||||
this, &DlgCustomizeSpNavSettings::on_SliderRoll_sliderReleased);
|
||||
connect(ui->CBEnableSpin, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBEnableSpin_clicked);
|
||||
connect(ui->CBReverseSpin, &QCheckBox::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_CBReverseSpin_clicked);
|
||||
connect(ui->SliderSpin, &QSlider::sliderReleased,
|
||||
this, &DlgCustomizeSpNavSettings::on_SliderSpin_sliderReleased);
|
||||
connect(ui->ButtonDefaultSpNavMotions, &QPushButton::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_ButtonDefaultSpNavMotions_clicked);
|
||||
connect(ui->ButtonCalibrate, &QPushButton::clicked,
|
||||
this, &DlgCustomizeSpNavSettings::on_ButtonCalibrate_clicked);
|
||||
}
|
||||
|
||||
void DlgCustomizeSpNavSettings::setMessage(const QString& message)
|
||||
{
|
||||
auto messageLabel = new QLabel(message,this);
|
||||
|
||||
@@ -46,6 +46,9 @@ namespace Gui
|
||||
void onAddMacroAction(const QByteArray&) override;
|
||||
void onRemoveMacroAction(const QByteArray&) override;
|
||||
void onModifyMacroAction(const QByteArray&) override;
|
||||
|
||||
protected:
|
||||
void setupConnections();
|
||||
void on_CBDominant_clicked();
|
||||
void on_CBFlipYZ_clicked();
|
||||
void on_CBRotations_clicked();
|
||||
|
||||
@@ -77,6 +77,7 @@ DlgCustomKeyboardImp::DlgCustomKeyboardImp( QWidget* parent )
|
||||
, firstShow(true)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
// Force create actions for all commands with shortcut to register with ShortcutManager
|
||||
for (auto cmd : Application::Instance->commandManager().getAllCommands()) {
|
||||
@@ -114,6 +115,24 @@ DlgCustomKeyboardImp::~DlgCustomKeyboardImp()
|
||||
{
|
||||
}
|
||||
|
||||
void DlgCustomKeyboardImp::setupConnections()
|
||||
{
|
||||
connect(ui->categoryBox, qOverload<int>(&QComboBox::activated),
|
||||
this, &DlgCustomKeyboardImp::onCategoryBoxActivated);
|
||||
connect(ui->commandTreeWidget, &QTreeWidget::currentItemChanged,
|
||||
this, &DlgCustomKeyboardImp::onCommandTreeWidgetCurrentItemChanged);
|
||||
connect(ui->buttonAssign, &QPushButton::clicked,
|
||||
this, &DlgCustomKeyboardImp::onButtonAssignClicked);
|
||||
connect(ui->buttonClear, &QPushButton::clicked,
|
||||
this, &DlgCustomKeyboardImp::onButtonClearClicked);
|
||||
connect(ui->buttonReset, &QPushButton::clicked,
|
||||
this, &DlgCustomKeyboardImp::onButtonResetClicked);
|
||||
connect(ui->buttonResetAll, &QPushButton::clicked,
|
||||
this, &DlgCustomKeyboardImp::onButtonResetAllClicked);
|
||||
connect(ui->editShortcut, &AccelLineEdit::textChanged,
|
||||
this, &DlgCustomKeyboardImp::onEditShortcutTextChanged);
|
||||
}
|
||||
|
||||
void DlgCustomKeyboardImp::initCommandCompleter(QLineEdit *edit,
|
||||
QComboBox *combo,
|
||||
QTreeWidget *commandTreeWidget,
|
||||
@@ -398,7 +417,7 @@ void DlgCustomKeyboardImp::showEvent(QShowEvent* e)
|
||||
}
|
||||
|
||||
/** Shows the description for the corresponding command */
|
||||
void DlgCustomKeyboardImp::on_commandTreeWidget_currentItemChanged(QTreeWidgetItem* item)
|
||||
void DlgCustomKeyboardImp::onCommandTreeWidgetCurrentItemChanged(QTreeWidgetItem* item)
|
||||
{
|
||||
if (!item)
|
||||
return;
|
||||
@@ -424,7 +443,7 @@ void DlgCustomKeyboardImp::on_commandTreeWidget_currentItemChanged(QTreeWidgetIt
|
||||
}
|
||||
|
||||
/** Shows all commands of this category */
|
||||
void DlgCustomKeyboardImp::on_categoryBox_activated(int)
|
||||
void DlgCustomKeyboardImp::onCategoryBoxActivated(int)
|
||||
{
|
||||
ui->buttonAssign->setEnabled(false);
|
||||
ui->buttonReset->setEnabled(false);
|
||||
@@ -459,19 +478,19 @@ void DlgCustomKeyboardImp::setShortcutOfCurrentAction(const QString& accelText)
|
||||
}
|
||||
|
||||
/** Assigns a new accelerator to the selected command. */
|
||||
void DlgCustomKeyboardImp::on_buttonAssign_clicked()
|
||||
void DlgCustomKeyboardImp::onButtonAssignClicked()
|
||||
{
|
||||
setShortcutOfCurrentAction(ui->editShortcut->text());
|
||||
}
|
||||
|
||||
/** Clears the accelerator of the selected command. */
|
||||
void DlgCustomKeyboardImp::on_buttonClear_clicked()
|
||||
void DlgCustomKeyboardImp::onButtonClearClicked()
|
||||
{
|
||||
setShortcutOfCurrentAction(QString());
|
||||
}
|
||||
|
||||
/** Resets the accelerator of the selected command to the default. */
|
||||
void DlgCustomKeyboardImp::on_buttonReset_clicked()
|
||||
void DlgCustomKeyboardImp::onButtonResetClicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->commandTreeWidget->currentItem();
|
||||
if (!item)
|
||||
@@ -487,14 +506,14 @@ void DlgCustomKeyboardImp::on_buttonReset_clicked()
|
||||
}
|
||||
|
||||
/** Resets the accelerator of all commands to the default. */
|
||||
void DlgCustomKeyboardImp::on_buttonResetAll_clicked()
|
||||
void DlgCustomKeyboardImp::onButtonResetAllClicked()
|
||||
{
|
||||
ShortcutManager::instance()->resetAll();
|
||||
ui->buttonReset->setEnabled(false);
|
||||
}
|
||||
|
||||
/** Checks for an already occupied shortcut. */
|
||||
void DlgCustomKeyboardImp::on_editShortcut_textChanged(const QString& )
|
||||
void DlgCustomKeyboardImp::onEditShortcutTextChanged(const QString& )
|
||||
{
|
||||
QTreeWidgetItem* item = ui->commandTreeWidget->currentItem();
|
||||
if (item) {
|
||||
|
||||
@@ -100,14 +100,17 @@ protected:
|
||||
AccelLineEdit *editor,
|
||||
AccelLineEdit *current);
|
||||
//@}
|
||||
protected:
|
||||
void setupConnections();
|
||||
void onCategoryBoxActivated(int index);
|
||||
void onCommandTreeWidgetCurrentItemChanged(QTreeWidgetItem*);
|
||||
void onButtonAssignClicked();
|
||||
void onButtonClearClicked();
|
||||
void onButtonResetClicked();
|
||||
void onButtonResetAllClicked();
|
||||
void onEditShortcutTextChanged(const QString&);
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_categoryBox_activated(int index);
|
||||
void on_commandTreeWidget_currentItemChanged(QTreeWidgetItem*);
|
||||
void on_buttonAssign_clicked();
|
||||
void on_buttonClear_clicked();
|
||||
void on_buttonReset_clicked();
|
||||
void on_buttonResetAll_clicked();
|
||||
void on_editShortcut_textChanged(const QString&);
|
||||
void onAddMacroAction(const QByteArray&) override;
|
||||
void onRemoveMacroAction(const QByteArray&) override;
|
||||
void onModifyMacroAction(const QByteArray&) override;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -49,20 +49,20 @@ public:
|
||||
|
||||
void accept() override;
|
||||
|
||||
public Q_SLOTS:
|
||||
void on_fileChooser_fileNameChanged(const QString&);
|
||||
void on_createButton_clicked();
|
||||
void on_deleteButton_clicked();
|
||||
void on_editButton_clicked();
|
||||
void on_renameButton_clicked();
|
||||
void on_duplicateButton_clicked();
|
||||
void on_toolbarButton_clicked();
|
||||
void on_addonsButton_clicked();
|
||||
private:
|
||||
void setupConnections();
|
||||
void onFileChooserFileNameChanged(const QString&);
|
||||
void onCreateButtonClicked();
|
||||
void onDeleteButtonClicked();
|
||||
void onEditButtonClicked();
|
||||
void onRenameButtonClicked();
|
||||
void onDuplicateButtonClicked();
|
||||
void onToolbarButtonClicked();
|
||||
void onAddonsButtonClicked();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_userMacroListBox_currentItemChanged(QTreeWidgetItem*);
|
||||
void on_systemMacroListBox_currentItemChanged(QTreeWidgetItem*);
|
||||
void on_tabMacroWidget_currentChanged(int index);
|
||||
void onUserMacroListBoxCurrentItemChanged(QTreeWidgetItem*);
|
||||
void onSystemMacroListBoxCurrentItemChanged(QTreeWidgetItem*);
|
||||
void onTabMacroWidgetCurrentChanged(int index);
|
||||
|
||||
protected:
|
||||
void fillUpList();
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
<property name="windowTitle">
|
||||
<string>Macro recording</string>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
@@ -154,9 +151,9 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonCancel">
|
||||
<widget class="QPushButton" name="buttonClose">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -169,7 +166,7 @@
|
||||
<tabstop>lineEditPath</tabstop>
|
||||
<tabstop>buttonStart</tabstop>
|
||||
<tabstop>buttonStop</tabstop>
|
||||
<tabstop>buttonCancel</tabstop>
|
||||
<tabstop>buttonClose</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@@ -53,6 +53,7 @@ DlgMacroRecordImp::DlgMacroRecordImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
, ui(new Ui_DlgMacroRecord)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
// get the macro home path
|
||||
this->macroPath = QString::fromUtf8(getWindowParameter()->GetASCII("MacroPath",
|
||||
@@ -77,10 +78,24 @@ DlgMacroRecordImp::~DlgMacroRecordImp()
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
void DlgMacroRecordImp::setupConnections()
|
||||
{
|
||||
connect(ui->buttonStart, &QPushButton::clicked,
|
||||
this, &DlgMacroRecordImp::onButtonStartClicked);
|
||||
connect(ui->buttonStop, &QPushButton::clicked,
|
||||
this, &DlgMacroRecordImp::onButtonStopClicked);
|
||||
connect(ui->buttonClose, &QPushButton::clicked,
|
||||
this, &DlgMacroRecordImp::onButtonCloseClicked);
|
||||
connect(ui->pushButtonChooseDir, &QPushButton::clicked,
|
||||
this, &DlgMacroRecordImp::onButtonChooseDirClicked);
|
||||
connect(ui->lineEditMacroPath, &QLineEdit::textChanged,
|
||||
this, &DlgMacroRecordImp::onMacroPathTextChanged);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the record of the macro.
|
||||
*/
|
||||
void DlgMacroRecordImp::on_buttonStart_clicked()
|
||||
void DlgMacroRecordImp::onButtonStartClicked()
|
||||
{
|
||||
// test if the path already set
|
||||
if (ui->lineEditPath->text().isEmpty()) {
|
||||
@@ -98,7 +113,10 @@ void DlgMacroRecordImp::on_buttonStart_clicked()
|
||||
|
||||
// search in the macro path first for an already existing macro
|
||||
QString fn = this->macroPath + ui->lineEditPath->text();
|
||||
if (!fn.endsWith(QLatin1String(".FCMacro"))) fn += QLatin1String(".FCMacro");
|
||||
if (!fn.endsWith(QLatin1String(".FCMacro"))) {
|
||||
fn += QLatin1String(".FCMacro");
|
||||
}
|
||||
|
||||
QFileInfo fi(fn);
|
||||
if (fi.isFile() && fi.exists()) {
|
||||
if (QMessageBox::question(this, tr("Existing macro"),
|
||||
@@ -118,13 +136,17 @@ void DlgMacroRecordImp::on_buttonStart_clicked()
|
||||
|
||||
// open the macro recording
|
||||
this->macroManager->open(MacroManager::File, fn.toUtf8().constData());
|
||||
accept();
|
||||
|
||||
ui->buttonStart->setEnabled(false);
|
||||
ui->buttonStop->setEnabled(true);
|
||||
ui->buttonClose->setEnabled(false);
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
/**
|
||||
* Abort the macro.
|
||||
*/
|
||||
void DlgMacroRecordImp::on_buttonCancel_clicked()
|
||||
void DlgMacroRecordImp::onButtonCloseClicked()
|
||||
{
|
||||
if (this->macroManager->isOpen()) {
|
||||
this->macroManager->cancel();
|
||||
@@ -136,17 +158,20 @@ void DlgMacroRecordImp::on_buttonCancel_clicked()
|
||||
/**
|
||||
* Stops the record of the macro and save to the file.
|
||||
*/
|
||||
void DlgMacroRecordImp::on_buttonStop_clicked()
|
||||
void DlgMacroRecordImp::onButtonStopClicked()
|
||||
{
|
||||
if(this->macroManager->isOpen()) {
|
||||
if (this->macroManager->isOpen()) {
|
||||
// ends the macrorecording and save the file...
|
||||
this->macroManager->commit();
|
||||
}
|
||||
|
||||
ui->buttonStart->setEnabled(true);
|
||||
ui->buttonStop->setEnabled(false);
|
||||
ui->buttonClose->setEnabled(true);
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void DlgMacroRecordImp::on_pushButtonChooseDir_clicked()
|
||||
void DlgMacroRecordImp::onButtonChooseDirClicked()
|
||||
{
|
||||
QString newDir = QFileDialog::getExistingDirectory(nullptr,tr("Choose macro directory"),macroPath);
|
||||
if (!newDir.isEmpty()) {
|
||||
@@ -156,7 +181,7 @@ void DlgMacroRecordImp::on_pushButtonChooseDir_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void DlgMacroRecordImp::on_lineEditMacroPath_textChanged (const QString & newDir)
|
||||
void DlgMacroRecordImp::onMacroPathTextChanged (const QString & newDir)
|
||||
{
|
||||
macroPath = newDir;
|
||||
}
|
||||
|
||||
@@ -45,12 +45,13 @@ public:
|
||||
explicit DlgMacroRecordImp( QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() );
|
||||
~DlgMacroRecordImp() override;
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_buttonStart_clicked();
|
||||
void on_buttonStop_clicked();
|
||||
void on_buttonCancel_clicked();
|
||||
void on_pushButtonChooseDir_clicked();
|
||||
void on_lineEditMacroPath_textChanged ( const QString & );
|
||||
protected:
|
||||
void setupConnections();
|
||||
void onButtonStartClicked();
|
||||
void onButtonStopClicked();
|
||||
void onButtonCloseClicked();
|
||||
void onButtonChooseDirClicked();
|
||||
void onMacroPathTextChanged ( const QString & );
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgMacroRecord> ui;
|
||||
|
||||
@@ -48,6 +48,8 @@ DlgMaterialPropertiesImp::DlgMaterialPropertiesImp(const std::string& mat, QWidg
|
||||
, material(mat)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
if (material != "ShapeMaterial") {
|
||||
ui->textLabel1->hide();
|
||||
ui->diffuseColor->hide();
|
||||
@@ -66,6 +68,20 @@ DlgMaterialPropertiesImp::~DlgMaterialPropertiesImp()
|
||||
{
|
||||
}
|
||||
|
||||
void DlgMaterialPropertiesImp::setupConnections()
|
||||
{
|
||||
connect(ui->ambientColor, &ColorButton::changed,
|
||||
this, &DlgMaterialPropertiesImp::onAmbientColorChanged);
|
||||
connect(ui->diffuseColor, &ColorButton::changed,
|
||||
this, &DlgMaterialPropertiesImp::onDiffuseColorChanged);
|
||||
connect(ui->emissiveColor, &ColorButton::clicked,
|
||||
this, &DlgMaterialPropertiesImp::onEmissiveColorChanged);
|
||||
connect(ui->specularColor, &ColorButton::clicked,
|
||||
this, &DlgMaterialPropertiesImp::onSpecularColorChanged);
|
||||
connect(ui->shininess, qOverload<int>(&QSpinBox::valueChanged),
|
||||
this, &DlgMaterialPropertiesImp::onShininessValueChanged);
|
||||
}
|
||||
|
||||
QColor DlgMaterialPropertiesImp::diffuseColor() const
|
||||
{
|
||||
return ui->diffuseColor->color();
|
||||
@@ -74,7 +90,7 @@ QColor DlgMaterialPropertiesImp::diffuseColor() const
|
||||
/**
|
||||
* Sets the ambient color.
|
||||
*/
|
||||
void DlgMaterialPropertiesImp::on_ambientColor_changed()
|
||||
void DlgMaterialPropertiesImp::onAmbientColorChanged()
|
||||
{
|
||||
QColor col = ui->ambientColor->color();
|
||||
float r = (float)col.red() / 255.0f;
|
||||
@@ -96,7 +112,7 @@ void DlgMaterialPropertiesImp::on_ambientColor_changed()
|
||||
/**
|
||||
* Sets the diffuse color.
|
||||
*/
|
||||
void DlgMaterialPropertiesImp::on_diffuseColor_changed()
|
||||
void DlgMaterialPropertiesImp::onDiffuseColorChanged()
|
||||
{
|
||||
QColor col = ui->diffuseColor->color();
|
||||
float r = (float)col.red() / 255.0f;
|
||||
@@ -118,7 +134,7 @@ void DlgMaterialPropertiesImp::on_diffuseColor_changed()
|
||||
/**
|
||||
* Sets the emissive color.
|
||||
*/
|
||||
void DlgMaterialPropertiesImp::on_emissiveColor_changed()
|
||||
void DlgMaterialPropertiesImp::onEmissiveColorChanged()
|
||||
{
|
||||
QColor col = ui->emissiveColor->color();
|
||||
float r = (float)col.red() / 255.0f;
|
||||
@@ -140,7 +156,7 @@ void DlgMaterialPropertiesImp::on_emissiveColor_changed()
|
||||
/**
|
||||
* Sets the specular color.
|
||||
*/
|
||||
void DlgMaterialPropertiesImp::on_specularColor_changed()
|
||||
void DlgMaterialPropertiesImp::onSpecularColorChanged()
|
||||
{
|
||||
QColor col = ui->specularColor->color();
|
||||
float r = (float)col.red() / 255.0f;
|
||||
@@ -162,7 +178,7 @@ void DlgMaterialPropertiesImp::on_specularColor_changed()
|
||||
/**
|
||||
* Sets the current shininess.
|
||||
*/
|
||||
void DlgMaterialPropertiesImp::on_shininess_valueChanged(int sh)
|
||||
void DlgMaterialPropertiesImp::onShininessValueChanged(int sh)
|
||||
{
|
||||
float shininess = (float)sh / 100.0f;
|
||||
for (std::vector<ViewProvider*>::iterator it = Objects.begin(); it != Objects.end(); ++it) {
|
||||
|
||||
@@ -44,12 +44,13 @@ public:
|
||||
void setViewProviders(const std::vector<Gui::ViewProvider*>&);
|
||||
QColor diffuseColor() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void on_ambientColor_changed();
|
||||
void on_diffuseColor_changed();
|
||||
void on_emissiveColor_changed();
|
||||
void on_specularColor_changed();
|
||||
void on_shininess_valueChanged(int);
|
||||
private:
|
||||
void setupConnections();
|
||||
void onAmbientColorChanged();
|
||||
void onDiffuseColorChanged();
|
||||
void onEmissiveColorChanged();
|
||||
void onSpecularColorChanged();
|
||||
void onShininessValueChanged(int);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_DlgMaterialProperties> ui;
|
||||
|
||||
@@ -41,6 +41,8 @@ DlgParameterFind::DlgParameterFind(DlgParameterImp* parent)
|
||||
, dialog(parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
QPushButton* btn = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||
if (btn) {
|
||||
btn->setText(tr("Find Next"));
|
||||
@@ -57,7 +59,19 @@ DlgParameterFind::~DlgParameterFind()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DlgParameterFind::on_lineEdit_textChanged(const QString& text)
|
||||
void DlgParameterFind::setupConnections()
|
||||
{
|
||||
connect(ui->lineEdit, &QLineEdit::textChanged,
|
||||
this, &DlgParameterFind::onLineEditTextChanged);
|
||||
connect(ui->checkGroups, &QCheckBox::toggled,
|
||||
this, &DlgParameterFind::onCheckGroupsToggled);
|
||||
connect(ui->checkNames, &QCheckBox::toggled,
|
||||
this, &DlgParameterFind::onCheckNamesToggled);
|
||||
connect(ui->checkValues, &QCheckBox::toggled,
|
||||
this, &DlgParameterFind::onCheckValuesToggled);
|
||||
}
|
||||
|
||||
void DlgParameterFind::onLineEditTextChanged(const QString& text)
|
||||
{
|
||||
QPushButton* btn = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||
if (btn) {
|
||||
@@ -68,7 +82,7 @@ void DlgParameterFind::on_lineEdit_textChanged(const QString& text)
|
||||
}
|
||||
}
|
||||
|
||||
void DlgParameterFind::on_checkGroups_toggled(bool)
|
||||
void DlgParameterFind::onCheckGroupsToggled(bool)
|
||||
{
|
||||
QPushButton* btn = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||
if (btn) {
|
||||
@@ -80,7 +94,7 @@ void DlgParameterFind::on_checkGroups_toggled(bool)
|
||||
}
|
||||
}
|
||||
|
||||
void DlgParameterFind::on_checkNames_toggled(bool)
|
||||
void DlgParameterFind::onCheckNamesToggled(bool)
|
||||
{
|
||||
QPushButton* btn = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||
if (btn) {
|
||||
@@ -92,7 +106,7 @@ void DlgParameterFind::on_checkNames_toggled(bool)
|
||||
}
|
||||
}
|
||||
|
||||
void DlgParameterFind::on_checkValues_toggled(bool)
|
||||
void DlgParameterFind::onCheckValuesToggled(bool)
|
||||
{
|
||||
QPushButton* btn = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||
if (btn) {
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define GUI_DIALOG_DLGPARAMETERFIND_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <FCGlobal.h>
|
||||
|
||||
class QTreeWidgetItem;
|
||||
|
||||
@@ -39,17 +40,18 @@ class GuiExport DlgParameterFind : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgParameterFind(DlgParameterImp* parent);
|
||||
explicit DlgParameterFind(DlgParameterImp* parent);
|
||||
~DlgParameterFind();
|
||||
|
||||
void accept();
|
||||
void reject();
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_lineEdit_textChanged(const QString&);
|
||||
void on_checkGroups_toggled(bool);
|
||||
void on_checkNames_toggled(bool);
|
||||
void on_checkValues_toggled(bool);
|
||||
private:
|
||||
void setupConnections();
|
||||
void onLineEditTextChanged(const QString&);
|
||||
void onCheckGroupsToggled(bool);
|
||||
void onCheckNamesToggled(bool);
|
||||
void onCheckValuesToggled(bool);
|
||||
|
||||
private:
|
||||
struct Options {
|
||||
|
||||
@@ -61,6 +61,8 @@ DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl )
|
||||
, ui(new Ui_DlgParameter)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
ui->checkSort->setVisible(false); // for testing
|
||||
|
||||
QStringList groupLabels;
|
||||
@@ -129,14 +131,28 @@ DlgParameterImp::~DlgParameterImp()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DlgParameterImp::on_buttonFind_clicked()
|
||||
void DlgParameterImp::setupConnections()
|
||||
{
|
||||
connect(ui->buttonFind, &QPushButton::clicked,
|
||||
this, &DlgParameterImp::onButtonFindClicked);
|
||||
connect(ui->findGroupLE, &QLineEdit::textChanged,
|
||||
this, &DlgParameterImp::onFindGroupTtextChanged);
|
||||
connect(ui->buttonSaveToDisk, &QPushButton::clicked,
|
||||
this, &DlgParameterImp::onButtonSaveToDiskClicked);
|
||||
connect(ui->closeButton, &QPushButton::clicked,
|
||||
this, &DlgParameterImp::onCloseButtonClicked);
|
||||
connect(ui->checkSort, &QCheckBox::toggled,
|
||||
this, &DlgParameterImp::onCheckSortToggled);
|
||||
}
|
||||
|
||||
void DlgParameterImp::onButtonFindClicked()
|
||||
{
|
||||
if (finder.isNull())
|
||||
finder = new DlgParameterFind(this);
|
||||
finder->show();
|
||||
}
|
||||
|
||||
void DlgParameterImp::on_findGroupLE_textChanged(const QString &SearchStr)
|
||||
void DlgParameterImp::onFindGroupTtextChanged(const QString &SearchStr)
|
||||
{
|
||||
// search for group tree items and highlight found results
|
||||
|
||||
@@ -223,7 +239,7 @@ void DlgParameterImp::changeEvent(QEvent *e)
|
||||
}
|
||||
}
|
||||
|
||||
void DlgParameterImp::on_checkSort_toggled(bool on)
|
||||
void DlgParameterImp::onCheckSortToggled(bool on)
|
||||
{
|
||||
paramGroup->setSortingEnabled(on);
|
||||
paramGroup->sortByColumn(0, Qt::AscendingOrder);
|
||||
@@ -234,7 +250,7 @@ void DlgParameterImp::on_checkSort_toggled(bool on)
|
||||
paramValue->header()->setProperty("showSortIndicator", QVariant(on));
|
||||
}
|
||||
|
||||
void DlgParameterImp::on_closeButton_clicked()
|
||||
void DlgParameterImp::onCloseButtonClicked()
|
||||
{
|
||||
close();
|
||||
}
|
||||
@@ -414,7 +430,7 @@ void DlgParameterImp::onChangeParameterSet(int itemPos)
|
||||
paramGroup->setCurrentItem(paramGroup->topLevelItem(0));
|
||||
}
|
||||
|
||||
void DlgParameterImp::on_buttonSaveToDisk_clicked()
|
||||
void DlgParameterImp::onButtonSaveToDiskClicked()
|
||||
{
|
||||
int index = ui->parameterSet->currentIndex();
|
||||
ParameterManager* parmgr = App::GetApplication().GetParameterSet(ui->parameterSet->itemData(index).toByteArray());
|
||||
|
||||
@@ -55,15 +55,16 @@ public:
|
||||
|
||||
void activateParameterSet(const char*);
|
||||
|
||||
protected Q_SLOTS:
|
||||
protected:
|
||||
void setupConnections();
|
||||
void onChangeParameterSet(int);
|
||||
void on_buttonFind_clicked();
|
||||
void on_findGroupLE_textChanged(const QString &SearchStr);
|
||||
void on_buttonSaveToDisk_clicked();
|
||||
void onButtonFindClicked();
|
||||
void onFindGroupTtextChanged(const QString &SearchStr);
|
||||
void onButtonSaveToDiskClicked();
|
||||
|
||||
void onGroupSelected(QTreeWidgetItem *);
|
||||
void on_closeButton_clicked();
|
||||
void on_checkSort_toggled(bool);
|
||||
void onCloseButtonClicked();
|
||||
void onCheckSortToggled(bool);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e) override;
|
||||
|
||||
@@ -71,6 +71,13 @@ DlgPropertyLink::DlgPropertyLink(QWidget* parent)
|
||||
, ui(new Ui_DlgPropertyLink)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->checkObjectType, &QCheckBox::toggled,
|
||||
this, &DlgPropertyLink::onObjectTypeToggled);
|
||||
connect(ui->typeTree, &QTreeWidget::itemSelectionChanged,
|
||||
this, &DlgPropertyLink::onTypeTreeItemSelectionChanged);
|
||||
connect(ui->searchBox, &ExpressionLineEdit::textChanged,
|
||||
this, &DlgPropertyLink::onSearchBoxTextChanged);
|
||||
|
||||
ui->typeTree->hide();
|
||||
ui->searchBox->installEventFilter(this);
|
||||
ui->searchBox->setNoProperty(true);
|
||||
@@ -1047,13 +1054,13 @@ void DlgPropertyLink::onItemExpanded(QTreeWidgetItem * item) {
|
||||
}
|
||||
}
|
||||
|
||||
void DlgPropertyLink::on_checkObjectType_toggled(bool on)
|
||||
void DlgPropertyLink::onObjectTypeToggled(bool on)
|
||||
{
|
||||
ui->typeTree->setVisible(on);
|
||||
filterObjects();
|
||||
}
|
||||
|
||||
void DlgPropertyLink::on_typeTree_itemSelectionChanged() {
|
||||
void DlgPropertyLink::onTypeTreeItemSelectionChanged() {
|
||||
|
||||
selectedTypes.clear();
|
||||
const auto items = ui->typeTree->selectedItems();
|
||||
@@ -1064,7 +1071,7 @@ void DlgPropertyLink::on_typeTree_itemSelectionChanged() {
|
||||
filterObjects();
|
||||
}
|
||||
|
||||
void DlgPropertyLink::on_searchBox_textChanged(const QString& text)
|
||||
void DlgPropertyLink::onSearchBoxTextChanged(const QString& text)
|
||||
{
|
||||
itemSearch(text,false);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
|
||||
#define FC_XLINK_VALUE_INDEX 5
|
||||
|
||||
class QTreeWidgetItem;
|
||||
|
||||
namespace Gui { namespace Dialog {
|
||||
|
||||
class Ui_DlgPropertyLink;
|
||||
@@ -39,7 +41,7 @@ class DlgPropertyLink : public QDialog, public Gui::SelectionObserver
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DlgPropertyLink(QWidget* parent = nullptr);
|
||||
explicit DlgPropertyLink(QWidget* parent = nullptr);
|
||||
~DlgPropertyLink() override;
|
||||
|
||||
void accept() override;
|
||||
@@ -74,10 +76,10 @@ protected:
|
||||
|
||||
void onSelectionChanged(const Gui::SelectionChanges& msg) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_checkObjectType_toggled(bool);
|
||||
void on_typeTree_itemSelectionChanged();
|
||||
void on_searchBox_textChanged(const QString&);
|
||||
private:
|
||||
void onObjectTypeToggled(bool);
|
||||
void onTypeTreeItemSelectionChanged();
|
||||
void onSearchBoxTextChanged(const QString&);
|
||||
void onItemExpanded(QTreeWidgetItem * item);
|
||||
void onItemSelectionChanged();
|
||||
void onItemEntered(QTreeWidgetItem *item);
|
||||
|
||||
@@ -44,6 +44,8 @@ DlgSettingsImageImp::DlgSettingsImageImp( QWidget* parent )
|
||||
, ui(new Ui_DlgSettingsImage)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
SbVec2s res = SoOffscreenRenderer::getMaximumResolution();
|
||||
ui->spinWidth->setMaximum((int)res[0]);
|
||||
ui->spinHeight->setMaximum((int)res[1]);
|
||||
@@ -66,6 +68,22 @@ DlgSettingsImageImp::~DlgSettingsImageImp()
|
||||
// no need to delete child widgets, Qt does it all for us
|
||||
}
|
||||
|
||||
void DlgSettingsImageImp::setupConnections()
|
||||
{
|
||||
connect(ui->buttonRatioScreen, &QToolButton::clicked,
|
||||
this, &DlgSettingsImageImp::onButtonRatioScreenClicked);
|
||||
connect(ui->buttonRatio4x3, &QToolButton::clicked,
|
||||
this, &DlgSettingsImageImp::onButtonRatio4x3Clicked);
|
||||
connect(ui->buttonRatio16x9, &QToolButton::clicked,
|
||||
this, &DlgSettingsImageImp::onButtonRatio16x9Clicked);
|
||||
connect(ui->buttonRatio1x1, &QToolButton::clicked,
|
||||
this, &DlgSettingsImageImp::onButtonRatio1x1Clicked);
|
||||
connect(ui->standardSizeBox, qOverload<int>(&QComboBox::activated),
|
||||
this, &DlgSettingsImageImp::onStandardSizeBoxActivated);
|
||||
connect(ui->comboMethod, qOverload<int>(&QComboBox::activated),
|
||||
this, &DlgSettingsImageImp::onComboMethodActivated);
|
||||
}
|
||||
|
||||
void DlgSettingsImageImp::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
@@ -188,27 +206,27 @@ void DlgSettingsImageImp::adjustImageSize(float fRatio)
|
||||
}
|
||||
}
|
||||
|
||||
void DlgSettingsImageImp::on_buttonRatioScreen_clicked()
|
||||
void DlgSettingsImageImp::onButtonRatioScreenClicked()
|
||||
{
|
||||
adjustImageSize(_fRatio);
|
||||
}
|
||||
|
||||
void DlgSettingsImageImp::on_buttonRatio4x3_clicked()
|
||||
void DlgSettingsImageImp::onButtonRatio4x3Clicked()
|
||||
{
|
||||
adjustImageSize(4.0f/3.0f);
|
||||
}
|
||||
|
||||
void DlgSettingsImageImp::on_buttonRatio16x9_clicked()
|
||||
void DlgSettingsImageImp::onButtonRatio16x9Clicked()
|
||||
{
|
||||
adjustImageSize(16.0f/9.0f);
|
||||
}
|
||||
|
||||
void DlgSettingsImageImp::on_buttonRatio1x1_clicked()
|
||||
void DlgSettingsImageImp::onButtonRatio1x1Clicked()
|
||||
{
|
||||
adjustImageSize(1.0f);
|
||||
}
|
||||
|
||||
void DlgSettingsImageImp::on_standardSizeBox_activated(int index)
|
||||
void DlgSettingsImageImp::onStandardSizeBoxActivated(int index)
|
||||
{
|
||||
if (index == 0) {
|
||||
// we have set the user data for the 1st item
|
||||
@@ -250,7 +268,7 @@ QByteArray DlgSettingsImageImp::method() const
|
||||
return ui->comboMethod->currentData().toByteArray();
|
||||
}
|
||||
|
||||
void DlgSettingsImageImp::on_comboMethod_activated(int index)
|
||||
void DlgSettingsImageImp::onComboMethodActivated(int index)
|
||||
{
|
||||
QByteArray data = ui->comboMethod->itemData(index).toByteArray();
|
||||
if (data == QByteArray("GrabFramebuffer")) {
|
||||
|
||||
@@ -68,13 +68,14 @@ public:
|
||||
public Q_SLOTS:
|
||||
void onSelectedFilter( const QString& );
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_buttonRatioScreen_clicked();
|
||||
void on_buttonRatio4x3_clicked();
|
||||
void on_buttonRatio16x9_clicked();
|
||||
void on_buttonRatio1x1_clicked();
|
||||
void on_standardSizeBox_activated(int);
|
||||
void on_comboMethod_activated(int);
|
||||
protected:
|
||||
void setupConnections();
|
||||
void onButtonRatioScreenClicked();
|
||||
void onButtonRatio4x3Clicked();
|
||||
void onButtonRatio16x9Clicked();
|
||||
void onButtonRatio1x1Clicked();
|
||||
void onStandardSizeBoxActivated(int);
|
||||
void onComboMethodActivated(int);
|
||||
|
||||
protected:
|
||||
// helper to force an aspect ratio
|
||||
|
||||
@@ -362,7 +362,8 @@ CameraDialog::CameraDialog(QWidget* parent)
|
||||
|
||||
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
connect(currentViewButton, &QPushButton::clicked, this,
|
||||
&CameraDialog::onCurrentViewClicked);
|
||||
}
|
||||
|
||||
CameraDialog::~CameraDialog()
|
||||
@@ -385,7 +386,7 @@ void CameraDialog::getValues(double& q0, double& q1, double& q2, double& q3) con
|
||||
q3 = sb3->value();
|
||||
}
|
||||
|
||||
void CameraDialog::on_currentView_clicked()
|
||||
void CameraDialog::onCurrentViewClicked()
|
||||
{
|
||||
auto mdi = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
|
||||
if (mdi) {
|
||||
|
||||
@@ -75,8 +75,8 @@ public:
|
||||
void getValues(double& q0, double& q1, double& q2, double& q3) const;
|
||||
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_currentView_clicked();
|
||||
private:
|
||||
void onCurrentViewClicked();
|
||||
|
||||
private:
|
||||
QDoubleSpinBox* sb0;
|
||||
|
||||
@@ -62,6 +62,8 @@ DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent)
|
||||
, type(t)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
ui->moveActionRightButton->setIcon(BitmapFactory().iconFromTheme("button_right"));
|
||||
ui->moveActionLeftButton->setIcon(BitmapFactory().iconFromTheme("button_left"));
|
||||
ui->moveActionDownButton->setIcon(BitmapFactory().iconFromTheme("button_down"));
|
||||
@@ -107,7 +109,7 @@ DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent)
|
||||
int index = ui->workbenchBox->findData(name);
|
||||
ui->workbenchBox->setCurrentIndex(index);
|
||||
}
|
||||
on_workbenchBox_activated(ui->workbenchBox->currentIndex());
|
||||
onWorkbenchBoxActivated(ui->workbenchBox->currentIndex());
|
||||
}
|
||||
|
||||
/** Destroys the object and frees any allocated resources */
|
||||
@@ -115,6 +117,26 @@ DlgCustomToolbars::~DlgCustomToolbars()
|
||||
{
|
||||
}
|
||||
|
||||
void DlgCustomToolbars::setupConnections()
|
||||
{
|
||||
connect(ui->workbenchBox, qOverload<int>(&QComboBox::activated),
|
||||
this, &DlgCustomToolbars::onWorkbenchBoxActivated);
|
||||
connect(ui->moveActionRightButton, &QPushButton::clicked,
|
||||
this, &DlgCustomToolbars::onMoveActionRightButtonClicked);
|
||||
connect(ui->moveActionLeftButton, &QPushButton::clicked,
|
||||
this, &DlgCustomToolbars::onMoveActionLeftButtonClicked);
|
||||
connect(ui->moveActionUpButton, &QPushButton::clicked,
|
||||
this, &DlgCustomToolbars::onMoveActionUpButtonClicked);
|
||||
connect(ui->moveActionDownButton, &QPushButton::clicked,
|
||||
this, &DlgCustomToolbars::onMoveActionDownButtonClicked);
|
||||
connect(ui->newButton, &QPushButton::clicked,
|
||||
this, &DlgCustomToolbars::onNewButtonClicked);
|
||||
connect(ui->renameButton, &QPushButton::clicked,
|
||||
this, &DlgCustomToolbars::onRenameButtonClicked);
|
||||
connect(ui->deleteButton, &QPushButton::clicked,
|
||||
this, &DlgCustomToolbars::onDeleteButtonClicked);
|
||||
}
|
||||
|
||||
void DlgCustomToolbars::addCustomToolbar(const QString&)
|
||||
{
|
||||
}
|
||||
@@ -156,7 +178,7 @@ void DlgCustomToolbars::onActivateCategoryBox()
|
||||
{
|
||||
}
|
||||
|
||||
void DlgCustomToolbars::on_workbenchBox_activated(int index)
|
||||
void DlgCustomToolbars::onWorkbenchBoxActivated(int index)
|
||||
{
|
||||
QVariant data = ui->workbenchBox->itemData(index, Qt::UserRole);
|
||||
QString workbench = data.toString();
|
||||
@@ -270,7 +292,7 @@ void DlgCustomToolbars::exportCustomToolbars(const QByteArray& workbench)
|
||||
}
|
||||
|
||||
/** Adds a new action */
|
||||
void DlgCustomToolbars::on_moveActionRightButton_clicked()
|
||||
void DlgCustomToolbars::onMoveActionRightButtonClicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->commandTreeWidget->currentItem();
|
||||
if (item) {
|
||||
@@ -296,7 +318,7 @@ void DlgCustomToolbars::on_moveActionRightButton_clicked()
|
||||
}
|
||||
|
||||
/** Removes an action */
|
||||
void DlgCustomToolbars::on_moveActionLeftButton_clicked()
|
||||
void DlgCustomToolbars::onMoveActionLeftButtonClicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->toolbarTreeWidget->currentItem();
|
||||
if (item && item->parent() && item->isSelected()) {
|
||||
@@ -330,7 +352,7 @@ void DlgCustomToolbars::on_moveActionLeftButton_clicked()
|
||||
}
|
||||
|
||||
/** Moves up an action */
|
||||
void DlgCustomToolbars::on_moveActionUpButton_clicked()
|
||||
void DlgCustomToolbars::onMoveActionUpButtonClicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->toolbarTreeWidget->currentItem();
|
||||
if (item && item->parent() && item->isSelected()) {
|
||||
@@ -368,7 +390,7 @@ void DlgCustomToolbars::on_moveActionUpButton_clicked()
|
||||
}
|
||||
|
||||
/** Moves down an action */
|
||||
void DlgCustomToolbars::on_moveActionDownButton_clicked()
|
||||
void DlgCustomToolbars::onMoveActionDownButtonClicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->toolbarTreeWidget->currentItem();
|
||||
if (item && item->parent() && item->isSelected()) {
|
||||
@@ -405,7 +427,7 @@ void DlgCustomToolbars::on_moveActionDownButton_clicked()
|
||||
exportCustomToolbars(workbench.toLatin1());
|
||||
}
|
||||
|
||||
void DlgCustomToolbars::on_newButton_clicked()
|
||||
void DlgCustomToolbars::onNewButtonClicked()
|
||||
{
|
||||
bool ok;
|
||||
QString text = QString::fromLatin1("Custom%1").arg(ui->toolbarTreeWidget->topLevelItemCount()+1);
|
||||
@@ -433,7 +455,7 @@ void DlgCustomToolbars::on_newButton_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void DlgCustomToolbars::on_deleteButton_clicked()
|
||||
void DlgCustomToolbars::onDeleteButtonClicked()
|
||||
{
|
||||
QTreeWidgetItem* item = ui->toolbarTreeWidget->currentItem();
|
||||
if (item && !item->parent() && item->isSelected()) {
|
||||
@@ -448,7 +470,7 @@ void DlgCustomToolbars::on_deleteButton_clicked()
|
||||
exportCustomToolbars(workbench.toLatin1());
|
||||
}
|
||||
|
||||
void DlgCustomToolbars::on_renameButton_clicked()
|
||||
void DlgCustomToolbars::onRenameButtonClicked()
|
||||
{
|
||||
bool renamed = false;
|
||||
QTreeWidgetItem* item = ui->toolbarTreeWidget->currentItem();
|
||||
|
||||
@@ -52,15 +52,18 @@ protected:
|
||||
explicit DlgCustomToolbars(Type, QWidget* parent = nullptr);
|
||||
~DlgCustomToolbars() override;
|
||||
|
||||
protected:
|
||||
void setupConnections();
|
||||
void onWorkbenchBoxActivated(int index);
|
||||
void onMoveActionRightButtonClicked();
|
||||
void onMoveActionLeftButtonClicked();
|
||||
void onMoveActionUpButtonClicked();
|
||||
void onMoveActionDownButtonClicked();
|
||||
void onNewButtonClicked();
|
||||
void onRenameButtonClicked();
|
||||
void onDeleteButtonClicked();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void on_workbenchBox_activated(int index);
|
||||
void on_moveActionRightButton_clicked();
|
||||
void on_moveActionLeftButton_clicked();
|
||||
void on_moveActionUpButton_clicked();
|
||||
void on_moveActionDownButton_clicked();
|
||||
void on_newButton_clicked();
|
||||
void on_renameButton_clicked();
|
||||
void on_deleteButton_clicked();
|
||||
void onAddMacroAction(const QByteArray&) override;
|
||||
void onRemoveMacroAction(const QByteArray&) override;
|
||||
void onModifyMacroAction(const QByteArray&) override;
|
||||
|
||||
@@ -57,6 +57,12 @@ DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WindowFlags fl )
|
||||
ui->comboBoxScheme->addItem(item, i);
|
||||
}
|
||||
|
||||
connect(ui->unitsBox, qOverload<int>(&QComboBox::activated),
|
||||
this, &DlgUnitsCalculator::onUnitsBoxActivated);
|
||||
connect(ui->comboBoxScheme, qOverload<int>(&QComboBox::activated),
|
||||
this, &DlgUnitsCalculator::onComboBoxSchemeActivated);
|
||||
connect(ui->spinBoxDecimals, qOverload<int>(&QSpinBox::valueChanged),
|
||||
this, &DlgUnitsCalculator::onSpinBoxDecimalsValueChanged);
|
||||
connect(ui->ValueInput, qOverload<const Base::Quantity&>(&InputField::valueChanged),
|
||||
this, &DlgUnitsCalculator::valueChanged);
|
||||
connect(ui->ValueInput, &InputField::returnPressed,
|
||||
@@ -205,7 +211,7 @@ void DlgUnitsCalculator::returnPressed()
|
||||
}
|
||||
}
|
||||
|
||||
void DlgUnitsCalculator::on_unitsBox_activated(int index)
|
||||
void DlgUnitsCalculator::onUnitsBoxActivated(int index)
|
||||
{
|
||||
// SI units use [m], not [mm] for lengths
|
||||
//
|
||||
@@ -218,7 +224,7 @@ void DlgUnitsCalculator::on_unitsBox_activated(int index)
|
||||
ui->quantitySpinBox->setValue(Base::Quantity(value * std::pow(10.0, 3*(len-old)), unit));
|
||||
}
|
||||
|
||||
void DlgUnitsCalculator::on_comboBoxScheme_activated(int index)
|
||||
void DlgUnitsCalculator::onComboBoxSchemeActivated(int index)
|
||||
{
|
||||
int item = ui->comboBoxScheme->itemData(index).toInt();
|
||||
if (item > 0)
|
||||
@@ -227,7 +233,7 @@ void DlgUnitsCalculator::on_comboBoxScheme_activated(int index)
|
||||
ui->quantitySpinBox->clearSchema();
|
||||
}
|
||||
|
||||
void DlgUnitsCalculator::on_spinBoxDecimals_valueChanged(int value)
|
||||
void DlgUnitsCalculator::onSpinBoxDecimalsValueChanged(int value)
|
||||
{
|
||||
ui->quantitySpinBox->setDecimals(value);
|
||||
}
|
||||
|
||||
@@ -49,12 +49,12 @@ protected:
|
||||
void accept() override;
|
||||
void reject() override;
|
||||
|
||||
protected Q_SLOTS:
|
||||
protected:
|
||||
void textChanged(const QString);
|
||||
void valueChanged(const Base::Quantity&);
|
||||
void on_unitsBox_activated(int);
|
||||
void on_comboBoxScheme_activated(int);
|
||||
void on_spinBoxDecimals_valueChanged(int);
|
||||
void onUnitsBoxActivated(int);
|
||||
void onComboBoxSchemeActivated(int);
|
||||
void onSpinBoxDecimalsValueChanged(int);
|
||||
|
||||
void copy();
|
||||
void returnPressed();
|
||||
|
||||
Reference in New Issue
Block a user