Compare commits

...

7 Commits

Author SHA1 Message Date
Serge
58b5221b3c Version bump 2024-08-31 11:56:57 +02:00
Serge
0192d59524 UI Tweaks 2024-08-31 11:06:42 +02:00
Serge
01cede58b5 UI Tweaks 2024-08-31 10:42:43 +02:00
Serge
3dbbddfa58 Startup counter 2024-08-31 10:03:16 +02:00
Serge
1b898b44d2 Cleanup 2024-08-31 09:52:48 +02:00
Serge
dc7362dab1 Added AsusPTPService to the stop/start list https://github.com/seerge/g-helper/issues/3031 2024-08-30 19:45:47 +02:00
Serge
cbd4a5e27c Exception handling https://github.com/seerge/g-helper/issues/3029 2024-08-29 23:12:34 +02:00
6 changed files with 38 additions and 2 deletions

View File

@@ -16,7 +16,10 @@ namespace GHelper.Display
var modes = new DISPLAYCONFIG_MODE_INFO[modeCount]; var modes = new DISPLAYCONFIG_MODE_INFO[modeCount];
err = QueryDisplayConfig(QDC.QDC_ONLY_ACTIVE_PATHS, ref pathCount, paths, ref modeCount, modes, IntPtr.Zero); err = QueryDisplayConfig(QDC.QDC_ONLY_ACTIVE_PATHS, ref pathCount, paths, ref modeCount, modes, IntPtr.Zero);
if (err != 0) if (err != 0)
throw new Win32Exception(err); {
Logger.WriteLine("HDR Detection Error: " + new Win32Exception(err).Message);
return false;
}
string internalName = AppConfig.GetString("internal_display"); string internalName = AppConfig.GetString("internal_display");

View File

@@ -15,7 +15,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.186</AssemblyVersion> <AssemblyVersion>0.187</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -20,6 +20,8 @@ namespace GHelper.Helpers
"AsusCertService" "AsusCertService"
}; };
//"AsusPTPService",
static List<string> processesAC = new() { static List<string> processesAC = new() {
"ArmouryCrateSE.Service", "ArmouryCrateSE.Service",
"ArmouryCrate.Service", "ArmouryCrate.Service",

View File

@@ -69,6 +69,10 @@ namespace GHelper
Logger.WriteLine("------------"); Logger.WriteLine("------------");
Logger.WriteLine("App launched: " + AppConfig.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + CultureInfo.CurrentUICulture + (ProcessHelper.IsUserAdministrator() ? "." : "")); Logger.WriteLine("App launched: " + AppConfig.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + CultureInfo.CurrentUICulture + (ProcessHelper.IsUserAdministrator() ? "." : ""));
var startCount = AppConfig.Get("start_count") + 1;
AppConfig.Set("start_count", startCount);
Logger.WriteLine("Start Count: " + startCount);
acpi = new AsusACPI(); acpi = new AsusACPI();
if (!acpi.IsConnected() && AppConfig.IsASUS()) if (!acpi.IsConnected() && AppConfig.IsASUS())

View File

@@ -271,6 +271,12 @@ namespace GHelper
buttonDonate.Click += ButtonDonate_Click; buttonDonate.Click += ButtonDonate_Click;
if (AppConfig.Get("start_count") > 10 && !AppConfig.Is("donate_click"))
{
buttonDonate.BorderColor = colorTurbo;
buttonDonate.Badge = true;
}
labelDynamicLighting.Click += LabelDynamicLighting_Click; labelDynamicLighting.Click += LabelDynamicLighting_Click;
panelPerformance.Focus(); panelPerformance.Focus();
@@ -279,6 +285,8 @@ namespace GHelper
private void ButtonDonate_Click(object? sender, EventArgs e) private void ButtonDonate_Click(object? sender, EventArgs e)
{ {
AppConfig.Set("donate_click", 1);
buttonDonate.Badge = false;
Process.Start(new ProcessStartInfo("https://github.com/seerge/g-helper/wiki/Support-Project") { UseShellExecute = true }); Process.Start(new ProcessStartInfo("https://github.com/seerge/g-helper/wiki/Support-Project") { UseShellExecute = true });
} }

View File

@@ -52,6 +52,16 @@ namespace GHelper.UI
} }
} }
private bool badge = false;
public bool Badge
{
get { return badge; }
set
{
badge = value;
}
}
public RButton() public RButton()
{ {
DoubleBuffered = true; DoubleBuffered = true;
@@ -99,6 +109,15 @@ namespace GHelper.UI
pevent.Graphics.DrawPath(penBorder, pathBorder); pevent.Graphics.DrawPath(penBorder, pathBorder);
} }
if (badge)
{
using (Brush brush = new SolidBrush(borderColor))
{
var radius = ratio * 10;
pevent.Graphics.FillEllipse(brush, rectSurface.Width - rectSurface.Height / 2 - radius, rectSurface.Height / 2 - radius, radius + radius, radius + radius);
}
}
if (!Enabled && ForeColor != SystemColors.ControlText) if (!Enabled && ForeColor != SystemColors.ControlText)
{ {
var rect = pevent.ClipRectangle; var rect = pevent.ClipRectangle;