Implemented storage update interval at the UI side (#1706)

* Minor refactoring for #1699

* Implemented storage update interval for the UI

* Revert "Implemented storage update interval for the UI"

This reverts commit 977ff2f5518d420e35cadad17054f4e69c260df1.

* Revert "Minor refactoring for #1699"

This reverts commit 923f6d6f636a2a10ff44b8c23f84e8985ccbf667.

* Made update interval configurable for storage devices

* Changed label text m to min for consistency

* Revised 8e6c669 as requested

* ATA Update interval defaults to 1s in the UI

* Simplified storage update interval menu
This commit is contained in:
Shinyeong Hyun
2025-05-02 20:07:43 +02:00
committed by GitHub
parent 56a7fc1206
commit bdafcd92b8
3 changed files with 50 additions and 2 deletions
+17
View File
@@ -15,6 +15,7 @@ using System.Windows.Forms;
using Aga.Controls.Tree;
using Aga.Controls.Tree.NodeControls;
using LibreHardwareMonitor.Hardware;
using LibreHardwareMonitor.Hardware.Storage;
using LibreHardwareMonitor.UI.Themes;
using LibreHardwareMonitor.Utilities;
using LibreHardwareMonitor.Wmi;
@@ -30,6 +31,7 @@ public sealed partial class MainForm : Form
private readonly Logger _logger;
private readonly UserRadioGroup _loggingInterval;
private readonly UserRadioGroup _updateInterval;
private readonly UserOption _throttleAtaUpdate;
private readonly UserOption _logSensors;
private readonly UserOption _minimizeOnClose;
private readonly UserOption _minimizeToTray;
@@ -374,6 +376,21 @@ public sealed partial class MainForm : Form
}
};
_throttleAtaUpdate = new UserOption("throttleAtaUpdateMenuItem", false, throttleAtaUpdateMenuItem, _settings);
_throttleAtaUpdate.Changed += (sender, e) =>
{
switch (_throttleAtaUpdate.Value)
{
case true:
AtaStorage.ThrottleInterval = TimeSpan.FromSeconds(30);
break;
case false:
AtaStorage.ThrottleInterval = TimeSpan.Zero;
break;
}
};
_sensorValuesTimeWindow = new UserRadioGroup("sensorValuesTimeWindow",
10,
new[]