mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Moved action block to prevent unnecessary actions on main window toggle https://github.com/seerge/g-helper/pull/1651
This commit is contained in:
@@ -119,7 +119,35 @@ namespace GHelper
|
|||||||
|
|
||||||
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\') || action.Length > 0)
|
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\') || action.Length > 0)
|
||||||
{
|
{
|
||||||
SettingsToggle(action, false);
|
SettingsToggle(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case "cpu":
|
||||||
|
Startup.ReScheduleAdmin();
|
||||||
|
settingsForm.FansToggle();
|
||||||
|
break;
|
||||||
|
case "gpu":
|
||||||
|
Startup.ReScheduleAdmin();
|
||||||
|
settingsForm.FansToggle(1);
|
||||||
|
break;
|
||||||
|
case "gpurestart":
|
||||||
|
gpuControl.RestartGPU(false);
|
||||||
|
break;
|
||||||
|
case "services":
|
||||||
|
settingsForm.extraForm = new Extra();
|
||||||
|
settingsForm.extraForm.Show();
|
||||||
|
settingsForm.extraForm.ServiesToggle();
|
||||||
|
break;
|
||||||
|
case "uv":
|
||||||
|
Startup.ReScheduleAdmin();
|
||||||
|
settingsForm.FansToggle(2);
|
||||||
|
modeControl.SetRyzen();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Startup.StartupCheck();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Application.Run();
|
Application.Run();
|
||||||
@@ -213,7 +241,7 @@ namespace GHelper
|
|||||||
SetAutoModes(true);
|
SetAutoModes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SettingsToggle(string action = "", bool checkForFocus = true, bool trayClick = false)
|
public static void SettingsToggle(bool checkForFocus = true, bool trayClick = false)
|
||||||
{
|
{
|
||||||
if (settingsForm.Visible)
|
if (settingsForm.Visible)
|
||||||
{
|
{
|
||||||
@@ -241,34 +269,6 @@ namespace GHelper
|
|||||||
settingsForm.Top = Screen.FromControl(settingsForm).WorkingArea.Height - 10 - settingsForm.Height;
|
settingsForm.Top = Screen.FromControl(settingsForm).WorkingArea.Height - 10 - settingsForm.Height;
|
||||||
|
|
||||||
settingsForm.VisualiseGPUMode();
|
settingsForm.VisualiseGPUMode();
|
||||||
|
|
||||||
switch (action)
|
|
||||||
{
|
|
||||||
case "cpu":
|
|
||||||
Startup.ReScheduleAdmin();
|
|
||||||
settingsForm.FansToggle();
|
|
||||||
break;
|
|
||||||
case "gpu":
|
|
||||||
Startup.ReScheduleAdmin();
|
|
||||||
settingsForm.FansToggle(1);
|
|
||||||
break;
|
|
||||||
case "gpurestart":
|
|
||||||
gpuControl.RestartGPU(false);
|
|
||||||
break;
|
|
||||||
case "services":
|
|
||||||
settingsForm.extraForm = new Extra();
|
|
||||||
settingsForm.extraForm.Show();
|
|
||||||
settingsForm.extraForm.ServiesToggle();
|
|
||||||
break;
|
|
||||||
case "uv":
|
|
||||||
Startup.ReScheduleAdmin();
|
|
||||||
settingsForm.FansToggle(2);
|
|
||||||
modeControl.SetRyzen();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Startup.StartupCheck();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ namespace GHelper.USB
|
|||||||
{
|
{
|
||||||
var device = AsusHid.FindDevices(AsusHid.AURA_ID).FirstOrDefault();
|
var device = AsusHid.FindDevices(AsusHid.AURA_ID).FirstOrDefault();
|
||||||
if (device is null) return;
|
if (device is null) return;
|
||||||
|
Logger.WriteLine($"GA402: {device.ReleaseNumberBcd} {device.ReleaseNumber}");
|
||||||
if (device.ReleaseNumberBcd == 22 || device.ReleaseNumberBcd == 23) isSingleColor = true;
|
if (device.ReleaseNumberBcd == 22 || device.ReleaseNumberBcd == 23) isSingleColor = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user