mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 05:05:00 +00:00
feature<Dashboard>: add menu to unset upstream and cancel tracking when deleting related remote branches
This commit is contained in:
parent
f041adb2b3
commit
584bac74f9
5 changed files with 37 additions and 7 deletions
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue