Commit 74f8884f authored by Volker Krause's avatar Volker Krause
Browse files

Fix feedback configuration button state updates

parent 7dac6843
......@@ -49,9 +49,7 @@ FeedbackConfigDialog::~FeedbackConfigDialog() = default;
void FeedbackConfigDialog::setFeedbackProvider(UserFeedback::Provider* provider)
{
d->ui->configWidget->setFeedbackProvider(provider);
connect(provider, SIGNAL(surveyIntervalChanged()), this, SLOT(updateButtonState()));
connect(provider, SIGNAL(statisticsCollectionModeChanged()), this, SLOT(updateButtonState()));
connect(d->ui->configWidget, SIGNAL(configurationChanged()), this, SLOT(updateButtonState()));
d->updateButtonState();
}
......@@ -65,10 +63,8 @@ void FeedbackConfigDialog::accept()
void FeedbackConfigDialogPrivate::updateButtonState()
{
if (!ui->configWidget->feedbackProvider())
return;
const auto any = ui->configWidget->feedbackProvider()->surveyInterval() >= 0
|| ui->configWidget->feedbackProvider()->statisticsCollectionMode() != Provider::NoStatistics;
const auto any = ui->configWidget->surveyInterval() >= 0
|| ui->configWidget->statisticsCollectionMode() != Provider::NoStatistics;
ui->buttonBox->button(QDialogButtonBox::Ok)->setVisible(any);
ui->buttonBox->button(QDialogButtonBox::Close)->setVisible(!any);
......
......@@ -170,7 +170,9 @@ FeedbackConfigWidget::FeedbackConfigWidget(QWidget* parent)
d->ui->setupUi(this);
connect(d->ui->telemetrySlider, SIGNAL(valueChanged(int)), this, SLOT(telemetrySliderChanged()));
connect(d->ui->telemetrySlider, SIGNAL(valueChanged(int)), this, SIGNAL(configurationChanged()));
connect(d->ui->surveySlider, SIGNAL(valueChanged(int)), this, SLOT(surveySliderChanged()));
connect(d->ui->surveySlider, SIGNAL(valueChanged(int)), this, SIGNAL(configurationChanged()));
d->ui->rawTelemetryButton->setParent(d->ui->telemetryDetails);
d->ui->rawTelemetryButton->setIcon(style()->standardPixmap(QStyle::SP_DialogHelpButton));
......
......@@ -61,6 +61,12 @@ public:
/*! Returns the survey interval currently selected in this widget. */
int surveyInterval() const;
signals:
/*! Emitted when any changes are made to the configuration represented
* in this widget.
*/
void configurationChanged();
protected:
///@cond internal
bool eventFilter(QObject *receiver, QEvent *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