diff --git a/src/backend/dbus-interface/kylinactiveconnectresource.cpp b/src/backend/dbus-interface/kylinactiveconnectresource.cpp index d13caa5d..05526949 100644 --- a/src/backend/dbus-interface/kylinactiveconnectresource.cpp +++ b/src/backend/dbus-interface/kylinactiveconnectresource.cpp @@ -665,7 +665,7 @@ bool KyActiveConnectResourse::wiredConnectIsActived() return false; } -bool KyActiveConnectResourse::wirelessConnectIsActived() +bool KyActiveConnectResourse::checkWirelessStatus(NetworkManager::ActiveConnection::State state) { int index = 0; NetworkManager::ActiveConnection::List activeConnectList; @@ -691,7 +691,7 @@ bool KyActiveConnectResourse::wirelessConnectIsActived() continue; } - if (activeConnectPtr->state() == NetworkManager::ActiveConnection::State::Activated) { + if (activeConnectPtr->state() == state) { return true; } } diff --git a/src/backend/dbus-interface/kylinactiveconnectresource.h b/src/backend/dbus-interface/kylinactiveconnectresource.h index 3bd28cf5..db781917 100644 --- a/src/backend/dbus-interface/kylinactiveconnectresource.h +++ b/src/backend/dbus-interface/kylinactiveconnectresource.h @@ -39,7 +39,7 @@ public: bool connectionIsVirtual(QString uuid); bool wiredConnectIsActived(); - bool wirelessConnectIsActived(); + bool checkWirelessStatus(NetworkManager::ActiveConnection::State state); private: void getActiveConnectIp(NetworkManager::ActiveConnection::Ptr activeConnectPtr, diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 66bfad43..f100ab2a 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -461,7 +461,7 @@ void MainWindow::onRefreshTrayIcon() NetworkManager::Connectivity connecttivity; m_wlanWidget->getConnectivity(connecttivity); - if (connecttivity == NetworkManager::Connectivity::Portal || connecttivity == NetworkManager::Connectivity::Limited) { + if (connecttivity != NetworkManager::Connectivity::Full) { if (iconStatus == IconActiveType::LAN_CONNECTED) { m_trayIcon->setIcon(QIcon::fromTheme("network-error-symbolic")); iconStatus = IconActiveType::LAN_CONNECTED_LIMITED; @@ -504,6 +504,9 @@ void MainWindow::onWlanConnectStatusToChangeTrayIcon(int state) m_wlanIsLoading = true; iconTimer->start(LOADING_TRAYICON_TIMER_MS); } else { + if (m_wlanWidget->wlanIsConnecting()) { + return; + } m_wlanIsLoading = false; if (m_lanIsLoading == false) { onRefreshTrayIcon(); diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index 0ebe0840..f635149a 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -1380,7 +1380,16 @@ void WlanPage::showDetailPage(QString devName, QString ssid) bool WlanPage::wlanIsConnected() { - if (m_activatedConnectResource->wirelessConnectIsActived()) { + if (m_activatedConnectResource->checkWirelessStatus(NetworkManager::ActiveConnection::State::Activated)) { + return true; + } else { + return false; + } +} + +bool WlanPage::wlanIsConnecting() +{ + if (m_activatedConnectResource->checkWirelessStatus(NetworkManager::ActiveConnection::State::Activating)) { return true; } else { return false; diff --git a/src/frontend/tab-pages/wlanpage.h b/src/frontend/tab-pages/wlanpage.h index f4880df1..0cc25035 100644 --- a/src/frontend/tab-pages/wlanpage.h +++ b/src/frontend/tab-pages/wlanpage.h @@ -43,6 +43,7 @@ public: void showDetailPage(QString devName, QString uuid); bool wlanIsConnected(); + bool wlanIsConnecting(); void getApInfoBySsid(QString devName, QString ssid, QStringList &list); //无线总开关