From 94d445d354dc7e77112c0a1f53b31aceefee4218 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Wed, 11 Dec 2024 11:01:56 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"style:=20=E4=BF=AE=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E4=BB=A5=E7=AC=A6=E5=90=88=E9=A1=B9=E7=9B=AE=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 8cc07795415ecb310d4bd3ac3242e6ed8daff18a. --- .../ViewModels/UI/SettingsViewModel.cs | 18 +++++++++--------- .../ConnectSettingsUserControlModel.cs | 3 +-- ...rnalNotificationSettingsUserControlModel.cs | 2 -- .../Settings/GameSettingsUserControlModel.cs | 2 -- .../Settings/GuiSettingsUserControlModel.cs | 2 -- .../Settings/RemoteControlUserControlModel.cs | 2 -- .../Settings/StartSettingsUserControlModel.cs | 2 -- .../Settings/TimerSettingsUserControlModel.cs | 2 -- .../VersionUpdateSettingsUserControlModel.cs | 2 -- .../PerformanceUserControlModel.cs | 4 +--- 10 files changed, 11 insertions(+), 28 deletions(-) rename src/MaaWpfGui/ViewModels/UserControl/{Settings => TaskQueue}/PerformanceUserControlModel.cs (92%) diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs index f7d2ef7625..c8780abc0c 100644 --- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs @@ -112,47 +112,47 @@ namespace MaaWpfGui.ViewModels.UI /// /// Gets 游戏设置model /// - public static GameSettingsUserControlModel GameSettings { get; } = GameSettingsUserControlModel.Instance; + public static GameSettingsUserControlModel GameSettings { get; } = new(); /// /// Gets 连接设置model /// - public static ConnectSettingsUserControlModel ConnectSettings { get; } = ConnectSettingsUserControlModel.Instance; + public static ConnectSettingsUserControlModel ConnectSettings { get; } = new(); /// /// Gets 启动设置Model /// - public static StartSettingsUserControlModel StartSettings { get; } = StartSettingsUserControlModel.Instance; + public static StartSettingsUserControlModel StartSettings { get; } = new(); /// /// Gets 界面设置model /// - public static GuiSettingsUserControlModel GuiSettings { get; } = GuiSettingsUserControlModel.Instance; + public static GuiSettingsUserControlModel GuiSettings { get; } = new(); /// /// Gets 定时设置model /// - public static TimerSettingsUserControlModel TimerSettings { get; } = TimerSettingsUserControlModel.Instance; + public static TimerSettingsUserControlModel TimerSettings { get; } = new(); /// /// Gets 远程控制model /// - public static RemoteControlUserControlModel RemoteControlSettings { get; } = RemoteControlUserControlModel.Instance; + public static RemoteControlUserControlModel RemoteControlSettings { get; } = new(); /// /// Gets 软件更新model /// - public static VersionUpdateSettingsUserControlModel VersionUpdateSettings { get; } = VersionUpdateSettingsUserControlModel.Instance; + public static VersionUpdateSettingsUserControlModel VersionUpdateSettings { get; } = new(); /// /// Gets 外部通知model /// - public static ExternalNotificationSettingsUserControlModel ExternalNotificationSettings { get; } = ExternalNotificationSettingsUserControlModel.Instance; + public static ExternalNotificationSettingsUserControlModel ExternalNotificationSettings { get; } = new(); /// /// Gets 性能设置model /// - public static PerformanceUserControlModel PerformanceSettings { get; } = PerformanceUserControlModel.Instance; + public static PerformanceUserControlModel PerformanceSettings { get; } = new(); #endregion 设置界面Model diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/ConnectSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/ConnectSettingsUserControlModel.cs index a956c305c2..7dd75c0f26 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/ConnectSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/ConnectSettingsUserControlModel.cs @@ -28,6 +28,7 @@ using MaaWpfGui.Constants; using MaaWpfGui.Helper; using MaaWpfGui.Main; using MaaWpfGui.States; +using MaaWpfGui.Utilities; using MaaWpfGui.Utilities.ValueType; using MaaWpfGui.ViewModels.UI; using MaaWpfGui.WineCompat; @@ -45,8 +46,6 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings; /// public class ConnectSettingsUserControlModel : PropertyChangedBase { - public static ConnectSettingsUserControlModel Instance { get; } = new(); - private static readonly ILogger _logger = Log.ForContext(); private static RunningState _runningState => RunningState.Instance; diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/ExternalNotificationSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/ExternalNotificationSettingsUserControlModel.cs index 413fb1ee75..d51b07f762 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/ExternalNotificationSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/ExternalNotificationSettingsUserControlModel.cs @@ -27,8 +27,6 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings; /// public class ExternalNotificationSettingsUserControlModel : PropertyChangedBase { - public static ExternalNotificationSettingsUserControlModel Instance { get; } = new(); - // UI 绑定的方法 // ReSharper disable once UnusedMember.Global public static void ExternalNotificationSendTest() diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs index 5f55f29ea4..cdf9a2d504 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs @@ -27,8 +27,6 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings; public class GameSettingsUserControlModel : PropertyChangedBase { - public static GameSettingsUserControlModel Instance { get; } = new(); - private static readonly ILogger _logger = Log.ForContext(); private static VersionUpdateSettingsUserControlModel VersionUpdateSettings => SettingsViewModel.VersionUpdateSettings; diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/GuiSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/GuiSettingsUserControlModel.cs index c3c4db53fd..52d916b541 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/GuiSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/GuiSettingsUserControlModel.cs @@ -29,8 +29,6 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings; public class GuiSettingsUserControlModel : PropertyChangedBase { - public static GuiSettingsUserControlModel Instance { get; } = new(); - /// /// Gets or sets the language list. /// diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/RemoteControlUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/RemoteControlUserControlModel.cs index 9779542628..b0a67a7653 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/RemoteControlUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/RemoteControlUserControlModel.cs @@ -23,8 +23,6 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings; /// public class RemoteControlUserControlModel : PropertyChangedBase { - public static RemoteControlUserControlModel Instance { get; } = new(); - private string _remoteControlGetTaskEndpointUri = ConfigurationHelper.GetValue(ConfigurationKeys.RemoteControlGetTaskEndpointUri, string.Empty); public string RemoteControlGetTaskEndpointUri diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/StartSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/StartSettingsUserControlModel.cs index ed0ecc02a3..4716cea323 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/StartSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/StartSettingsUserControlModel.cs @@ -40,8 +40,6 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings; /// public class StartSettingsUserControlModel : PropertyChangedBase { - public static StartSettingsUserControlModel Instance { get; } = new(); - private static readonly ILogger _logger = Log.ForContext(); private static RunningState _runningState => RunningState.Instance; diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/TimerSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/TimerSettingsUserControlModel.cs index 40a353bc4b..2d5b63f7cd 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/TimerSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/TimerSettingsUserControlModel.cs @@ -24,8 +24,6 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings; /// public class TimerSettingsUserControlModel : PropertyChangedBase { - public static TimerSettingsUserControlModel Instance { get; } = new(); - private bool _forceScheduledStart = Convert.ToBoolean(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.ForceScheduledStart, bool.FalseString)); /// diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs index d2d75577f9..0ab5d19805 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs @@ -41,8 +41,6 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings; /// public class VersionUpdateSettingsUserControlModel : PropertyChangedBase { - public static VersionUpdateSettingsUserControlModel Instance { get; } = new(); - public enum UpdateVersionType { /// diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/PerformanceUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/PerformanceUserControlModel.cs similarity index 92% rename from src/MaaWpfGui/ViewModels/UserControl/Settings/PerformanceUserControlModel.cs rename to src/MaaWpfGui/ViewModels/UserControl/TaskQueue/PerformanceUserControlModel.cs index 3782245573..3396976eed 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/PerformanceUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/PerformanceUserControlModel.cs @@ -17,15 +17,13 @@ using MaaWpfGui.Helper; using MaaWpfGui.ViewModels.UI; using Stylet; -namespace MaaWpfGui.ViewModels.UserControl.Settings; +namespace MaaWpfGui.ViewModels.UserControl.TaskQueue; /// /// 性能设置 /// public class PerformanceUserControlModel : PropertyChangedBase { - public static PerformanceUserControlModel Instance { get; } = new(); - public List GpuOptions => GpuOption.GetGpuOptions(); public GpuOption ActiveGpuOption