From e779d1b65e5fb69e84931f10cdcefe50c0c3142a Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 26 May 2022 17:43:01 +0800 Subject: [PATCH] feature: remember user's choice for Pull --- src/Models/Preference.cs | 10 ++++++++++ src/Views/Popups/Pull.xaml | 9 ++++----- src/Views/Popups/Pull.xaml.cs | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Models/Preference.cs b/src/Models/Preference.cs index 0def93b7..8e327f9e 100644 --- a/src/Models/Preference.cs +++ b/src/Models/Preference.cs @@ -141,6 +141,16 @@ namespace SourceGit.Models { /// public bool UseCombinedDiff { get; set; } = false; + /// + /// Pull时是否使用Rebase替换Merge + /// + public bool UseRebaseOnPull { get; set; } = true; + + /// + /// Pull时是否使用自动暂存 + /// + public bool UseAutoStashOnPull { get; set; } = true; + /// /// 未暂存视图中变更显示方式 /// diff --git a/src/Views/Popups/Pull.xaml b/src/Views/Popups/Pull.xaml index 062a8821..1aef1141 100644 --- a/src/Views/Popups/Pull.xaml +++ b/src/Views/Popups/Pull.xaml @@ -5,7 +5,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" - xmlns:converters="clr-namespace:SourceGit.Views.Converters" + xmlns:converters="clr-namespace:SourceGit.Views.Converters" + xmlns:models="clr-namespace:SourceGit.Models" mc:Ignorable="d" d:DesignWidth="500"> @@ -81,13 +82,11 @@ diff --git a/src/Views/Popups/Pull.xaml.cs b/src/Views/Popups/Pull.xaml.cs index 95074c58..1e297871 100644 --- a/src/Views/Popups/Pull.xaml.cs +++ b/src/Views/Popups/Pull.xaml.cs @@ -42,8 +42,8 @@ namespace SourceGit.Views.Popups { var branch = cmbBranches.SelectedItem as Models.Branch; if (branch == null) return null; - var rebase = chkUseRebase.IsChecked == true; - var autoStash = chkAutoStash.IsChecked == true; + var rebase = Models.Preference.Instance.Window.UseRebaseOnPull; + var autoStash = Models.Preference.Instance.Window.UseAutoStashOnPull; return Task.Run(() => { Models.Watcher.SetEnabled(repo.Path, false);