optimize<FoldDialog, NewPage>: 修改欢迎页的打开本地仓库的弹出窗口为模态窗口

This commit is contained in:
ZCShou 2021-02-03 16:26:32 +08:00
parent 3c624009f6
commit 23d3038c92
2 changed files with 22 additions and 1 deletions

View file

@ -121,8 +121,29 @@ namespace SourceGit.UI {
/// <param name="onOK"></param> /// <param name="onOK"></param>
public static void Open(string title, Action<string> onOK) { public static void Open(string title, Action<string> onOK) {
new FolderDailog(title, onOK).Show(); new FolderDailog(title, onOK).Show();
}
/// <summary>
/// modeless.
/// </summary>
/// <param name="title"></param>
/// <param name="onOK"></param>
public static void Show(string title, Action<string> onOK)
{
new FolderDailog(title, onOK).Show();
} }
/// <summary>
/// modal.
/// </summary>
/// <param name="title"></param>
/// <param name="onOK"></param>
public static void ShowDialog(string title, Action<string> onOK)
{
new FolderDailog(title, onOK).ShowDialog();
}
#region EVENTS #region EVENTS
private void OnSure(object sender, RoutedEventArgs e) { private void OnSure(object sender, RoutedEventArgs e) {
if (selected != null) cb?.Invoke(selected.Path); if (selected != null) cb?.Invoke(selected.Path);

View file

@ -42,7 +42,7 @@ namespace SourceGit.UI {
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void OpenOrAddRepo(object sender, RoutedEventArgs e) { private void OpenOrAddRepo(object sender, RoutedEventArgs e) {
FolderDailog.Open(App.Text("NewPage.OpenOrInitDialog"), path => { FolderDailog.ShowDialog(App.Text("NewPage.OpenOrInitDialog"), path => {
CheckAndOpenRepo(path); CheckAndOpenRepo(path);
}); });
} }