Fix bug list of wired interface show abnormal
This commit is contained in:
parent
63e25aa409
commit
8229c92ed0
|
@ -86,13 +86,14 @@ IFace* BackThread::execGetIface()
|
|||
iface->lname = iname;
|
||||
|
||||
if (istateStr == "unmanaged") {
|
||||
iface->lstate = 2; //switch of wired device is off
|
||||
}
|
||||
if (istateStr == "disconnected" || istateStr == "unavailable") {
|
||||
iface->lstate = 1; //wired network is disconnected
|
||||
}
|
||||
if (istateStr == "connected") {
|
||||
iface->lstate = 0; //wired network is connected
|
||||
iface->lstate = 3; //switch of wired device is off
|
||||
} else if (istateStr == "disconnected" || istateStr == "unavailable") {
|
||||
iface->lstate = 3; //wired network is disconnected
|
||||
} else if (istateStr == "connected") {
|
||||
iface->lstate = 3; //wired network is connected
|
||||
} else {
|
||||
//连接中,正在配置
|
||||
iface->lstate = 3;
|
||||
}
|
||||
}
|
||||
if (type == "wifi") {
|
||||
|
|
|
@ -1217,9 +1217,14 @@ void MainWindow::onBtnNetListClicked(int flag)
|
|||
return;
|
||||
}
|
||||
|
||||
if (iface->lstate != 2) {
|
||||
if (iface->lstate == 0 || iface->lstate == 1) {
|
||||
this->startLoading();
|
||||
this->ksnm->execGetLanList();
|
||||
} else if (iface->lstate == 3) {
|
||||
this->ksnm->isUseOldLanSlist = true;
|
||||
QStringList slistLan;
|
||||
slistLan.append("empty");
|
||||
getLanListDone(slistLan);
|
||||
} else {
|
||||
this->startLoading();
|
||||
this->ksnm->execGetLanList();
|
||||
|
@ -1259,13 +1264,8 @@ void MainWindow::on_btnWifiList_clicked()
|
|||
|
||||
ui->lbNetwork->setText(tr("Wifi"));
|
||||
btnWireless->show();
|
||||
if (iface->wstate == 0 || iface->wstate == 1) {
|
||||
btnWireless->setSwitchStatus(true);
|
||||
} else {
|
||||
btnWireless->setSwitchStatus(false);
|
||||
}
|
||||
|
||||
if (iface->wstate != 2) {
|
||||
if (iface->wstate == 0 || iface->wstate == 1) {
|
||||
btnWireless->setSwitchStatus(true);
|
||||
lbTopWifiList->show();
|
||||
btnAddNet->show();
|
||||
|
|
Loading…
Reference in New Issue