mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Supressed crash on failed battery charge limit setting
This commit is contained in:
@@ -596,6 +596,8 @@ namespace GHelper
|
||||
settingsForm.Show();
|
||||
settingsForm.Activate();
|
||||
}
|
||||
|
||||
trayIcon.Icon = trayIcon.Icon; // refreshing icon as it get's blurred when screen resolution changes
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1
Settings.Designer.cs
generated
1
Settings.Designer.cs
generated
@@ -488,6 +488,7 @@
|
||||
this.comboKeyboard.Name = "comboKeyboard";
|
||||
this.comboKeyboard.Size = new System.Drawing.Size(198, 40);
|
||||
this.comboKeyboard.TabIndex = 24;
|
||||
this.comboKeyboard.TabStop = false;
|
||||
//
|
||||
// buttonKeyboardColor
|
||||
//
|
||||
|
||||
11
Settings.cs
11
Settings.cs
@@ -55,6 +55,8 @@ namespace GHelper
|
||||
checkScreen.CheckedChanged += checkScreen_CheckedChanged;
|
||||
|
||||
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboKeyboard.SelectedIndex = 0;
|
||||
|
||||
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
||||
|
||||
buttonKeyboardColor.Click += ButtonKeyboardColor_Click;
|
||||
@@ -114,6 +116,7 @@ namespace GHelper
|
||||
|
||||
public void SetAuraMode (int mode = 0, bool apply = true)
|
||||
{
|
||||
|
||||
if (mode > 3) mode = 0;
|
||||
|
||||
if (Aura.Mode == mode) return; // same mode
|
||||
@@ -123,7 +126,7 @@ namespace GHelper
|
||||
|
||||
if (apply)
|
||||
Aura.ApplyAura();
|
||||
|
||||
else
|
||||
comboKeyboard.SelectedIndex = mode;
|
||||
}
|
||||
|
||||
@@ -569,7 +572,13 @@ namespace GHelper
|
||||
|
||||
labelBatteryLimit.Text = limit.ToString() + "%";
|
||||
trackBattery.Value = limit;
|
||||
try
|
||||
{
|
||||
Program.wmi.DeviceSet(ASUSWmi.BatteryLimit, limit);
|
||||
} catch
|
||||
{
|
||||
Debug.WriteLine("Can't set battery charge limit");
|
||||
}
|
||||
Program.config.setConfig("charge_limit", limit);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user