mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 23:57:22 -08:00
Wi-Fi connect dialog: Remove Wi-Fi modules if 'Cancel' button clicked
This commit is contained in:
parent
e4a21f5c85
commit
dc93feed17
2 changed files with 11 additions and 0 deletions
|
@ -911,20 +911,24 @@ void MainWindow::updateWifiIcon(int mode) {
|
|||
* mode 3: connected
|
||||
*/
|
||||
if(mode == 0) {
|
||||
lastWifiState = 0;
|
||||
QTimer *wifiIconTimer = new QTimer(this);
|
||||
wifiIconTimer->setInterval(10000);
|
||||
connect(wifiIconTimer, SIGNAL(timeout()), this, SLOT(setWifiIcon()));
|
||||
wifiIconTimer->start();
|
||||
}
|
||||
if(mode == 1) {
|
||||
lastWifiState = 1;
|
||||
ui->wifiBtn->setIcon(QIcon(":/resources/wifi-off.png"));
|
||||
ui->wifiBtn->setIconSize(QSize(wifiIconWidth, wifiIconHeight));
|
||||
}
|
||||
if(mode == 2) {
|
||||
lastWifiState = 2;
|
||||
ui->wifiBtn->setIcon(QIcon(":/resources/wifi-standby.png"));
|
||||
ui->wifiBtn->setIconSize(QSize(wifiIconWidth, wifiIconHeight));
|
||||
}
|
||||
if(mode == 3) {
|
||||
lastWifiState = 3;
|
||||
ui->wifiBtn->setIcon(QIcon(":/resources/wifi-connected.png"));
|
||||
ui->wifiBtn->setIconSize(QSize(wifiIconWidth, wifiIconHeight));
|
||||
}
|
||||
|
|
|
@ -89,6 +89,13 @@ void wifiDialog::centerDialog() {
|
|||
|
||||
void wifiDialog::on_cancelBtn_clicked()
|
||||
{
|
||||
string_writeconfig("/opt/ibxd", "toggle_wifi_off\n");
|
||||
while(true) {
|
||||
if(QFile::exists("/run/toggle_wifi_off_done")) {
|
||||
QFile::remove("/run/toggle_wifi_off_done");
|
||||
break;
|
||||
}
|
||||
}
|
||||
emit quit(0);
|
||||
wifiDialog::close();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue