feature(*): supports multi-repo editing

This commit is contained in:
leo 2020-08-03 16:23:00 +08:00
parent 3c80f2700c
commit 81a3cb9566
41 changed files with 666 additions and 450 deletions

View file

@ -34,7 +34,8 @@ namespace SourceGit.UI {
/// </summary>
/// <param name="repo"></param>
public static void Show(Git.Repository repo) {
PopupManager.Show(new AddSubmodule(repo));
var popup = App.Launcher.GetPopupManager(repo);
popup?.Show(new AddSubmodule(repo));
}
#region EVENTS
@ -57,14 +58,17 @@ namespace SourceGit.UI {
if (Validation.GetHasError(txtPath)) return;
var recursive = chkRecursive.IsChecked == true;
var popup = App.Launcher.GetPopupManager(repo);
PopupManager.Lock();
await Task.Run(() => repo.AddSubmodule(RepoURL, LocalPath, recursive, PopupManager.UpdateStatus));
PopupManager.Close(true);
popup?.Lock();
await Task.Run(() => repo.AddSubmodule(RepoURL, LocalPath, recursive, msg => {
popup?.UpdateStatus(msg);
}));
popup?.Close(true);
}
private void Cancel(object sender, RoutedEventArgs e) {
PopupManager.Close();
App.Launcher.GetPopupManager(repo)?.Close();
}
#endregion
}