mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
optimize(*): move App.Launcher.GetPopupManager to App.GetPopupManager
This commit is contained in:
parent
3c24eaa6a7
commit
5066b974a1
34 changed files with 126 additions and 133 deletions
|
@ -29,7 +29,7 @@ namespace SourceGit.UI {
|
|||
/// <param name="repo"></param>
|
||||
/// <param name="prefer"></param>
|
||||
public static void Show(Git.Repository repo, Git.Branch prefer = null) {
|
||||
var popup = App.Launcher.GetPopupManager(repo);
|
||||
var popup = App.GetPopupManager(repo);
|
||||
popup?.Show(new Push(repo, prefer));
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace SourceGit.UI {
|
|||
}
|
||||
|
||||
var push = new Push(repo, current);
|
||||
var popup = App.Launcher.GetPopupManager(repo);
|
||||
var popup = App.GetPopupManager(repo);
|
||||
popup?.Show(push);
|
||||
popup?.Lock();
|
||||
|
||||
|
@ -91,14 +91,14 @@ namespace SourceGit.UI {
|
|||
var remoteBranch = combRemoteBranches.SelectedItem as string;
|
||||
var track = string.IsNullOrEmpty(localBranch.Upstream);
|
||||
var tags = chkTags.IsChecked == true;
|
||||
var force = chkForce.IsChecked == true;
|
||||
var force = chkForce.IsChecked == true;
|
||||
|
||||
remoteBranch = remoteBranch.Substring($"{remote}/".Length);
|
||||
if (remoteBranch.Contains(" (new)")) {
|
||||
remoteBranch = remoteBranch.Substring(0, remoteBranch.Length - 6);
|
||||
}
|
||||
|
||||
var popup = App.Launcher.GetPopupManager(repo);
|
||||
var popup = App.GetPopupManager(repo);
|
||||
popup?.Lock();
|
||||
await Task.Run(() => repo.Push(remote, localBranch.Name, remoteBranch, msg => popup?.UpdateStatus(msg), tags, track, force));
|
||||
popup?.Close(true);
|
||||
|
@ -110,7 +110,7 @@ namespace SourceGit.UI {
|
|||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Cancel(object sender, RoutedEventArgs e) {
|
||||
App.Launcher.GetPopupManager(repo)?.Close();
|
||||
App.GetPopupManager(repo)?.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue