From 8be29c36f2a680028258bb47dc42129ea49ed5cb Mon Sep 17 00:00:00 2001 From: kingthorin Date: Tue, 8 Oct 2024 17:15:27 -0400 Subject: [PATCH] hud: Add maintoolbar button stats - Add stats counter to main toolbar button action. - Add note to CHANGELOG. Signed-off-by: kingthorin --- CHANGELOG.md | 3 ++- src/main/java/org/zaproxy/zap/extension/hud/ExtensionHUD.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b9dc4d5..fc690c86d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] - +### Added +- Stats counter to the main toolbar button (Issue 8375). ## [0.19.0] - 2024-05-07 ### Changed diff --git a/src/main/java/org/zaproxy/zap/extension/hud/ExtensionHUD.java b/src/main/java/org/zaproxy/zap/extension/hud/ExtensionHUD.java index e11c448ee..ad9e7d21f 100644 --- a/src/main/java/org/zaproxy/zap/extension/hud/ExtensionHUD.java +++ b/src/main/java/org/zaproxy/zap/extension/hud/ExtensionHUD.java @@ -60,6 +60,7 @@ import org.zaproxy.zap.extension.websocket.ExtensionWebSocket; import org.zaproxy.zap.utils.DesktopUtils; import org.zaproxy.zap.utils.DisplayUtils; +import org.zaproxy.zap.utils.Stats; import org.zaproxy.zap.view.OverlayIcon; import org.zaproxy.zap.view.ZapMenuItem; import org.zaproxy.zap.view.ZapToggleButton; @@ -368,6 +369,7 @@ private ZapToggleButton getHudButton() { hudEnabledForDesktop = hudButton.isSelected(); getHudParam().setEnabledForDesktop(hudEnabledForDesktop); setZapCanGetFocus(!hudEnabledForDesktop); + Stats.incCounter("stats.ui.maintoolbar.button.hud"); }); } return hudButton;