mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 20:54:59 +00:00
refactor(PopupManager): rewrite popup
This commit is contained in:
parent
28e3a1bb27
commit
7558bbd4f2
34 changed files with 183 additions and 221 deletions
|
@ -8,34 +8,27 @@ namespace SourceGit.UI {
|
|||
/// `git init` confirm panel.
|
||||
/// </summary>
|
||||
public partial class Init : UserControl {
|
||||
private PopupManager popup = null;
|
||||
private string workingDir = null;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor.
|
||||
/// </summary>
|
||||
/// <param name="mgr"></param>
|
||||
/// <param name="path"></param>
|
||||
public Init(string path) {
|
||||
public Init(PopupManager mgr, string path) {
|
||||
popup = mgr;
|
||||
workingDir = path;
|
||||
InitializeComponent();
|
||||
txtPath.Content = path;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show this dialog.
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
public static void Show(string path) {
|
||||
var popup = App.GetPopupManager(null);
|
||||
popup.Show(new Init(path));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Do `git init`
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private async void Sure(object sender, RoutedEventArgs e) {
|
||||
var popup = App.GetPopupManager(null);
|
||||
popup.Lock();
|
||||
|
||||
await Task.Run(() => {
|
||||
|
@ -59,7 +52,7 @@ namespace SourceGit.UI {
|
|||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Cancel(object sender, RoutedEventArgs e) {
|
||||
App.GetPopupManager(null).Close();
|
||||
popup.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue