Disable profile button if nothing is selected

parent e3eeaac3
......@@ -202,6 +202,8 @@ void CryptoOperationsConfigWidget::setupProfileGui(QBoxLayout *layout)
auto btn = new QPushButton(i18n("Apply"));
btn->setEnabled(false);
profLayout->addWidget(profLabel);
profLayout->addWidget(combo);
profLayout->addWidget(btn);
......@@ -210,6 +212,10 @@ void CryptoOperationsConfigWidget::setupProfileGui(QBoxLayout *layout)
connect(btn, &QPushButton::clicked, this, [this, combo] () {
applyProfile(combo->currentText());
});
connect(combo, QOverload<const QString &>::of(&QComboBox::currentIndexChanged), this, [btn] (const QString &text) {
btn->setEnabled(!text.isEmpty());
});
}
void CryptoOperationsConfigWidget::setupGui()
......
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