diff --git a/app/Aura.cs b/app/Aura.cs index e0718982..bc7acc24 100644 --- a/app/Aura.cs +++ b/app/Aura.cs @@ -15,14 +15,18 @@ namespace GHelper SleepKeyb = 1 << 5, ShutdownLogo = 1 << 6, ShutdownKeyb = 1 << 7, - BootBar = 1 << (7 + 2), - AwakeBar = 1 << (7 + 3), - SleepBar = 1 << (7 + 4), - ShutdownBar = 1 << (7 + 5), - BootLid = 1 << (15 + 1), - AwakeLid = 1 << (15 + 2), - SleepLid = 1 << (15 + 3), - ShutdownLid = 1 << (15 + 4) + Unknown1 = 1 << 8, + BootBar = 1u << (7 + 2), + AwakeBar = 1u << (7 + 3), + SleepBar = 1u << (7 + 4), + ShutdownBar = 1u << (7 + 5), + Unknown2 = 1 << 13, + Unknown3 = 1 << 14, + Unknown4 = 1 << 15, + BootLid = 1u << (15 + 1), + AwakeLid = 1u << (15 + 2), + SleepLid = 1u << (15 + 3), + ShutdownLid = 1u << (15 + 4) } public static class AuraDev19b6Extensions diff --git a/app/Extra.Designer.cs b/app/Extra.Designer.cs index 5e1cb3b1..e4859d78 100644 --- a/app/Extra.Designer.cs +++ b/app/Extra.Designer.cs @@ -218,26 +218,32 @@ namespace GHelper tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); - tableBacklight.Controls.Add(checkBootLid, 2, 2); - tableBacklight.Controls.Add(checkShutdown, 0, 4); + + tableBacklight.Controls.Add(labelBacklight, 0, 0); tableBacklight.Controls.Add(checkAwake, 0, 1); tableBacklight.Controls.Add(checkBoot, 0, 2); tableBacklight.Controls.Add(checkSleep, 0, 3); - tableBacklight.Controls.Add(labelBacklight, 0, 0); - tableBacklight.Controls.Add(checkSleepBar, 1, 3); - tableBacklight.Controls.Add(checkShutdownBar, 1, 4); - tableBacklight.Controls.Add(labelBacklightBar, 1, 0); - tableBacklight.Controls.Add(checkAwakeBar, 1, 1); - tableBacklight.Controls.Add(checkBootBar, 1, 2); - tableBacklight.Controls.Add(checkSleepLid, 2, 3); - tableBacklight.Controls.Add(checkShutdownLid, 2, 4); - tableBacklight.Controls.Add(labelBacklightLid, 2, 0); - tableBacklight.Controls.Add(checkAwakeLid, 2, 1); - tableBacklight.Controls.Add(labelBacklightLogo, 3, 0); - tableBacklight.Controls.Add(checkAwakeLogo, 3, 1); - tableBacklight.Controls.Add(checkBootLogo, 3, 2); - tableBacklight.Controls.Add(checkSleepLogo, 3, 3); - tableBacklight.Controls.Add(checkShutdownLogo, 3, 4); + tableBacklight.Controls.Add(checkShutdown, 0, 4); + + tableBacklight.Controls.Add(labelBacklightLogo, 1, 0); + tableBacklight.Controls.Add(checkAwakeLogo, 1, 1); + tableBacklight.Controls.Add(checkBootLogo, 1, 2); + tableBacklight.Controls.Add(checkSleepLogo, 1, 3); + tableBacklight.Controls.Add(checkShutdownLogo, 1, 4); + + tableBacklight.Controls.Add(labelBacklightBar, 2, 0); + tableBacklight.Controls.Add(checkAwakeBar, 2, 1); + tableBacklight.Controls.Add(checkBootBar, 2, 2); + tableBacklight.Controls.Add(checkSleepBar, 2, 3); + tableBacklight.Controls.Add(checkShutdownBar, 2, 4); + + tableBacklight.Controls.Add(labelBacklightLid, 3, 0); + tableBacklight.Controls.Add(checkAwakeLid, 3, 1); + tableBacklight.Controls.Add(checkBootLid, 3, 2); + tableBacklight.Controls.Add(checkSleepLid, 3, 3); + tableBacklight.Controls.Add(checkShutdownLid, 3, 4); + + tableBacklight.Dock = DockStyle.Top; tableBacklight.Location = new Point(3, 35); tableBacklight.Margin = new Padding(0); diff --git a/app/Extra.cs b/app/Extra.cs index 62a8fcfc..fac5286a 100644 --- a/app/Extra.cs +++ b/app/Extra.cs @@ -58,7 +58,7 @@ namespace GHelper InitializeComponent(); groupBindings.Text = Properties.Strings.KeyBindings; - groupLight.Text = " " + Properties.Strings.KeyboardBacklight; + groupLight.Text = " " + Properties.Strings.LaptopBacklight; groupOther.Text = Properties.Strings.Other; checkAwake.Text = Properties.Strings.Awake; @@ -74,6 +74,11 @@ namespace GHelper checkTopmost.Text = Properties.Strings.WindowTop; checkUSBC.Text = Properties.Strings.OptimizedUSBC; + labelBacklight.Text = Properties.Strings.Keyboard; + labelBacklightBar.Text = Properties.Strings.Lightbar; + labelBacklightLid.Text = Properties.Strings.Lid; + labelBacklightLogo.Text = Properties.Strings.Logo; + Text = Properties.Strings.ExtraSettings; InitTheme(); @@ -135,7 +140,6 @@ namespace GHelper checkSleepLogo.CheckedChanged += CheckPower_CheckedChanged; checkShutdownLogo.CheckedChanged += CheckPower_CheckedChanged; - /* if (!Program.config.ContainsModel("Strix")) { labelBacklightBar.Visible = false; @@ -143,8 +147,23 @@ namespace GHelper checkBootBar.Visible = false; checkSleepBar.Visible = false; checkShutdownBar.Visible = false; + + labelBacklightLid.Visible = false; + checkAwakeLid.Visible = false; + checkBootLid.Visible = false; + checkSleepLid.Visible = false; + checkShutdownLid.Visible = false; + + if (!Program.config.ContainsModel("Z13")) + { + labelBacklightLogo.Visible = false; + checkAwakeLogo.Visible = false; + checkBootLogo.Visible = false; + checkSleepLogo.Visible = false; + checkShutdownLogo.Visible = false; + } + } - */ checkTopmost.Checked = (Program.config.getConfig("topmost") == 1); checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ; @@ -243,6 +262,11 @@ namespace GHelper if (checkSleepLogo.Checked) flags.Add(AuraDev19b6.SleepLogo); if (checkShutdownLogo.Checked) flags.Add(AuraDev19b6.ShutdownLogo); + flags.Add(AuraDev19b6.Unknown1); + flags.Add(AuraDev19b6.Unknown2); + flags.Add(AuraDev19b6.Unknown3); + flags.Add(AuraDev19b6.Unknown4); + Aura.ApplyAuraPower(flags); } diff --git a/app/Gpu/NvidiaGpuControl.cs b/app/Gpu/NvidiaGpuControl.cs index bbb5ce00..8c859aa7 100644 --- a/app/Gpu/NvidiaGpuControl.cs +++ b/app/Gpu/NvidiaGpuControl.cs @@ -21,32 +21,7 @@ public class NvidiaGpuControl : IGpuControl public NvidiaGpuControl() { - Create(); - } - - - public static void Create() - { - try - { - _internalGpu = GetInternalDiscreteGpu(); - } - catch (Exception ex) - { - Debug.WriteLine(ex); - _internalGpu = null; - } - } - - - public static void RecreateWithDelay(int delay = 5) - { - Task.Run(async () => - { - await Task.Delay(TimeSpan.FromSeconds(delay)); - Create(); - }); - + _internalGpu = GetInternalDiscreteGpu(); } public bool IsValid => _internalGpu != null; @@ -144,7 +119,7 @@ public class NvidiaGpuControl : IGpuControl } catch (Exception ex) { - Logger.WriteLine(ex.ToString()); + Logger.WriteLine(ex.Message); return null; } } diff --git a/app/Properties/Strings.Designer.cs b/app/Properties/Strings.Designer.cs index bfdd6190..b890a276 100644 --- a/app/Properties/Strings.Designer.cs +++ b/app/Properties/Strings.Designer.cs @@ -558,9 +558,9 @@ namespace GHelper.Properties { /// /// Looks up a localized string similar to Laptop Backlight. /// - internal static string KeyboardBacklight { + internal static string LaptopBacklight { get { - return ResourceManager.GetString("KeyboardBacklight", resourceCulture); + return ResourceManager.GetString("LaptopBacklight", resourceCulture); } } @@ -582,6 +582,33 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized string similar to Lid. + /// + internal static string Lid { + get { + return ResourceManager.GetString("Lid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lightbar. + /// + internal static string Lightbar { + get { + return ResourceManager.GetString("Lightbar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Logo. + /// + internal static string Logo { + get { + return ResourceManager.GetString("Logo", resourceCulture); + } + } + /// /// Looks up a localized string similar to Binary Banner. /// diff --git a/app/Properties/Strings.es.resx b/app/Properties/Strings.es.resx index caecf8c7..eb6d0d31 100644 --- a/app/Properties/Strings.es.resx +++ b/app/Properties/Strings.es.resx @@ -279,8 +279,8 @@ Bajar retroiluminación con batería - - Retroiluminación del teclado + + Retroiluminación Teclado del portátil @@ -331,7 +331,7 @@ Cambia a Eco con batería y a Estándar cuando está enchufado - Deshabilitar dGPU con cargador USB-C en modo Optimizado + Deshabilitar dGPU con cargador USB-C en modo Optimizado Otro diff --git a/app/Properties/Strings.resx b/app/Properties/Strings.resx index 3f823efa..2a7f8608 100644 --- a/app/Properties/Strings.resx +++ b/app/Properties/Strings.resx @@ -282,7 +282,7 @@ Lower backlight brightness on battery and back when plugged - + Laptop Backlight @@ -291,6 +291,15 @@ Laptop Screen + + Lid + + + Lightbar + + + Logo + Binary Banner diff --git a/app/Properties/Strings.tr.resx b/app/Properties/Strings.tr.resx index 7d60cfb1..37b7146e 100644 --- a/app/Properties/Strings.tr.resx +++ b/app/Properties/Strings.tr.resx @@ -279,8 +279,8 @@ Pille çalışırken klavye aydınlatmasını kıs, şarjdayken eski haline dön - - Klavye Aydınlatması + + Aydınlatması Laptop Klavyesi diff --git a/app/Properties/Strings.uk.resx b/app/Properties/Strings.uk.resx index 796754e3..f2df1532 100644 --- a/app/Properties/Strings.uk.resx +++ b/app/Properties/Strings.uk.resx @@ -279,8 +279,8 @@ Вимкнути підсвітку на батареї та увімкнути на зарядці - - Підсвітка клавіатури + + Підсвітка Клавіатура diff --git a/app/Properties/Strings.zh-CN.resx b/app/Properties/Strings.zh-CN.resx index 9fff9f03..65426d2d 100644 --- a/app/Properties/Strings.zh-CN.resx +++ b/app/Properties/Strings.zh-CN.resx @@ -279,8 +279,8 @@ 电池模式下降低键盘亮度以省电,并在插上电源时恢复 - - 键盘背光 + + 背光 笔记本键盘 diff --git a/app/Properties/Strings.zh-TW.resx b/app/Properties/Strings.zh-TW.resx index ed21cbdb..9b9b6bff 100644 --- a/app/Properties/Strings.zh-TW.resx +++ b/app/Properties/Strings.zh-TW.resx @@ -279,8 +279,8 @@ 電池模式時自動降低鍵盤背光亮度以省電 - - 鍵盤背光 + + 背光 鍵盤背光: