feature<Dashboard>: add menu to unset upstream and cancel tracking when deleting related remote branches

This commit is contained in:
Jai 2021-09-07 09:36:06 +08:00
parent f041adb2b3
commit 584bac74f9
5 changed files with 37 additions and 7 deletions

View file

@ -1,3 +1,4 @@
using System;
using System.Threading.Tasks;
namespace SourceGit.Views.Popups {
@ -8,6 +9,7 @@ namespace SourceGit.Views.Popups {
private string repo = null;
private string branch = null;
private string remote = null;
private Action finishHandler = null;
public DeleteBranch(string repo, string branch, string remote = null) {
this.repo = repo;
@ -20,6 +22,11 @@ namespace SourceGit.Views.Popups {
else txtTarget.Text = $"{remote}/{branch}";
}
public DeleteBranch Then(Action handler) {
this.finishHandler = handler;
return this;
}
public override string GetTitle() {
return App.Text("DeleteBranch");
}
@ -41,7 +48,8 @@ namespace SourceGit.Views.Popups {
if (exists != null && exists.Filters.Contains(full)) {
exists.Filters.Remove(full);
}
finishHandler?.Invoke();
Models.Watcher.SetEnabled(repo, true);
return true;
});