qt_settingsnetwork: Disable Configure button when network card has no configurable parameters

This commit is contained in:
Cacodemon345 2022-02-01 01:46:31 +06:00 committed by GitHub
parent 279cbdbf97
commit f15f00e260
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ static void enableElements(Ui::SettingsNetwork *ui) {
bool adaptersEnabled = netType == NET_TYPE_SLIRP ||
(netType == NET_TYPE_PCAP && ui->comboBoxPcap->currentData().toInt() > 0);
ui->comboBoxAdapter->setEnabled(adaptersEnabled);
ui->pushButtonConfigure->setEnabled(adaptersEnabled && ui->comboBoxAdapter->currentIndex() > 0);
ui->pushButtonConfigure->setEnabled(adaptersEnabled && ui->comboBoxAdapter->currentIndex() > 0 && network_card_has_config(ui->comboBoxAdapter->currentData().toInt()));
}
SettingsNetwork::SettingsNetwork(QWidget *parent) :