|
|
|
@ -117,13 +117,13 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid |
|
|
|
|
main_layout->addWidget(back, 0, Qt::AlignLeft); |
|
|
|
|
|
|
|
|
|
// Enable tethering layout
|
|
|
|
|
ToggleControl *tetheringToggle = new ToggleControl("Enable Tethering", "", "", wifi->tetheringEnabled()); |
|
|
|
|
ToggleControl *tetheringToggle = new ToggleControl("Enable Tethering", "", "", wifi->isTetheringEnabled()); |
|
|
|
|
main_layout->addWidget(tetheringToggle); |
|
|
|
|
QObject::connect(tetheringToggle, &ToggleControl::toggleFlipped, this, &AdvancedNetworking::toggleTethering); |
|
|
|
|
main_layout->addWidget(horizontal_line(), 0); |
|
|
|
|
|
|
|
|
|
// Change tethering password
|
|
|
|
|
editPasswordButton = new ButtonControl("Tethering Password", "EDIT"); |
|
|
|
|
ButtonControl *editPasswordButton = new ButtonControl("Tethering Password", "EDIT"); |
|
|
|
|
connect(editPasswordButton, &ButtonControl::released, [=]() { |
|
|
|
|
QString pass = InputDialog::getText("Enter new tethering password", 8, wifi->getTetheringPassword()); |
|
|
|
|
if (!pass.isEmpty()) { |
|
|
|
@ -151,13 +151,8 @@ void AdvancedNetworking::refresh() { |
|
|
|
|
update(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AdvancedNetworking::toggleTethering(bool enable) { |
|
|
|
|
if (enable) { |
|
|
|
|
wifi->enableTethering(); |
|
|
|
|
} else { |
|
|
|
|
wifi->disableTethering(); |
|
|
|
|
} |
|
|
|
|
editPasswordButton->setEnabled(!enable); |
|
|
|
|
void AdvancedNetworking::toggleTethering(bool enabled) { |
|
|
|
|
wifi->setTetheringEnabled(enabled); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// WifiUI functions
|
|
|
|
@ -183,7 +178,7 @@ void WifiUI::refresh() { |
|
|
|
|
ssid_label->setStyleSheet("font-size: 55px;"); |
|
|
|
|
hlayout->addWidget(ssid_label, 1, Qt::AlignLeft); |
|
|
|
|
|
|
|
|
|
if (wifi->isKnownConnection(network.ssid) && !wifi->tetheringEnabled()) { |
|
|
|
|
if (wifi->isKnownConnection(network.ssid) && !wifi->isTetheringEnabled()) { |
|
|
|
|
QPushButton *forgetBtn = new QPushButton(); |
|
|
|
|
QPixmap pix("../assets/offroad/icon_close.svg"); |
|
|
|
|
|
|
|
|
|