mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
optimize<*>: FolderDailog 重名为 FolderDialog
This commit is contained in:
parent
23d3038c92
commit
b6a89334be
7 changed files with 17 additions and 17 deletions
|
@ -54,7 +54,7 @@ namespace SourceGit.UI {
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void SelectParentFolder(object sender, RoutedEventArgs e) {
|
private void SelectParentFolder(object sender, RoutedEventArgs e) {
|
||||||
FolderDailog.Open(App.Text("Clone.RemoteFolder.Placeholder"), path => {
|
FolderDialog.Open(App.Text("Clone.RemoteFolder.Placeholder"), path => {
|
||||||
txtParentFolder.Text = path;
|
txtParentFolder.Text = path;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -336,7 +336,7 @@ namespace SourceGit.UI {
|
||||||
MenuItem saveAs = new MenuItem();
|
MenuItem saveAs = new MenuItem();
|
||||||
saveAs.Header = App.Text("SaveAs");
|
saveAs.Header = App.Text("SaveAs");
|
||||||
saveAs.Click += (obj, ev) => {
|
saveAs.Click += (obj, ev) => {
|
||||||
FolderDailog.Open(App.Text("SaveFileTo"), saveTo => {
|
FolderDialog.Open(App.Text("SaveFileTo"), saveTo => {
|
||||||
var savePath = Path.Combine(saveTo, Path.GetFileName(path));
|
var savePath = Path.Combine(saveTo, Path.GetFileName(path));
|
||||||
commit.SaveFileTo(repo, path, savePath);
|
commit.SaveFileTo(repo, path, savePath);
|
||||||
});
|
});
|
||||||
|
@ -657,7 +657,7 @@ namespace SourceGit.UI {
|
||||||
saveAs.Header = App.Text("SaveAs");
|
saveAs.Header = App.Text("SaveAs");
|
||||||
saveAs.IsEnabled = node.CommitObject == null || node.CommitObject.Kind == Git.Commit.Object.Type.Blob;
|
saveAs.IsEnabled = node.CommitObject == null || node.CommitObject.Kind == Git.Commit.Object.Type.Blob;
|
||||||
saveAs.Click += (obj, ev) => {
|
saveAs.Click += (obj, ev) => {
|
||||||
FolderDailog.Open(App.Text("SaveFileTo"), saveTo => {
|
FolderDialog.Open(App.Text("SaveFileTo"), saveTo => {
|
||||||
var path = Path.Combine(saveTo, node.Name);
|
var path = Path.Combine(saveTo, node.Name);
|
||||||
commit.SaveFileTo(repo, node.FilePath, path);
|
commit.SaveFileTo(repo, node.FilePath, path);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<Window x:Class="SourceGit.UI.FolderDailog"
|
<Window x:Class="SourceGit.UI.FolderDialog"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
@ -9,9 +9,9 @@ using System.Windows.Input;
|
||||||
namespace SourceGit.UI {
|
namespace SourceGit.UI {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for FolderDailog.xaml
|
/// Interaction logic for FolderDialog.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class FolderDailog : Window {
|
public partial class FolderDialog : Window {
|
||||||
private Action<string> cb = null;
|
private Action<string> cb = null;
|
||||||
private Node root = new Node("", "");
|
private Node root = new Node("", "");
|
||||||
private Node selected = null;
|
private Node selected = null;
|
||||||
|
@ -93,7 +93,7 @@ namespace SourceGit.UI {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="title"></param>
|
/// <param name="title"></param>
|
||||||
/// <param name="cb"></param>
|
/// <param name="cb"></param>
|
||||||
public FolderDailog(string title, Action<string> onOK) {
|
public FolderDialog(string title, Action<string> onOK) {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
// Move to center.
|
// Move to center.
|
||||||
|
@ -120,7 +120,7 @@ namespace SourceGit.UI {
|
||||||
/// <param name="title"></param>
|
/// <param name="title"></param>
|
||||||
/// <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 FolderDialog(title, onOK).Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -130,7 +130,7 @@ namespace SourceGit.UI {
|
||||||
/// <param name="onOK"></param>
|
/// <param name="onOK"></param>
|
||||||
public static void Show(string title, Action<string> onOK)
|
public static void Show(string title, Action<string> onOK)
|
||||||
{
|
{
|
||||||
new FolderDailog(title, onOK).Show();
|
new FolderDialog(title, onOK).Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -140,7 +140,7 @@ namespace SourceGit.UI {
|
||||||
/// <param name="onOK"></param>
|
/// <param name="onOK"></param>
|
||||||
public static void ShowDialog(string title, Action<string> onOK)
|
public static void ShowDialog(string title, Action<string> onOK)
|
||||||
{
|
{
|
||||||
new FolderDailog(title, onOK).ShowDialog();
|
new FolderDialog(title, onOK).ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -515,7 +515,7 @@ namespace SourceGit.UI {
|
||||||
var patch = new MenuItem();
|
var patch = new MenuItem();
|
||||||
patch.Header = App.Text("CommitCM.SaveAsPatch");
|
patch.Header = App.Text("CommitCM.SaveAsPatch");
|
||||||
patch.Click += (o, e) => {
|
patch.Click += (o, e) => {
|
||||||
FolderDailog.Open("Save patch to ...", saveTo => {
|
FolderDialog.Open("Save patch to ...", saveTo => {
|
||||||
Repo.RunCommand($"format-patch {commit.SHA} -1 -o \"{saveTo}\"", null);
|
Repo.RunCommand($"format-patch {commit.SHA} -1 -o \"{saveTo}\"", null);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -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.ShowDialog(App.Text("NewPage.OpenOrInitDialog"), path => {
|
FolderDialog.ShowDialog(App.Text("NewPage.OpenOrInitDialog"), path => {
|
||||||
CheckAndOpenRepo(path);
|
CheckAndOpenRepo(path);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,7 @@ namespace SourceGit.UI {
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void SelectDefaultClonePath(object sender, RoutedEventArgs e) {
|
private void SelectDefaultClonePath(object sender, RoutedEventArgs e) {
|
||||||
FolderDailog.Open(App.Text("Preference.Dialog.GitDir"), path => {
|
FolderDialog.Open(App.Text("Preference.Dialog.GitDir"), path => {
|
||||||
txtGitCloneDir.Text = path;
|
txtGitCloneDir.Text = path;
|
||||||
App.Setting.Tools.GitDefaultCloneDir = path;
|
App.Setting.Tools.GitDefaultCloneDir = path;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue