solve the problem btn_wifi keep close state after turn on the wifi

This commit is contained in:
chenlelin 2019-10-31 15:47:18 +08:00
parent 007d93e752
commit e1b12ba4c6
3 changed files with 34 additions and 3 deletions

BIN
kylin-nm

Binary file not shown.

View File

@ -981,7 +981,17 @@ void MainWindow::on_isLanConnect()
}
if (iface->wstate == 2) {
keepDisWifiState(); //无线网卡被拔出后
keepDisWifiState();
is_exec_func = 1;
} else {
//only execute once
if (is_exec_func == 1) {
ui->lbWifiImg->setStyleSheet("QLabel{background-image:url(:/res/x/wifi-line.png);}");
ui->lbBtnWifiBG->setStyleSheet(btnOnQss);
ui->lbBtnWifiT1->setText(tr("Enabled"));
on_btnWifiList_clicked();
is_exec_func = 0;
}
}
}
@ -1037,7 +1047,17 @@ void MainWindow::on_isNetOn()
}
if (iface->wstate == 2) {
keepDisWifiState(); //无线网卡被拔出后
keepDisWifiState();
is_exec_func = 1;
} else {
//only execute once
if (is_exec_func == 1) {
ui->lbWifiImg->setStyleSheet("QLabel{background-image:url(:/res/x/wifi-line.png);}");
ui->lbBtnWifiBG->setStyleSheet(btnOnQss);
ui->lbBtnWifiT1->setText(tr("Enabled"));
on_btnWifiList_clicked();
is_exec_func = 0;
}
}
}
@ -1097,7 +1117,17 @@ void MainWindow::on_isWifiConnect()
}
if (iface->wstate == 2) {
keepDisWifiState(); //无线网卡被拔出后
keepDisWifiState();
is_exec_func = 1;
} else {
//only execute once
if (is_exec_func == 1) {
ui->lbWifiImg->setStyleSheet("QLabel{background-image:url(:/res/x/wifi-line.png);}");
ui->lbBtnWifiBG->setStyleSheet(btnOnQss);
ui->lbBtnWifiT1->setText(tr("Enabled"));
on_btnWifiList_clicked();
is_exec_func = 0;
}
}
}

View File

@ -122,6 +122,7 @@ private:
int is_btnNetList_clicked = 1;
int is_btnWifiList_clicked = 0;
int is_NetLineReady = 1;
int is_exec_func = 1;
int currentIconIndex;
int updateFlag = 0;