diff --git a/src/frontend/tab-pages/lanpage.cpp b/src/frontend/tab-pages/lanpage.cpp index 3faf0681..c2dc8e74 100644 --- a/src/frontend/tab-pages/lanpage.cpp +++ b/src/frontend/tab-pages/lanpage.cpp @@ -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 == "") { diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index 20ec1cad..c5cb15cf 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -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 {