Skip to content

Commit

Permalink
Restore multicat config when choosing LAN profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
BatchDrake committed Feb 20, 2022
1 parent e34bc60 commit e175a8c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Settings/ProfileConfigTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,13 +652,13 @@ ProfileConfigTab::connectAll(void)

connect(
this->ui->mcCheck,
SIGNAL(clicked(bool)),
SIGNAL(stateChanged(int)),
this,
SLOT(onRemoteParamsChanged()));

connect(
this->ui->mcInterfaceEdit,
SIGNAL(textEdited(const QString &)),
SIGNAL(textChanged(const QString &)),
this,
SLOT(onRemoteParamsChanged()));

Expand Down Expand Up @@ -1404,7 +1404,12 @@ ProfileConfigTab::onRemoteProfileSelected(void)

if (this->ui->useNetworkProfileRadio->isChecked()) {
QHash<QString, Suscan::Source::Config>::const_iterator it;
std::string user, pass, mc;
std::string user, pass, mc, mc_if;
bool hasMc;

// Save multicast config
hasMc = this->ui->mcCheck->isChecked();
mc_if = this->ui->mcInterfaceEdit->text().toStdString();

it = sus->getNetworkProfileFrom(this->ui->remoteDeviceCombo->currentText());

Expand All @@ -1427,14 +1432,10 @@ ProfileConfigTab::onRemoteProfileSelected(void)
this->ui->userEdit->setText(user.c_str());
this->ui->passEdit->setText(pass.c_str());

// If mc is enabled, set up accordingly
if (it->hasParam("mc_if")) {
mc = it->getParam("mc_if");
this->ui->mcCheck->setChecked(true);
this->ui->mcInterfaceEdit->setText(mc.c_str());
} else {
this->ui->mcCheck->setChecked(false);
}
// Restore mc config
this->ui->mcCheck->setChecked(hasMc);
this->ui->mcInterfaceEdit->setText(mc_if.c_str());
this->ui->mcInterfaceEdit->setEnabled(hasMc);

this->onRemoteParamsChanged();
}
Expand Down

0 comments on commit e175a8c

Please sign in to comment.