mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Adjustment of Windows Power Overlay is now optional
This commit is contained in:
@@ -69,6 +69,7 @@ public class AppConfig
|
|||||||
{
|
{
|
||||||
config = new Dictionary<string, object>();
|
config = new Dictionary<string, object>();
|
||||||
config["performance_mode"] = 0;
|
config["performance_mode"] = 0;
|
||||||
|
config["auto_apply_power_plan"] = 1;
|
||||||
string jsonString = JsonSerializer.Serialize(config);
|
string jsonString = JsonSerializer.Serialize(config);
|
||||||
File.WriteAllText(configFile, jsonString);
|
File.WriteAllText(configFile, jsonString);
|
||||||
}
|
}
|
||||||
|
|||||||
33
app/Fans.Designer.cs
generated
33
app/Fans.Designer.cs
generated
@@ -86,6 +86,7 @@ namespace GHelper
|
|||||||
panelTitleGPU = new Panel();
|
panelTitleGPU = new Panel();
|
||||||
pictureGPU = new PictureBox();
|
pictureGPU = new PictureBox();
|
||||||
labelGPU = new Label();
|
labelGPU = new Label();
|
||||||
|
checkApplyWindowsPowerPlan = new RCheckBox();
|
||||||
panelFans.SuspendLayout();
|
panelFans.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
||||||
tableFanCharts.SuspendLayout();
|
tableFanCharts.SuspendLayout();
|
||||||
@@ -323,12 +324,14 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
// panelApplyPower
|
// panelApplyPower
|
||||||
//
|
//
|
||||||
|
panelApplyPower.Controls.Add(checkApplyWindowsPowerPlan);
|
||||||
panelApplyPower.Controls.Add(checkApplyPower);
|
panelApplyPower.Controls.Add(checkApplyPower);
|
||||||
panelApplyPower.Dock = DockStyle.Bottom;
|
panelApplyPower.Dock = DockStyle.Bottom;
|
||||||
panelApplyPower.Location = new Point(0, 445);
|
panelApplyPower.Location = new Point(0, 307);
|
||||||
|
panelApplyPower.Margin = new Padding(2);
|
||||||
panelApplyPower.Name = "panelApplyPower";
|
panelApplyPower.Name = "panelApplyPower";
|
||||||
panelApplyPower.Padding = new Padding(10);
|
panelApplyPower.Padding = new Padding(6);
|
||||||
panelApplyPower.Size = new Size(523, 92);
|
panelApplyPower.Size = new Size(392, 98);
|
||||||
panelApplyPower.TabIndex = 44;
|
panelApplyPower.TabIndex = 44;
|
||||||
//
|
//
|
||||||
// checkApplyPower
|
// checkApplyPower
|
||||||
@@ -336,11 +339,11 @@ namespace GHelper
|
|||||||
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
checkApplyPower.AutoSize = true;
|
checkApplyPower.AutoSize = true;
|
||||||
checkApplyPower.BackColor = SystemColors.ControlLight;
|
checkApplyPower.BackColor = SystemColors.ControlLight;
|
||||||
checkApplyPower.Location = new Point(18, 22);
|
checkApplyPower.Location = new Point(10, 50);
|
||||||
checkApplyPower.Margin = new Padding(10);
|
checkApplyPower.Margin = new Padding(6);
|
||||||
checkApplyPower.Name = "checkApplyPower";
|
checkApplyPower.Name = "checkApplyPower";
|
||||||
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
|
checkApplyPower.Padding = new Padding(8, 3, 8, 3);
|
||||||
checkApplyPower.Size = new Size(277, 46);
|
checkApplyPower.Size = new Size(205, 35);
|
||||||
checkApplyPower.TabIndex = 45;
|
checkApplyPower.TabIndex = 45;
|
||||||
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
|
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
|
||||||
checkApplyPower.UseVisualStyleBackColor = false;
|
checkApplyPower.UseVisualStyleBackColor = false;
|
||||||
@@ -731,6 +734,21 @@ namespace GHelper
|
|||||||
labelGPU.TabIndex = 40;
|
labelGPU.TabIndex = 40;
|
||||||
labelGPU.Text = "GPU Settings";
|
labelGPU.Text = "GPU Settings";
|
||||||
//
|
//
|
||||||
|
// checkApplyWindowsPowerPlan
|
||||||
|
//
|
||||||
|
checkApplyWindowsPowerPlan.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
|
checkApplyWindowsPowerPlan.AutoSize = true;
|
||||||
|
checkApplyWindowsPowerPlan.BackColor = SystemColors.ControlLight;
|
||||||
|
checkApplyWindowsPowerPlan.Location = new Point(10, 13);
|
||||||
|
checkApplyWindowsPowerPlan.Margin = new Padding(6);
|
||||||
|
checkApplyWindowsPowerPlan.Name = "checkApplyWindowsPowerPlan";
|
||||||
|
checkApplyWindowsPowerPlan.Padding = new Padding(8, 3, 8, 3);
|
||||||
|
checkApplyWindowsPowerPlan.Size = new Size(319, 35);
|
||||||
|
checkApplyWindowsPowerPlan.TabIndex = 46;
|
||||||
|
checkApplyWindowsPowerPlan.Text = "Auto Adjust Windows Power Plan";
|
||||||
|
checkApplyWindowsPowerPlan.UseVisualStyleBackColor = false;
|
||||||
|
checkApplyWindowsPowerPlan.CheckedChanged += checkApplyWindowsPowerPlan_CheckedChanged;
|
||||||
|
//
|
||||||
// Fans
|
// Fans
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(192F, 192F);
|
AutoScaleDimensions = new SizeF(192F, 192F);
|
||||||
@@ -842,5 +860,6 @@ namespace GHelper
|
|||||||
private Label labelGPUTemp;
|
private Label labelGPUTemp;
|
||||||
private Label labelGPUTempTitle;
|
private Label labelGPUTempTitle;
|
||||||
private TrackBar trackGPUTemp;
|
private TrackBar trackGPUTemp;
|
||||||
|
private RCheckBox checkApplyWindowsPowerPlan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,6 +28,7 @@ namespace GHelper
|
|||||||
labelPowerLimits.Text = Properties.Strings.PowerLimits;
|
labelPowerLimits.Text = Properties.Strings.PowerLimits;
|
||||||
labelInfo.Text = Properties.Strings.PPTExperimental;
|
labelInfo.Text = Properties.Strings.PPTExperimental;
|
||||||
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
|
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
|
||||||
|
checkApplyWindowsPowerPlan.Text = Properties.Strings.ApplyWindowsPowerPlan;
|
||||||
|
|
||||||
labelFans.Text = Properties.Strings.FanCurves;
|
labelFans.Text = Properties.Strings.FanCurves;
|
||||||
labelBoost.Text = Properties.Strings.CPUBoost;
|
labelBoost.Text = Properties.Strings.CPUBoost;
|
||||||
@@ -377,6 +378,7 @@ namespace GHelper
|
|||||||
int limit_total;
|
int limit_total;
|
||||||
int limit_cpu;
|
int limit_cpu;
|
||||||
bool apply = Program.config.getConfigPerf("auto_apply_power") == 1;
|
bool apply = Program.config.getConfigPerf("auto_apply_power") == 1;
|
||||||
|
bool applyPP = Program.config.getConfig("auto_apply_power_plan") == 1;
|
||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
@@ -401,6 +403,7 @@ namespace GHelper
|
|||||||
trackTotal.Value = limit_total;
|
trackTotal.Value = limit_total;
|
||||||
trackCPU.Value = limit_cpu;
|
trackCPU.Value = limit_cpu;
|
||||||
checkApplyPower.Checked = apply;
|
checkApplyPower.Checked = apply;
|
||||||
|
checkApplyWindowsPowerPlan.Checked = applyPP;
|
||||||
|
|
||||||
labelTotal.Text = trackTotal.Value.ToString() + "W";
|
labelTotal.Text = trackTotal.Value.ToString() + "W";
|
||||||
labelCPU.Text = trackCPU.Value.ToString() + "W";
|
labelCPU.Text = trackCPU.Value.ToString() + "W";
|
||||||
@@ -689,6 +692,11 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkApplyWindowsPowerPlan_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
CheckBox chk = (CheckBox)sender;
|
||||||
|
Program.config.setConfig("auto_apply_power_plan", chk.Checked ? 1 : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
11
app/Properties/Strings.Designer.cs
generated
11
app/Properties/Strings.Designer.cs
generated
@@ -169,7 +169,16 @@ namespace GHelper.Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Breathe.
|
/// Looks up a localized string similar to Auto Adjust Windows Power Plan.
|
||||||
|
/// </summary>
|
||||||
|
internal static string ApplyWindowsPowerPlan {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ApplyWindowsPowerPlan", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Breathe.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string AuraBreathe {
|
internal static string AuraBreathe {
|
||||||
get {
|
get {
|
||||||
|
|||||||
@@ -94,6 +94,9 @@
|
|||||||
<data name="ApplyPowerLimits" xml:space="preserve">
|
<data name="ApplyPowerLimits" xml:space="preserve">
|
||||||
<value>Apply Power Limits</value>
|
<value>Apply Power Limits</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
|
<value>Auto Adjust Windows Power Plan</value>
|
||||||
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>Breathe</value>
|
<value>Breathe</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -153,6 +153,9 @@
|
|||||||
<data name="ApplyPowerLimits" xml:space="preserve">
|
<data name="ApplyPowerLimits" xml:space="preserve">
|
||||||
<value>Aplicar límites de energía</value>
|
<value>Aplicar límites de energía</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
|
<value>Auto Adjust Windows Power Plan</value>
|
||||||
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>Respiración</value>
|
<value>Respiración</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -301,6 +301,9 @@
|
|||||||
<data name="RunOnStartup" xml:space="preserve">
|
<data name="RunOnStartup" xml:space="preserve">
|
||||||
<value>Run on Startup</value>
|
<value>Run on Startup</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
|
<value>Auto Adjust Windows Power Plan</value>
|
||||||
|
</data>
|
||||||
<data name="Shutdown" xml:space="preserve">
|
<data name="Shutdown" xml:space="preserve">
|
||||||
<value>Shutdown</value>
|
<value>Shutdown</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -94,6 +94,9 @@
|
|||||||
<data name="ApplyPowerLimits" xml:space="preserve">
|
<data name="ApplyPowerLimits" xml:space="preserve">
|
||||||
<value>Apply Power Limits</value>
|
<value>Apply Power Limits</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
|
<value>Auto Adjust Windows Power Plan</value>
|
||||||
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>Breathe</value>
|
<value>Breathe</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -153,6 +153,9 @@
|
|||||||
<data name="ApplyPowerLimits" xml:space="preserve">
|
<data name="ApplyPowerLimits" xml:space="preserve">
|
||||||
<value>Apply Power Limits</value>
|
<value>Apply Power Limits</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
|
<value>Auto Adjust Windows Power Plan</value>
|
||||||
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>Breathe</value>
|
<value>Breathe</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -153,6 +153,9 @@
|
|||||||
<data name="ApplyPowerLimits" xml:space="preserve">
|
<data name="ApplyPowerLimits" xml:space="preserve">
|
||||||
<value>Güç Sınırlarını Uygula</value>
|
<value>Güç Sınırlarını Uygula</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
|
<value>Auto Adjust Windows Power Plan</value>
|
||||||
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>Nefes</value>
|
<value>Nefes</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -153,6 +153,9 @@
|
|||||||
<data name="ApplyPowerLimits" xml:space="preserve">
|
<data name="ApplyPowerLimits" xml:space="preserve">
|
||||||
<value>Застосувати потужність</value>
|
<value>Застосувати потужність</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
|
<value>Auto Adjust Windows Power Plan</value>
|
||||||
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>Дихання</value>
|
<value>Дихання</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -153,6 +153,9 @@
|
|||||||
<data name="ApplyPowerLimits" xml:space="preserve">
|
<data name="ApplyPowerLimits" xml:space="preserve">
|
||||||
<value>应用功率限制</value>
|
<value>应用功率限制</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
|
<value>Auto Adjust Windows Power Plan</value>
|
||||||
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>呼吸</value>
|
<value>呼吸</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -153,6 +153,9 @@
|
|||||||
<data name="ApplyPowerLimits" xml:space="preserve">
|
<data name="ApplyPowerLimits" xml:space="preserve">
|
||||||
<value>套用功率限制</value>
|
<value>套用功率限制</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
|
||||||
|
<value>Auto Adjust Windows Power Plan</value>
|
||||||
|
</data>
|
||||||
<data name="AuraBreathe" xml:space="preserve">
|
<data name="AuraBreathe" xml:space="preserve">
|
||||||
<value>呼吸</value>
|
<value>呼吸</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1238,11 +1238,13 @@ namespace GHelper
|
|||||||
AutoFans();
|
AutoFans();
|
||||||
AutoPower(1000);
|
AutoPower(1000);
|
||||||
|
|
||||||
|
if (Program.config.getConfigPerf("auto_apply_power_plan") == 1)
|
||||||
if (Program.config.getConfigPerfString("scheme") is not null)
|
{
|
||||||
NativeMethods.SetPowerScheme(Program.config.getConfigPerfString("scheme"));
|
if (Program.config.getConfigPerfString("scheme") is not null)
|
||||||
else
|
NativeMethods.SetPowerScheme(Program.config.getConfigPerfString("scheme"));
|
||||||
NativeMethods.SetPowerScheme(PerformanceMode);
|
else
|
||||||
|
NativeMethods.SetPowerScheme(PerformanceMode);
|
||||||
|
}
|
||||||
|
|
||||||
if (Program.config.getConfigPerf("auto_boost") != -1)
|
if (Program.config.getConfigPerf("auto_boost") != -1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user