From 1d6043cab055743e7745b668a1facf4a14031948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Thu, 8 Dec 2022 10:43:10 +0100 Subject: [PATCH] Store `PowerControl` settings in `.ini` --- PowerControl/PowerControl.csproj | 9 --- PowerControl/Program.cs | 4 -- PowerControl/Settings.Designer.cs | 98 ------------------------------- PowerControl/Settings.cs | 59 +++++++++++++++++++ PowerControl/Settings.settings | 27 --------- SteamController/App.config | 20 ------- 6 files changed, 59 insertions(+), 158 deletions(-) delete mode 100644 PowerControl/Settings.Designer.cs create mode 100644 PowerControl/Settings.cs delete mode 100644 PowerControl/Settings.settings delete mode 100644 SteamController/App.config diff --git a/PowerControl/PowerControl.csproj b/PowerControl/PowerControl.csproj index dc6d30e..495bcfb 100644 --- a/PowerControl/PowerControl.csproj +++ b/PowerControl/PowerControl.csproj @@ -47,11 +47,6 @@ True Resources.resx - - True - True - Settings.settings - @@ -77,10 +72,6 @@ PreserveNewest - - SettingsSingleFileGenerator - Settings.Designer.cs - \ No newline at end of file diff --git a/PowerControl/Program.cs b/PowerControl/Program.cs index e871e62..06f1c72 100644 --- a/PowerControl/Program.cs +++ b/PowerControl/Program.cs @@ -14,10 +14,6 @@ namespace PowerControl [STAThread] static void Main() { -#if DEBUG - Settings.Default.EnableExperimentalFeatures = true; -#endif - if (Settings.Default.EnableExperimentalFeatures) { for (int i = 0; !VangoghGPU.IsSupported; i++) diff --git a/PowerControl/Settings.Designer.cs b/PowerControl/Settings.Designer.cs deleted file mode 100644 index a780992..0000000 --- a/PowerControl/Settings.Designer.cs +++ /dev/null @@ -1,98 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace PowerControl { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("Ctrl+Win+Numpad8")] - public string MenuUpKey { - get { - return ((string)(this["MenuUpKey"])); - } - } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("Ctrl+Win+Numpad2")] - public string MenuDownKey { - get { - return ((string)(this["MenuDownKey"])); - } - } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("Ctrl+Win+Numpad4")] - public string MenuLeftKey { - get { - return ((string)(this["MenuLeftKey"])); - } - } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("Ctrl+Win+Numpad6")] - public string MenuRightKey { - get { - return ((string)(this["MenuRightKey"])); - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool EnableNeptuneController { - get { - return ((bool)(this["EnableNeptuneController"])); - } - set { - this["EnableNeptuneController"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool EnableVolumeControls { - get { - return ((bool)(this["EnableVolumeControls"])); - } - set { - this["EnableVolumeControls"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool EnableExperimentalFeatures { - get { - return ((bool)(this["EnableExperimentalFeatures"])); - } - set { - this["EnableExperimentalFeatures"] = value; - } - } - } -} diff --git a/PowerControl/Settings.cs b/PowerControl/Settings.cs new file mode 100644 index 0000000..5d49307 --- /dev/null +++ b/PowerControl/Settings.cs @@ -0,0 +1,59 @@ +using CommonHelpers; + +namespace PowerControl +{ + internal sealed class Settings : BaseSettings + { + public static readonly Settings Default = new Settings(); + + public Settings() : base("Settings") + { + TouchSettings = true; + } + + public string MenuUpKey + { + get { return Get("MenuUpKey", "Ctrl+Win+Numpad8"); } + set { Set("MenuUpKey", value); } + } + + public string MenuDownKey + { + get { return Get("MenuDownKey", "Ctrl+Win+Numpad2"); } + set { Set("MenuDownKey", value); } + } + + public string MenuLeftKey + { + get { return Get("MenuLeftKey", "Ctrl+Win+Numpad6"); } + set { Set("MenuLeftKey", value); } + } + + public string MenuRightKey + { + get { return Get("MenuRightKey", "Ctrl+Win+Numpad6"); } + set { Set("MenuRightKey", value); } + } + + public bool EnableNeptuneController + { + get { return Get("EnableNeptuneController", true); } + set { Set("EnableNeptuneController", value); } + } + + public bool EnableVolumeControls + { + get { return Get("EnableVolumeControls", true); } + set { Set("EnableVolumeControls", value); } + } + + public bool EnableExperimentalFeatures + { +#if DEBUG + get { return true; } +#else + get { return false; } +#endif + } + } +} diff --git a/PowerControl/Settings.settings b/PowerControl/Settings.settings deleted file mode 100644 index 6518914..0000000 --- a/PowerControl/Settings.settings +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Ctrl+Win+Numpad8 - - - Ctrl+Win+Numpad2 - - - Ctrl+Win+Numpad4 - - - Ctrl+Win+Numpad6 - - - True - - - True - - - False - - - \ No newline at end of file diff --git a/SteamController/App.config b/SteamController/App.config deleted file mode 100644 index 0ab8bdb..0000000 --- a/SteamController/App.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - -
- - -
- - - - - - - - Desktop - - - - \ No newline at end of file