aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl/WifiSettingsDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/qt_sdl/WifiSettingsDialog.cpp')
-rw-r--r--src/frontend/qt_sdl/WifiSettingsDialog.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/frontend/qt_sdl/WifiSettingsDialog.cpp b/src/frontend/qt_sdl/WifiSettingsDialog.cpp
index 67297ad..24b339d 100644
--- a/src/frontend/qt_sdl/WifiSettingsDialog.cpp
+++ b/src/frontend/qt_sdl/WifiSettingsDialog.cpp
@@ -54,7 +54,7 @@ WifiSettingsDialog::WifiSettingsDialog(QWidget* parent) : QDialog(parent), ui(ne
LAN_Socket::Init();
haspcap = LAN_PCap::Init(false);
- ui->cbDirectMode->setText("Direct mode (requires " PCAP_NAME " and ethernet connection)");
+ ui->rbDirectMode->setText("Direct mode (requires " PCAP_NAME " and ethernet connection)");
ui->cbBindAnyAddr->setChecked(Config::SocketBindAnyAddr != 0);
ui->cbRandomizeMAC->setChecked(Config::RandomizeMAC != 0);
@@ -71,8 +71,9 @@ WifiSettingsDialog::WifiSettingsDialog(QWidget* parent) : QDialog(parent), ui(ne
}
ui->cbxDirectAdapter->setCurrentIndex(sel);
- ui->cbDirectMode->setChecked(Config::DirectLAN != 0);
- if (!haspcap) ui->cbDirectMode->setEnabled(false);
+ ui->rbDirectMode->setChecked(Config::DirectLAN != 0);
+ ui->rbIndirectMode->setChecked(Config::DirectLAN == 0);
+ if (!haspcap) ui->rbDirectMode->setEnabled(false);
updateAdapterControls();
}
@@ -101,7 +102,7 @@ void WifiSettingsDialog::done(int r)
Config::SocketBindAnyAddr = ui->cbBindAnyAddr->isChecked() ? 1:0;
Config::RandomizeMAC = randommac;
- Config::DirectLAN = ui->cbDirectMode->isChecked() ? 1:0;
+ Config::DirectLAN = ui->rbDirectMode->isChecked() ? 1:0;
int sel = ui->cbxDirectAdapter->currentIndex();
if (sel < 0 || sel >= LAN_PCap::NumAdapters) sel = 0;
@@ -125,11 +126,14 @@ void WifiSettingsDialog::done(int r)
closeDlg();
}
-void WifiSettingsDialog::on_cbDirectMode_stateChanged(int state)
+void WifiSettingsDialog::on_rbDirectMode_clicked()
+{
+ updateAdapterControls();
+}
+void WifiSettingsDialog::on_rbIndirectMode_clicked()
{
updateAdapterControls();
}
-
void WifiSettingsDialog::on_cbxDirectAdapter_currentIndexChanged(int sel)
{
if (!haspcap) return;
@@ -153,7 +157,7 @@ void WifiSettingsDialog::on_cbxDirectAdapter_currentIndexChanged(int sel)
void WifiSettingsDialog::updateAdapterControls()
{
- bool enable = haspcap && ui->cbDirectMode->isChecked();
+ bool enable = haspcap && ui->rbDirectMode->isChecked();
ui->cbxDirectAdapter->setEnabled(enable);
ui->lblAdapterMAC->setEnabled(enable);