fix(Wifi): Wifilist display incorrectly.
Description: 修复网卡配置中刷新网络列表导致wifi列表显示错误的问题 Log: 修复网卡配置中刷新网络列表导致wifi列表显示错误的问题 Bug: -
This commit is contained in:
parent
c014e7fe4d
commit
bafceffeb8
|
@ -96,12 +96,13 @@ IFace* BackThread::execGetIface()
|
|||
|
||||
if (istateStr == "unmanaged" || istateStr == "unavailable") {
|
||||
iface->wstate = 2; //switch of wireless device is off
|
||||
}
|
||||
if (istateStr == "disconnected") {
|
||||
} else if (istateStr == "disconnected") {
|
||||
iface->wstate = 1; //wireless network is disconnected
|
||||
}
|
||||
if (istateStr == "connected") {
|
||||
} else if (istateStr == "connected") {
|
||||
iface->wstate = 0; //wireless network is connected
|
||||
} else {
|
||||
//连接中,正在配置
|
||||
iface->wstate = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1101,7 +1101,6 @@ void MainWindow::onBtnWifiClicked(int flag)
|
|||
if (checkWlOn()) {
|
||||
if (flag != 4) { //以防第二张无线网卡插入时断网
|
||||
is_stop_check_net_state = 1;
|
||||
qDebug() << "aaa111";
|
||||
objKyDBus->setWifiSwitchState(false);
|
||||
lbTopWifiList->hide();
|
||||
btnAddNet->hide();
|
||||
|
@ -1287,6 +1286,29 @@ void MainWindow::on_btnWifiList_clicked()
|
|||
|
||||
this->startLoading();
|
||||
this->ksnm->execGetWifiList();
|
||||
} else if (iface->wstate == 3) { //连接中,正在配置wifi设备
|
||||
btnWireless->setSwitchStatus(true);
|
||||
lbTopWifiList->show();
|
||||
btnAddNet->show();
|
||||
|
||||
QList<OneConnForm*> topwifis = topWifiListWidget->findChildren<OneConnForm*>();
|
||||
foreach(OneConnForm* topwifi, topwifis)
|
||||
{
|
||||
delete topwifi;
|
||||
topwifi = NULL;
|
||||
}
|
||||
// 当前连接的wifi
|
||||
OneConnForm *ccf = new OneConnForm(topWifiListWidget, this, confForm, ksnm);
|
||||
ccf->setName(tr("Not connected"));//"当前未连接任何 Wifi"
|
||||
|
||||
ccf->setSignal("0", "--");
|
||||
ccf->setRate("0");
|
||||
ccf->setConnedString(1, tr("Disconnected"), "");//"未连接"
|
||||
ccf->isConnected = false;
|
||||
ccf->setTopItem(false);
|
||||
ccf->setAct(true);
|
||||
ccf->move(L_VERTICAL_LINE_TO_ITEM, 0);
|
||||
ccf->show();
|
||||
} else {
|
||||
btnWireless->setSwitchStatus(false);
|
||||
delete topWifiListWidget; //清空top列表
|
||||
|
|
|
@ -335,7 +335,8 @@ void WpaWifiDialog::slot_on_connectBtn_clicked() {
|
|||
appendWifiInfo(nameEditor->text(), eapCombox->currentData().toString(), innerCombox->currentData().toString(), userEditor->text(), askPwdBtn->isChecked());
|
||||
has_config = true;
|
||||
}
|
||||
QString cmdStr = "nmcli connection modify " + nameEditor->text() + " 802-1x.password " + pwdEditor->text();
|
||||
// QString cmdStr = "nmcli connection modify " + nameEditor->text() + " 802-1x.password " + pwdEditor->text();
|
||||
QString cmdStr = "nmcli connection modify " + nameEditor->text() + " ipv4.method auto";
|
||||
int res = Utils::m_system(cmdStr.toUtf8().data());
|
||||
if (res == 0) {
|
||||
//有网络配置文件,密码已修改,接下来修改用户名和其他配置,然后激活连接
|
||||
|
@ -410,7 +411,7 @@ void WpaWifiDialog::activateConnection() {
|
|||
Utils::m_system(cmdStr_2.toUtf8().data());
|
||||
syslog(LOG_DEBUG, "execute 'nmcli connection up' in function 'activateConnection' time out");
|
||||
qDebug() << "qDebug: activate time out!";
|
||||
qDebug() << "qDebug: 连接超时(12秒超时时间)";
|
||||
qDebug() << "qDebug: 连接超时(30秒超时时间)";
|
||||
});
|
||||
//设置超时时间
|
||||
timeout->start(30 * 1000);
|
||||
|
|
Loading…
Reference in New Issue