From e5996d0fe1f1064f8a9fc535128ad440d99e994a Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 13 Oct 2021 11:19:45 +0800 Subject: [PATCH] style: new style of preference setting dialog --- src/Commands/Fetch.cs | 2 +- src/Models/Preference.cs | 10 +- src/Resources/Locales/en_US.xaml | 8 +- src/Resources/Locales/zh_CN.xaml | 2 +- src/Views/Preference.xaml | 602 ++++++++++++++++--------------- 5 files changed, 314 insertions(+), 310 deletions(-) diff --git a/src/Commands/Fetch.cs b/src/Commands/Fetch.cs index f45495fb..9979ff93 100644 --- a/src/Commands/Fetch.cs +++ b/src/Commands/Fetch.cs @@ -45,7 +45,7 @@ namespace SourceGit.Commands { private Timer timer = null; public static void Start(string repo) { - if (!Models.Preference.Instance.General.AutoFetchRemotes) return; + if (!Models.Preference.Instance.Git.AutoFetchRemotes) return; // 只自动更新加入管理列表中的仓库(子模块等不自动更新) var exists = Models.Preference.Instance.FindRepository(repo); diff --git a/src/Models/Preference.cs b/src/Models/Preference.cs index 2919752b..4ba96233 100644 --- a/src/Models/Preference.cs +++ b/src/Models/Preference.cs @@ -68,11 +68,6 @@ namespace SourceGit.Models { /// public int LastCheckDay { get; set; } = 0; - /// - /// 启用自动拉取远程变更(每10分钟一次) - /// - public bool AutoFetchRemotes { get; set; } = true; - /// /// 是否启用崩溃上报 /// @@ -98,6 +93,11 @@ namespace SourceGit.Models { /// 默认克隆路径 /// public string DefaultCloneDir { get; set; } + + /// + /// 启用自动拉取远程变更(每10分钟一次) + /// + public bool AutoFetchRemotes { get; set; } = true; } /// diff --git a/src/Resources/Locales/en_US.xaml b/src/Resources/Locales/en_US.xaml index 5b5e0661..94c819a1 100644 --- a/src/Resources/Locales/en_US.xaml +++ b/src/Resources/Locales/en_US.xaml @@ -359,18 +359,17 @@ Commit revert changes Preference - GENERAL SETTING + GENERAL Language Window Font Content Font Avatar Server Check for update Use dark theme - Fetch remotes automatically (need restart) Restore windows Enable crash report (maybe include related path) Use Windows Terminal instead of cmd.exe - GIT SETTING + GIT Install Path Input path for git.exe Git version @@ -381,7 +380,8 @@ User Email Global git user email Enable Auto CRLF - MERGE TOOL + Fetch remotes automatically (need restart) + MERGE Merger Install Path Input path for merge tool diff --git a/src/Resources/Locales/zh_CN.xaml b/src/Resources/Locales/zh_CN.xaml index 66224eac..96ddc01b 100644 --- a/src/Resources/Locales/zh_CN.xaml +++ b/src/Resources/Locales/zh_CN.xaml @@ -365,7 +365,6 @@ 头像服务 启用检测更新 启用暗色主题 - 启用定时自动拉取远程更新(重启生效) 启动时恢复上次打开的仓库 开启崩溃上报(可能涉及上报相关路径) 使用 Windows Terminal 打开 Git 终端 @@ -380,6 +379,7 @@ 邮箱 默认GIT用户邮箱 自动换行转换 + 启用定时自动拉取远程更新(重启生效) 外部合并工具 工具 安装路径 diff --git a/src/Views/Preference.xaml b/src/Views/Preference.xaml index b67d933b..8eb11421 100644 --- a/src/Views/Preference.xaml +++ b/src/Views/Preference.xaml @@ -12,7 +12,7 @@ WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Title="{DynamicResource Text.Preference}" - Width="500" SizeToContent="Height"> + Width="500" Height="340"> @@ -52,328 +52,332 @@ Grid.Row="1" HorizontalAlignment="Stretch" Fill="{DynamicResource Brush.Border0}"/> + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - + + + - - + + + + + + + - - - + + + + + + + - - - - - - - + + + - - - - - - - + + - - - + + - - + + - - + + - - + + + + - - + + + + + + + + + + + + - - + + + + - - + + + + + + + - - + + + - - - - - - - + + + - - - + + + + + + + - - - + + + - - - - - - - + + + - - - + + + - - - + + + + + + + + + + + + - - - + + + + - - - - - - - - - - - - + + + + + + - - + + + + + + + + - - - + + + + + + + - - - - - - - - - - - - + + + + + +