kiran-control-panel/0012-fix-network-tray-Improved-the-notification-logic.-Wi.patch
luoqing 16a19254ad fix(network):Modify DNS Settings and display DNS details;Improved the notification logic.
- 自动获取IP(DNS)后,网络详情显示自动获取到的DNS
  手动配置DNS,网络详情中DNS服务器仅显示手动配置的DNS
  完善通知弹窗逻辑,从休眠中恢复过程中不再提示“有线网卡:xxx不可用”和“网络不可用”。

Closes #14000;#15619
2023-09-18 12:08:20 +08:00

49 lines
1.9 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 5628b4b31eeb7493abe41bb9a6935955f0ca090a Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Fri, 15 Sep 2023 16:19:15 +0800
Subject: [PATCH] fix(network-tray):Improved the notification logic. "Wired
NIC: xxx is unavailable" and "Network is Unavailable" are no longer displayed
during sleep recovery.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 完善通知弹窗逻辑从休眠中恢复过程中不再提示“有线网卡xxx不可用”和“网络不可用”。
Close #15619
---
plugins/network/src/tray/network-tray.cpp | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp
index 7397e28..dd5ff12 100644
--- a/plugins/network/src/tray/network-tray.cpp
+++ b/plugins/network/src/tray/network-tray.cpp
@@ -473,9 +473,21 @@ void NetworkTray::handleDeviceStateChanged(NetworkManager::Device::State newstat
}
}
- // 设备变为不可用时,如果无线和有线均不可用则显示网络不可用的提示
- if (newstate == Device::Unavailable || newstate == Device::Unmanaged || newstate == Device::UnknownState)
+ QSet<Device::State> unavailableStates = {
+ Device::Unavailable,
+ Device::Unmanaged,
+ Device::UnknownState
+ };
+
+ // 非休眠的情况下,从可用状态到不可用状态通知
+ if (!unavailableStates.contains(oldstate)
+ &&
+ unavailableStates.contains(newstate)
+ &&
+ reason != Device::SleepingReason
+ )
{
+ // 设备变为不可用时,如果无线和有线均不可用则显示网络不可用的提示
KLOG_DEBUG() << "device is unavailable";
if ((NetworkUtils::getAvailableDeviceList(Device::Ethernet).count() == 0) &&
(NetworkUtils::getAvailableDeviceList(Device::Wifi).count() == 0))
--
2.33.0