From 77963f9ebf6493b36d2c782dce495ad61c6f647b Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 25 Jun 2022 12:19:26 +0200 Subject: [PATCH] In feature and channel add dialogs ignore apply action if there are no items to select --- sdrgui/gui/channeladddialog.cpp | 2 +- sdrgui/gui/featureadddialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdrgui/gui/channeladddialog.cpp b/sdrgui/gui/channeladddialog.cpp index a9b7138ac..1c40efb5e 100644 --- a/sdrgui/gui/channeladddialog.cpp +++ b/sdrgui/gui/channeladddialog.cpp @@ -46,7 +46,7 @@ void ChannelAddDialog::addChannelNames(const QStringList& channelNames) void ChannelAddDialog::apply(QAbstractButton *button) { - if (button == (QAbstractButton*) ui->buttonBox->button(QDialogButtonBox::Apply)) + if ((ui->channelSelect->count() > 0) && (button == (QAbstractButton*) ui->buttonBox->button(QDialogButtonBox::Apply))) { int selectedChannelIndex = ui->channelSelect->currentIndex(); emit(addChannel(selectedChannelIndex)); diff --git a/sdrgui/gui/featureadddialog.cpp b/sdrgui/gui/featureadddialog.cpp index 798791a3b..709490053 100644 --- a/sdrgui/gui/featureadddialog.cpp +++ b/sdrgui/gui/featureadddialog.cpp @@ -46,7 +46,7 @@ void FeatureAddDialog::addFeatureNames(const QStringList& featureNames) void FeatureAddDialog::apply(QAbstractButton *button) { - if (button == (QAbstractButton*) ui->buttonBox->button(QDialogButtonBox::Apply)) + if ((ui->featureSelect->count() > 0) && (button == (QAbstractButton*) ui->buttonBox->button(QDialogButtonBox::Apply))) { int selectedFeatureIndex = ui->featureSelect->currentIndex(); emit(addFeature(selectedFeatureIndex));