Merge branch 'kylin-ap-fix' into 'dbus-interface'

修改无线ap的问题

See merge request kylin-desktop/kylin-nm!345
This commit is contained in:
ren peijia 2021-10-22 05:45:58 +00:00
commit 7802e33cae
2 changed files with 27 additions and 23 deletions

View File

@ -353,7 +353,7 @@ void WlanListItem::onNetButtonClicked()
}
//有配置或者无密码的wifi直接连接
if (m_wirelessNetItem.m_isConfigured || m_hasPwd == false) {
if (m_wirelessNetItem.m_isConfigured) {
m_wirelessConnectOperation->activeWirelessConnect(m_wlanDevice, m_wirelessNetItem.m_connectUuid);
qDebug()<<"[WlanListItem] Has configuration, will be activated. ssid = "
<< m_wirelessNetItem.m_NetSsid << Q_FUNC_INFO << __LINE__;
@ -436,16 +436,17 @@ void WlanListItem::onShowPwdButtonClicked()
void WlanListItem::onConnectButtonClicked()
{
qDebug()<< LOG_FLAG << "onConnectButtonClicked";
if (!m_connectButton->isEnabled()) {
return;
}
if ((Activating == m_connectState || Deactivating == m_connectState)) {
qDebug() << LOG_FLAG << "On wlan clicked! But there is nothing to do because it is already activating/deactivating!"
<< Q_FUNC_INFO << __LINE__;
return;
}
if (m_connectButton->isVisible() && !m_connectButton->isEnabled()) {
qWarning() << "Connect wlan failed because of null pointer or button state!" << Q_FUNC_INFO << __LINE__;
return;
}
KyWirelessConnectSetting settings;
settings.m_connectName = m_wirelessNetItem.m_NetSsid;
settings.m_ssid = m_wirelessNetItem.m_NetSsid;

View File

@ -756,14 +756,7 @@ void WlanPage::wlanShowNotify(QString ssid, NetworkManager::ActiveConnection::St
void WlanPage::updateActivatedArea(QString uuid, QString ssid, QString devName)
{
KyWirelessNetItem wirelessNetItem;
bool ret = m_wirelessNetResource->getWifiNetwork(devName, ssid, wirelessNetItem);
if (!ret) {
qWarning()<<"[WlanPage] get wireless item failed, when update activated connection area.";
return;
}
if (m_activateConnectionItemMap.contains(wirelessNetItem.m_NetSsid)) {
if (m_activateConnectionItemMap.contains(ssid)) {
return;
}
@ -776,6 +769,13 @@ void WlanPage::updateActivatedArea(QString uuid, QString ssid, QString devName)
m_inactivatedNetListWidget->height()
+ m_hiddenWlanLabel->height());
KyWirelessNetItem wirelessNetItem;
bool ret = m_wirelessNetResource->getWifiNetwork(devName, ssid, wirelessNetItem);
if (!ret) {
qWarning()<<"[WlanPage] get wireless item failed, when update activated connection area.";
return;
}
deleteWirelessItemFormMap(m_activateConnectionItemMap, m_activatedNetListWidget, EMPTY_SSID);
QListWidgetItem *p_listWidgetItem = addNewItem(wirelessNetItem, m_activatedNetListWidget);
m_activateConnectionItemMap.insert(wirelessNetItem.m_NetSsid, p_listWidgetItem);
@ -787,14 +787,7 @@ void WlanPage::updateActivatedArea(QString uuid, QString ssid, QString devName)
void WlanPage::updateWirelessNetArea(QString uuid, QString ssid, QString devName)
{
KyWirelessNetItem wirelessNetItem;
bool ret = m_wirelessNetResource->getWifiNetwork(devName, ssid, wirelessNetItem);
if (!ret) {
qWarning()<<"[WlanPage] get wireless item failed, when update wireless area.";
return;
}
if(m_wirelessNetItemMap.contains(wirelessNetItem.m_NetSsid)) {
if(m_wirelessNetItemMap.contains(ssid)) {
return;
}
@ -803,6 +796,13 @@ void WlanPage::updateWirelessNetArea(QString uuid, QString ssid, QString devName
m_activateConnectionItemMap.insert(EMPTY_SSID, p_activeListWidgetItem);
m_activatedNetListWidget->setFixedHeight(p_activeListWidgetItem->sizeHint().height());
KyWirelessNetItem wirelessNetItem;
bool ret = m_wirelessNetResource->getWifiNetwork(devName, ssid, wirelessNetItem);
if (!ret) {
qWarning()<<"[WlanPage] get wireless item failed, when update wireless area.";
return;
}
QListWidgetItem *p_listWidgetItem = addNewItem(wirelessNetItem, m_inactivatedNetListWidget);
m_wirelessNetItemMap.insert(wirelessNetItem.m_NetSsid, p_listWidgetItem);
@ -836,8 +836,11 @@ void WlanPage::onConnectionStateChanged(QString uuid,
return;
}
sendApStateChangeSignal(uuid, ssid, devName, state);
wlanShowNotify(ssid, state, reason);
if (m_connectResource->isApConnection(uuid)) {
sendApStateChangeSignal(uuid, ssid, devName, state);
} else {
wlanShowNotify(ssid, state, reason);
}
if (devName != m_currentDevice) {
return;