enhance: simpfy the way to lock a worktree

This commit is contained in:
leo 2024-06-27 19:19:21 +08:00
parent 8a8aabede3
commit fa2c7c0e18
No known key found for this signature in database
10 changed files with 25 additions and 125 deletions

View file

@ -1731,8 +1731,11 @@ namespace SourceGit.ViewModels
loc.Icon = App.CreateMenuIcon("Icons.Lock");
loc.Click += (o, ev) =>
{
if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new LockWorktree(this, worktree));
SetWatcherEnabled(false);
var succ = new Commands.Worktree(_fullpath).Lock(worktree.FullPath);
if (succ)
worktree.IsLocked = true;
SetWatcherEnabled(true);
ev.Handled = true;
};
menu.Items.Add(loc);