aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl/WifiSettingsDialog.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2020-12-04 18:28:15 +0100
committerArisotura <thetotalworm@gmail.com>2020-12-04 18:28:15 +0100
commit129018a6626cbec915ef73484c51c9d07af8e8b9 (patch)
tree8e5712bd241319731f7b6ade3363cefe845e3a5e /src/frontend/qt_sdl/WifiSettingsDialog.cpp
parent6aad429383015a0ac135b081931ae9c5876a7ad0 (diff)
parent42e083960e52cce31589714dcc7fab8e173efb81 (diff)
Merge remote-tracking branch 'remotes/origin/master' into dsi_camera
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);