Use red icon for PowerControl if RTSS is not available

This commit is contained in:
Kamil Trzciński 2022-11-15 21:09:53 +01:00
parent b442c6fadc
commit 4de31ed48c
4 changed files with 31 additions and 5 deletions

View file

@ -1,4 +1,4 @@
using CommonHelpers;
using CommonHelpers;
using CommonHelpers.FromLibreHardwareMonitor;
using Microsoft.VisualBasic.Logging;
using PowerControl.External;
@ -89,10 +89,7 @@ namespace PowerControl
};
var osdTimer = new System.Windows.Forms.Timer(components);
osdTimer.Tick += delegate (object? sender, EventArgs e)
{
updateOSD();
};
osdTimer.Tick += OsdTimer_Tick;
osdTimer.Interval = 250;
osdTimer.Enabled = true;
@ -129,6 +126,22 @@ namespace PowerControl
}
}
private void OsdTimer_Tick(object? sender, EventArgs e)
{
try
{
notifyIcon.Text = TitleWithVersion + ". RTSS Version: " + OSD.Version;
notifyIcon.Icon = Resources.poll;
}
catch
{
notifyIcon.Text = TitleWithVersion + ". RTSS Not Available.";
notifyIcon.Icon = Resources.poll_red;
}
updateOSD();
}
private void NeptuneDevice_OnInputReceived(object? sender, hidapi.HidDeviceInputReceivedEventArgs e)
{
var input = SDCInput.FromBuffer(e.Buffer);