From dd72c3c9f2b096f70ebcd7e12975ce04e7c4d539 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Tue, 26 Jul 2022 10:48:32 +0800 Subject: [PATCH 1/3] fix bug 125703 --- src/frontend/mainwindow.cpp | 16 ++++++++++++++++ src/frontend/mainwindow.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 73b95a21..87f19188 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -508,11 +508,27 @@ void MainWindow::showByWaylandHelper() } +void MainWindow::setCentralWidgetType(IconActiveType iconStatus) +{ + if (iconStatus == WLAN_CONNECTED) { + m_centralWidget->setCurrentIndex(WLAN_PAGE_INDEX); + } else if (iconStatus == ACTIVATING) { + if (m_wlanWidget->checkWlanStatus(NetworkManager::ActiveConnection::State::Activating)) { + m_centralWidget->setCurrentIndex(WLAN_PAGE_INDEX); + } else { + m_centralWidget->setCurrentIndex(LAN_PAGE_INDEX); + } + } else { + m_centralWidget->setCurrentIndex(LAN_PAGE_INDEX); + } +} + /** * @brief MainWindow::onTrayIconActivated 点击托盘图标的槽函数 */ void MainWindow::onTrayIconActivated(QSystemTrayIcon::ActivationReason reason) { + setCentralWidgetType(iconStatus); if (reason == QSystemTrayIcon::ActivationReason::Context) { m_trayIconMenu->popup(QCursor::pos()); } else { diff --git a/src/frontend/mainwindow.h b/src/frontend/mainwindow.h index df5c9e62..0a5fd198 100644 --- a/src/frontend/mainwindow.h +++ b/src/frontend/mainwindow.h @@ -155,6 +155,7 @@ private: void resetWindowTheme(); void showControlCenter(); void showByWaylandHelper(); + void setCentralWidgetType(IconActiveType iconStatus); double m_transparency=1.0; //透明度 QGSettings * m_transGsettings; //透明度配置文件 int currentIconIndex=0; From a1928f23436c70bba30febed54cc59ef16c753a7 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Wed, 27 Jul 2022 15:41:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?WiFi=E8=BF=9E=E6=8E=A5=E5=8F=97=E9=99=90?= =?UTF-8?q?=E6=97=B6=E6=89=98=E7=9B=98=E6=98=BE=E7=A4=BA=E6=97=A0=E7=BA=BF?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 87f19188..77025be3 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -510,7 +510,7 @@ void MainWindow::showByWaylandHelper() void MainWindow::setCentralWidgetType(IconActiveType iconStatus) { - if (iconStatus == WLAN_CONNECTED) { + if (iconStatus == WLAN_CONNECTED || WLAN_CONNECTED_LIMITED) { m_centralWidget->setCurrentIndex(WLAN_PAGE_INDEX); } else if (iconStatus == ACTIVATING) { if (m_wlanWidget->checkWlanStatus(NetworkManager::ActiveConnection::State::Activating)) { From 2efac2110e842230826dadc4e6276bfec93d7523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=9C=86=E5=9C=86?= Date: Thu, 28 Jul 2022 03:37:03 +0000 Subject: [PATCH 3/3] Update src/frontend/mainwindow.cpp --- src/frontend/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 77025be3..af521a47 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -510,7 +510,7 @@ void MainWindow::showByWaylandHelper() void MainWindow::setCentralWidgetType(IconActiveType iconStatus) { - if (iconStatus == WLAN_CONNECTED || WLAN_CONNECTED_LIMITED) { + if (iconStatus == WLAN_CONNECTED || iconStatus == WLAN_CONNECTED_LIMITED) { m_centralWidget->setCurrentIndex(WLAN_PAGE_INDEX); } else if (iconStatus == ACTIVATING) { if (m_wlanWidget->checkWlanStatus(NetworkManager::ActiveConnection::State::Activating)) {