In feature and channel add dialogs ignore apply action if there are no items to select

pull/1313/head
f4exb 2022-06-25 12:19:26 +02:00
rodzic d2951627f4
commit 77963f9ebf
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -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));

Wyświetl plik

@ -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));