feature: remember the Include Untracked Files toggle state in local changes

This commit is contained in:
leo 2024-12-18 17:30:04 +08:00
parent 5ec8279d38
commit 31ad317a57
No known key found for this signature in database
2 changed files with 13 additions and 4 deletions

View file

@ -14,6 +14,12 @@ namespace SourceGit.Models
set;
} = string.Empty;
public bool IncludeUntrackedInLocalChanges
{
get;
set;
} = true;
public DealWithLocalChanges DealWithLocalChangesOnCheckoutBranch
{
get;

View file

@ -206,11 +206,15 @@ namespace SourceGit.ViewModels
public bool IncludeUntracked
{
get => _includeUntracked;
get => _settings.IncludeUntrackedInLocalChanges;
set
{
if (SetProperty(ref _includeUntracked, value))
if (value != _settings.IncludeUntrackedInLocalChanges)
{
_settings.IncludeUntrackedInLocalChanges = value;
OnPropertyChanged();
Task.Run(RefreshWorkingCopyChanges);
}
}
}
@ -918,7 +922,7 @@ namespace SourceGit.ViewModels
public void RefreshWorkingCopyChanges()
{
var changes = new Commands.QueryLocalChanges(_fullpath, _includeUntracked).Result();
var changes = new Commands.QueryLocalChanges(_fullpath, _settings.IncludeUntrackedInLocalChanges).Result();
if (_workingCopy == null)
return;
@ -2299,7 +2303,6 @@ namespace SourceGit.ViewModels
private List<Models.Submodule> _submodules = new List<Models.Submodule>();
private List<Models.Submodule> _visibleSubmodules = new List<Models.Submodule>();
private bool _includeUntracked = true;
private Models.Commit _searchResultSelectedCommit = null;
private Timer _autoFetchTimer = null;
private DateTime _lastFetchTime = DateTime.MinValue;