From b6a89334be5878542f9cfcd353c8ea4b01fd556a Mon Sep 17 00:00:00 2001 From: ZCShou <72115@163.com> Date: Wed, 3 Feb 2021 16:31:33 +0800 Subject: [PATCH] =?UTF-8?q?optimize<*>:=20FolderDailog=20=E9=87=8D?= =?UTF-8?q?=E5=90=8D=E4=B8=BA=20FolderDialog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UI/Clone.xaml.cs | 2 +- src/UI/CommitViewer.xaml.cs | 4 ++-- .../{FolderDailog.xaml => FolderDialog.xaml} | 2 +- ...derDailog.xaml.cs => FolderDialog.xaml.cs} | 20 +++++++++---------- src/UI/Histories.xaml.cs | 2 +- src/UI/NewPage.xaml.cs | 2 +- src/UI/SettingDialog.xaml.cs | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) rename src/UI/{FolderDailog.xaml => FolderDialog.xaml} (99%) rename src/UI/{FolderDailog.xaml.cs => FolderDialog.xaml.cs} (94%) diff --git a/src/UI/Clone.xaml.cs b/src/UI/Clone.xaml.cs index 33f8c069..c8b0540d 100644 --- a/src/UI/Clone.xaml.cs +++ b/src/UI/Clone.xaml.cs @@ -54,7 +54,7 @@ namespace SourceGit.UI { /// /// 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; }); } diff --git a/src/UI/CommitViewer.xaml.cs b/src/UI/CommitViewer.xaml.cs index 5fadc7d0..930c65b0 100644 --- a/src/UI/CommitViewer.xaml.cs +++ b/src/UI/CommitViewer.xaml.cs @@ -336,7 +336,7 @@ namespace SourceGit.UI { MenuItem saveAs = new MenuItem(); saveAs.Header = App.Text("SaveAs"); saveAs.Click += (obj, ev) => { - FolderDailog.Open(App.Text("SaveFileTo"), saveTo => { + FolderDialog.Open(App.Text("SaveFileTo"), saveTo => { var savePath = Path.Combine(saveTo, Path.GetFileName(path)); commit.SaveFileTo(repo, path, savePath); }); @@ -657,7 +657,7 @@ namespace SourceGit.UI { saveAs.Header = App.Text("SaveAs"); saveAs.IsEnabled = node.CommitObject == null || node.CommitObject.Kind == Git.Commit.Object.Type.Blob; saveAs.Click += (obj, ev) => { - FolderDailog.Open(App.Text("SaveFileTo"), saveTo => { + FolderDialog.Open(App.Text("SaveFileTo"), saveTo => { var path = Path.Combine(saveTo, node.Name); commit.SaveFileTo(repo, node.FilePath, path); }); diff --git a/src/UI/FolderDailog.xaml b/src/UI/FolderDialog.xaml similarity index 99% rename from src/UI/FolderDailog.xaml rename to src/UI/FolderDialog.xaml index 221c8ade..e5062556 100644 --- a/src/UI/FolderDailog.xaml +++ b/src/UI/FolderDialog.xaml @@ -1,4 +1,4 @@ - - /// Interaction logic for FolderDailog.xaml + /// Interaction logic for FolderDialog.xaml /// - public partial class FolderDailog : Window { + public partial class FolderDialog : Window { private Action cb = null; private Node root = new Node("", ""); private Node selected = null; @@ -93,7 +93,7 @@ namespace SourceGit.UI { /// /// /// - public FolderDailog(string title, Action onOK) { + public FolderDialog(string title, Action onOK) { InitializeComponent(); // Move to center. @@ -120,17 +120,17 @@ namespace SourceGit.UI { /// /// public static void Open(string title, Action onOK) { - new FolderDailog(title, onOK).Show(); - } - + new FolderDialog(title, onOK).Show(); + } + /// /// modeless. /// /// /// - public static void Show(string title, Action onOK) + public static void Show(string title, Action onOK) { - new FolderDailog(title, onOK).Show(); + new FolderDialog(title, onOK).Show(); } /// @@ -138,9 +138,9 @@ namespace SourceGit.UI { /// /// /// - public static void ShowDialog(string title, Action onOK) + public static void ShowDialog(string title, Action onOK) { - new FolderDailog(title, onOK).ShowDialog(); + new FolderDialog(title, onOK).ShowDialog(); } diff --git a/src/UI/Histories.xaml.cs b/src/UI/Histories.xaml.cs index 4114677c..c96c47a3 100644 --- a/src/UI/Histories.xaml.cs +++ b/src/UI/Histories.xaml.cs @@ -515,7 +515,7 @@ namespace SourceGit.UI { var patch = new MenuItem(); patch.Header = App.Text("CommitCM.SaveAsPatch"); 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); }); }; diff --git a/src/UI/NewPage.xaml.cs b/src/UI/NewPage.xaml.cs index e52713a2..c90bff38 100644 --- a/src/UI/NewPage.xaml.cs +++ b/src/UI/NewPage.xaml.cs @@ -42,7 +42,7 @@ namespace SourceGit.UI { /// /// private void OpenOrAddRepo(object sender, RoutedEventArgs e) { - FolderDailog.ShowDialog(App.Text("NewPage.OpenOrInitDialog"), path => { + FolderDialog.ShowDialog(App.Text("NewPage.OpenOrInitDialog"), path => { CheckAndOpenRepo(path); }); } diff --git a/src/UI/SettingDialog.xaml.cs b/src/UI/SettingDialog.xaml.cs index a2a244a5..edf551a3 100644 --- a/src/UI/SettingDialog.xaml.cs +++ b/src/UI/SettingDialog.xaml.cs @@ -151,7 +151,7 @@ namespace SourceGit.UI { /// /// 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; App.Setting.Tools.GitDefaultCloneDir = path; });