mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
refactor: add a popup panel to show submodule updating status
This commit is contained in:
parent
069c78f213
commit
d0edc09b2e
8 changed files with 71 additions and 9 deletions
28
src/ViewModels/UpdateSubmodules.cs
Normal file
28
src/ViewModels/UpdateSubmodules.cs
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue