mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Removed unsupported charge limits https://github.com/seerge/g-helper/discussions/2408
This commit is contained in:
@@ -109,7 +109,8 @@ public static class AppConfig
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception ex)
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.WriteLine(ex.Message);
|
||||
}
|
||||
@@ -625,6 +626,15 @@ public static class AppConfig
|
||||
return IsAlly() || Is("stop_ac");
|
||||
}
|
||||
|
||||
public static bool IsChargeLimit80()
|
||||
{
|
||||
return ContainsModel("GA403");
|
||||
}
|
||||
|
||||
public static bool IsChargeLimit6080()
|
||||
{
|
||||
return true || IsTUF() && !(ContainsModel("FX507Z") || ContainsModel("FA617"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using GHelper.Helpers;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace GHelper.Battery
|
||||
{
|
||||
@@ -37,6 +36,17 @@ namespace GHelper.Battery
|
||||
if (limit < 0) limit = AppConfig.Get("charge_limit");
|
||||
if (limit < 40 || limit > 100) return;
|
||||
|
||||
if (AppConfig.IsChargeLimit80())
|
||||
{
|
||||
limit = (limit <= 80) ? 80 : 100;
|
||||
}
|
||||
|
||||
if (AppConfig.IsChargeLimit6080())
|
||||
{
|
||||
if (limit > 80) limit = 100;
|
||||
else if (limit < 60) limit = 60;
|
||||
}
|
||||
|
||||
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, limit, "BatteryLimit");
|
||||
|
||||
AppConfig.Set("charge_limit", limit);
|
||||
|
||||
@@ -12,6 +12,7 @@ using GHelper.Peripherals;
|
||||
using GHelper.Peripherals.Mouse;
|
||||
using GHelper.UI;
|
||||
using GHelper.USB;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Timers;
|
||||
|
||||
@@ -224,6 +225,7 @@ namespace GHelper
|
||||
|
||||
sliderBattery.MouseUp += SliderBattery_MouseUp;
|
||||
sliderBattery.KeyUp += SliderBattery_KeyUp;
|
||||
sliderBattery.ValueChanged += SliderBattery_ValueChanged;
|
||||
|
||||
Program.trayIcon.MouseMove += TrayIcon_MouseMove;
|
||||
|
||||
@@ -272,11 +274,17 @@ namespace GHelper
|
||||
InitVisual();
|
||||
}
|
||||
|
||||
|
||||
private void ButtonFHD_Click(object? sender, EventArgs e)
|
||||
{
|
||||
screenControl.ToogleFHD();
|
||||
}
|
||||
|
||||
private void SliderBattery_ValueChanged(object? sender, EventArgs e)
|
||||
{
|
||||
VisualiseBatteryTitle(sliderBattery.Value);
|
||||
}
|
||||
|
||||
private void SliderBattery_KeyUp(object? sender, KeyEventArgs e)
|
||||
{
|
||||
BatteryControl.SetBatteryChargeLimit(sliderBattery.Value);
|
||||
@@ -1710,9 +1718,14 @@ namespace GHelper
|
||||
but.BackColor = but.Enabled ? Color.FromArgb(255, but.BackColor) : Color.FromArgb(100, but.BackColor);
|
||||
}
|
||||
|
||||
public void VisualiseBattery(int limit)
|
||||
public void VisualiseBatteryTitle(int limit)
|
||||
{
|
||||
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
|
||||
}
|
||||
|
||||
public void VisualiseBattery(int limit)
|
||||
{
|
||||
VisualiseBatteryTitle(limit);
|
||||
sliderBattery.Value = limit;
|
||||
|
||||
sliderBattery.AccessibleName = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
|
||||
|
||||
Reference in New Issue
Block a user