Improve startup
All checks were successful
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 48s

This commit is contained in:
2026-02-27 16:06:23 -05:00
parent f8aa7c9118
commit 5bb26c1c3f
4 changed files with 21 additions and 14 deletions

View File

@@ -67,13 +67,13 @@ public partial class HardwareSettingsPanel
EditSelectedSensor();
}
private void AddSensor()
private async void AddSensor()
{
var sensorEntry = new SensorEntry();
var sensorWindow = new SensorWindow();
var result = sensorWindow.Display(sensorEntry, Window.GetWindow(this));
var result = await sensorWindow.Display(sensorEntry, Window.GetWindow(this));
if (!result.HasValue || !result.Value)
return;
@@ -83,7 +83,7 @@ public partial class HardwareSettingsPanel
SetSensorButtonStates();
}
private void EditSelectedSensor()
private async void EditSelectedSensor()
{
if (SensorDataGrid.SelectedItem == null)
return;
@@ -92,7 +92,7 @@ public partial class HardwareSettingsPanel
var sensorWindow = new SensorWindow();
sensorWindow.Display(sensorEntry, Window.GetWindow(this));
await sensorWindow.Display(sensorEntry, Window.GetWindow(this));
}
private void DeleteSelectedSensors()

View File

@@ -2,6 +2,7 @@
using ChrisKaczor.Wpf.Validation;
using HardwareMonitorStatusWindow.Service;
using System.Linq;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Threading;
@@ -17,11 +18,11 @@ public partial class SensorWindow
InitializeComponent();
}
public bool? Display(SensorEntry sensorEntry, Window? owner)
public async Task<bool?> Display(SensorEntry sensorEntry, Window? owner)
{
DataContext = sensorEntry;
Data.RefreshComputer();
await Data.RefreshComputer();
HardwareTypeComboBox.ItemsSource = Data.ComputerHardware.Where(h => h.Sensors.Any()).DistinctBy(h => h.Type).Select(s => new HardwareTypeItem(s.Type)).OrderBy(s => s.Name);