refactor: add a popup panel to show submodule updating status

This commit is contained in:
leo 2024-06-04 11:36:00 +08:00
parent 069c78f213
commit d0edc09b2e
8 changed files with 71 additions and 9 deletions

View file

@ -0,0 +1,28 @@
using System.Threading.Tasks;
namespace SourceGit.ViewModels
{
public class UpdateSubmodules : Popup
{
public UpdateSubmodules(Repository repo)
{
_repo = repo;
View = new Views.UpdateSubmodules() { DataContext = this };
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = "Updating submodules ...";
return Task.Run(() =>
{
new Commands.Submodule(_repo.FullPath).Update(SetProgressDescription);
CallUIThread(() => _repo.SetWatcherEnabled(true));
return true;
});
}
private readonly Repository _repo = null;
}
}