From 3bec5b156ed06ceeaedc79ef270b4913aa02861f Mon Sep 17 00:00:00 2001 From: Jokul Date: Sun, 9 Aug 2026 08:59:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95=20T?= =?UTF-8?q?CP=20Connections=20=E5=9B=BD=E9=99=85=E5=8C=96=20+=20=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=97=B4=E9=9A=94=E5=BD=B1=E5=93=8D=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=AE=9A=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补全 networkview context 中缺失的 TCP Connections 翻译; TrafficStatsWindow 和 TcpConnectionsWindow 的数据刷新 Timer 改为 跟随 applet.refreshInterval(5 倍降频),设置中改刷新间隔后所有定时同步生效 --- package/components/TcpConnectionsWindow.qml | 4 ++-- package/components/TrafficStatsWindow.qml | 6 +++--- translations/jnetapplet_zh_CN.ts | 5 +++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package/components/TcpConnectionsWindow.qml b/package/components/TcpConnectionsWindow.qml index 123fc95..07bf0d4 100644 --- a/package/components/TcpConnectionsWindow.qml +++ b/package/components/TcpConnectionsWindow.qml @@ -106,10 +106,10 @@ Window { } } - // 定时刷新:窗口可见时每 5 秒重建清单(与 C++ 后端降频周期一致), + // 定时刷新:窗口可见时按刷新间隔的 5 倍重建清单(与 C++ 后端降频周期一致), // 不依赖 C++ 信号;关闭时停止,兼顾实时性与性能 Timer { - interval: 5000 + interval: (root.applet ? root.applet.refreshInterval : 1000) * 5 repeat: true running: root.visible onTriggered: refreshModel() diff --git a/package/components/TrafficStatsWindow.qml b/package/components/TrafficStatsWindow.qml index c486928..dd0953d 100644 --- a/package/components/TrafficStatsWindow.qml +++ b/package/components/TrafficStatsWindow.qml @@ -116,11 +116,11 @@ Window { onCurrentTabChanged: buildStatsModel() Component.onCompleted: buildStatsModel() - // 定时刷新:窗口可见时每 5 秒重建表格,不依赖 C++ 30 秒信号 + // 定时刷新:窗口可见时按刷新间隔的 5 倍重建表格,不依赖 C++ 30 秒信号 // 设计原因:C++ 降频 30 秒通知,用户打开窗口期间看不到实时更新; - // 窗口可见时主动 5 秒刷新,关闭时停止,兼顾实时性与性能 + // 窗口可见时主动刷新,间隔跟随设置中的刷新间隔(5 倍降频),关闭时停止 Timer { - interval: 5000 + interval: (root.applet ? root.applet.refreshInterval : 1000) * 5 repeat: true running: root.visible onTriggered: buildStatsModel() diff --git a/translations/jnetapplet_zh_CN.ts b/translations/jnetapplet_zh_CN.ts index 8ca6198..72fac07 100644 --- a/translations/jnetapplet_zh_CN.ts +++ b/translations/jnetapplet_zh_CN.ts @@ -275,6 +275,11 @@ Traffic Statistics 流量统计 + + + TCP Connections + TCP 连接 + TrafficStatsWindow