From b45f846fee9991573fe97d91603c8dcae64c0e38 Mon Sep 17 00:00:00 2001 From: Jeirc-X Date: Thu, 8 Aug 2024 23:39:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../I18n/Strings.Designer.cs | 6 ++--- src/SyncClipboard.Core/I18n/Strings.resx | 4 +-- .../I18n/Strings.zh-CN.resx | 4 +-- .../ViewModels/SyncSettingViewModel.cs | 19 +++++++++++++- .../Views/FileSyncFilterSettingPage.axaml | 2 +- .../Views/SyncSettingPage.axaml | 26 ++++++++----------- .../Views/FileSyncFilterSettingPage.xaml | 2 +- .../Views/SyncSettingPage.xaml | 25 +++++++----------- 8 files changed, 47 insertions(+), 41 deletions(-) diff --git a/src/SyncClipboard.Core/I18n/Strings.Designer.cs b/src/SyncClipboard.Core/I18n/Strings.Designer.cs index 37f95800..f95fdaf4 100644 --- a/src/SyncClipboard.Core/I18n/Strings.Designer.cs +++ b/src/SyncClipboard.Core/I18n/Strings.Designer.cs @@ -952,11 +952,11 @@ public static string RunAtSystemStartup { } /// - /// 查找类似 Save 的本地化字符串。 + /// 查找类似 Save List 的本地化字符串。 /// - public static string Save { + public static string SaveList { get { - return ResourceManager.GetString("Save", resourceCulture); + return ResourceManager.GetString("SaveList", resourceCulture); } } diff --git a/src/SyncClipboard.Core/I18n/Strings.resx b/src/SyncClipboard.Core/I18n/Strings.resx index 4e626a94..a3e884e9 100644 --- a/src/SyncClipboard.Core/I18n/Strings.resx +++ b/src/SyncClipboard.Core/I18n/Strings.resx @@ -543,7 +543,7 @@ Each file extension per line - - Save + + Save List \ No newline at end of file diff --git a/src/SyncClipboard.Core/I18n/Strings.zh-CN.resx b/src/SyncClipboard.Core/I18n/Strings.zh-CN.resx index e45449e9..6a1adc5c 100644 --- a/src/SyncClipboard.Core/I18n/Strings.zh-CN.resx +++ b/src/SyncClipboard.Core/I18n/Strings.zh-CN.resx @@ -543,7 +543,7 @@ 每行一个文件扩展名 - - 保存 + + 保存名单 \ No newline at end of file diff --git a/src/SyncClipboard.Core/ViewModels/SyncSettingViewModel.cs b/src/SyncClipboard.Core/ViewModels/SyncSettingViewModel.cs index 743df70a..87e91a81 100644 --- a/src/SyncClipboard.Core/ViewModels/SyncSettingViewModel.cs +++ b/src/SyncClipboard.Core/ViewModels/SyncSettingViewModel.cs @@ -10,11 +10,15 @@ public partial class SyncSettingViewModel : ObservableObject #region server [ObservableProperty] [NotifyPropertyChangedFor(nameof(IsNormalClientEnable))] + [NotifyPropertyChangedFor(nameof(UseManulServer))] + [NotifyPropertyChangedFor(nameof(ClientEnabled))] private bool serverEnable; partial void OnServerEnableChanged(bool value) => ServerConfig = ServerConfig with { SwitchOn = value }; [ObservableProperty] [NotifyPropertyChangedFor(nameof(IsNormalClientEnable))] + [NotifyPropertyChangedFor(nameof(UseManulServer))] + [NotifyPropertyChangedFor(nameof(ClientEnabled))] private bool clientMixedMode; partial void OnClientMixedModeChanged(bool value) => ServerConfig = ServerConfig with { ClientMixedMode = value }; @@ -32,6 +36,7 @@ partial void OnServerConfigChanged(ServerConfig value) #region client [ObservableProperty] + [NotifyPropertyChangedFor(nameof(ClientEnabled))] private bool syncEnable; partial void OnSyncEnableChanged(bool value) => ClientConfig = ClientConfig with { SyncSwitchOn = value }; @@ -113,7 +118,19 @@ private void SetFileSyncFilter() public bool IsNormalClientEnable => !ServerEnable || !ClientMixedMode; - public bool UseManulServer => !UseLocalServer; + public bool UseManulServer => !UseLocalServer && IsNormalClientEnable; + + public bool ClientEnabled + { + get => !IsNormalClientEnable || SyncEnable; + set + { + if (IsNormalClientEnable) + { + SyncEnable = value; + } + } + } [ObservableProperty] [NotifyPropertyChangedFor(nameof(ServerConfigDescription))] diff --git a/src/SyncClipboard.Desktop/Views/FileSyncFilterSettingPage.axaml b/src/SyncClipboard.Desktop/Views/FileSyncFilterSettingPage.axaml index 16c5af87..2695b44b 100644 --- a/src/SyncClipboard.Desktop/Views/FileSyncFilterSettingPage.axaml +++ b/src/SyncClipboard.Desktop/Views/FileSyncFilterSettingPage.axaml @@ -52,7 +52,7 @@ Margin="16,0,0,0" Orientation="Vertical" Spacing="10"> -