Merge branch '2309bug1' into 'yhkylin/v101'

fix bug 180228 【网络连接】删除有线网络,点击未连接网络后一直处于选中状态

See merge request kylinos-src/kylin-nm!208
This commit is contained in:
赵世旭 2023-07-10 08:40:02 +00:00
commit 9b1a6ed684
2 changed files with 10 additions and 0 deletions

View File

@ -352,9 +352,11 @@ void LanPage::constructActiveConnectionArea()
p_activeConnectionItem = nullptr;
}
setNetSpeed->start(REFRESH_NETWORKSPEED_TIMER);
m_activatedLanListWidget->setSelectionMode(QAbstractItemView::SelectionMode::SingleSelection);
} else {
qDebug()<<"[LanPage] there is not active";
addEmptyConnectItem(m_activeConnectionMap, m_activatedLanListWidget);
m_activatedLanListWidget->setSelectionMode(QAbstractItemView::SelectionMode::NoSelection);
}
return;
@ -835,6 +837,8 @@ QListWidgetItem *LanPage::addNewItem(KyConnectItem *itemData, QListWidget *listW
void LanPage::updateActivatedConnectionArea(KyConnectItem *p_newItem)
{
m_activatedLanListWidget->setSelectionMode(QAbstractItemView::SelectionMode::SingleSelection);
if (m_activeConnectionMap.contains(p_newItem->m_connectUuid)) {
return;
}
@ -863,6 +867,7 @@ void LanPage::updateConnectionArea(KyConnectItem *p_newItem)
deleteConnectionMapItem(m_activeConnectionMap, m_activatedLanListWidget, p_newItem->m_connectUuid);
if (m_activeConnectionMap.count() <= 0) {
addEmptyConnectItem(m_activeConnectionMap, m_activatedLanListWidget);
m_activatedLanListWidget->setSelectionMode(QAbstractItemView::SelectionMode::NoSelection);
}
if (p_newItem->m_ifaceName == m_currentDeviceName || p_newItem->m_ifaceName == "") {

View File

@ -481,12 +481,14 @@ void WlanPage::constructActivateConnectionArea()
height += p_listWidgetItem->sizeHint().height();
setNetSpeed->start(REFRESH_NETWORKSPEED_TIMER);
m_activatedNetListWidget->setSelectionMode(QAbstractItemView::SelectionMode::SingleSelection);
}
}
if (height == 0) {
QListWidgetItem *p_listWidgetItem = addEmptyItem(m_activatedNetListWidget);
m_activateConnectionItemMap.insert(EMPTY_SSID, p_listWidgetItem);
m_activatedNetListWidget->setSelectionMode(QAbstractItemView::SelectionMode::NoSelection);
height += p_listWidgetItem->sizeHint().height();
}
@ -933,6 +935,8 @@ void WlanPage::wlanShowNotify(QString ssid, NetworkManager::ActiveConnection::St
void WlanPage::updateActivatedArea(QString uuid, QString ssid, QString devName)
{
m_activatedNetListWidget->setSelectionMode(QAbstractItemView::SelectionMode::SingleSelection);
if (m_activateConnectionItemMap.contains(ssid)) {
return;
}
@ -987,6 +991,7 @@ void WlanPage::updateWirelessNetArea(QString uuid, QString ssid, QString devName
deleteWirelessItemFormMap(m_activateConnectionItemMap, m_activatedNetListWidget, ssid);
QListWidgetItem *p_activeListWidgetItem = addEmptyItem(m_activatedNetListWidget);
m_activateConnectionItemMap.insert(EMPTY_SSID, p_activeListWidgetItem);
m_activatedNetListWidget->setSelectionMode(QAbstractItemView::SelectionMode::NoSelection);
m_activatedNetListWidget->setFixedHeight(p_activeListWidgetItem->sizeHint().height());
}
} else {