Commit a72cca5f authored by Laurent Montel's avatar Laurent Montel 😁

Allow to enable/disable ok button

parent 75911ccc
......@@ -44,6 +44,7 @@ public:
}
void restoreDialogSize();
AgentConfigurationDialog *q;
QPushButton *okButton = nullptr;
QScopedPointer<AgentConfigurationWidget> widget;
};
......@@ -81,7 +82,10 @@ AgentConfigurationDialog::AgentConfigurationDialog(const AgentInstance &instance
connect(applyButton, &QPushButton::clicked,
d->widget.data(), &AgentConfigurationWidget::save);
}
if ((d->okButton = btnBox->button(QDialogButtonBox::Ok))) {
connect(d->widget.data(), &AgentConfigurationWidget::enableOkButton,
d->okButton, &QPushButton::setEnabled);
}
if (auto plugin = d->widget->d->plugin) {
if (auto aboutData = plugin->aboutData()) {
......
......@@ -46,6 +46,9 @@ public:
void saveDialogSize(const QSize &size);
QDialogButtonBox::StandardButtons standardButtons() const;
Q_SIGNALS:
void enableOkButton(bool enabled);
protected:
void childEvent(QChildEvent *event) override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment