mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-24 10:50:52 +08:00
feature: supports to copy full commit message (#1521)
Co-authored-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -120,6 +120,7 @@
|
||||
<x:String x:Key="Text.CommitCM.CompareWithWorktree" xml:space="preserve">Compare with Worktree</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CopyAuthor" xml:space="preserve">Author</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CopyCommitter" xml:space="preserve">Committer</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CopyCommitMessage" xml:space="preserve">Message</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CopySHA" xml:space="preserve">SHA</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CopySubject" xml:space="preserve">Subject</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CustomAction" xml:space="preserve">Custom Action</x:String>
|
||||
|
||||
@@ -845,6 +845,17 @@ namespace SourceGit.ViewModels
|
||||
e.Handled = true;
|
||||
};
|
||||
|
||||
var copyFullInfo = new MenuItem();
|
||||
copyFullInfo.Header = App.Text("CommitCM.CopyCommitMessage");
|
||||
copyFullInfo.Icon = App.CreateMenuIcon("Icons.Info");
|
||||
copyFullInfo.Click += async (_, e) =>
|
||||
{
|
||||
var message = await new Commands.QueryCommitFullMessage(_repo.FullPath, commit.SHA).
|
||||
GetResultAsync().ConfigureAwait(false);
|
||||
await App.CopyTextAsync(message);
|
||||
e.Handled = true;
|
||||
};
|
||||
|
||||
var copyAuthor = new MenuItem();
|
||||
copyAuthor.Header = App.Text("CommitCM.CopyAuthor");
|
||||
copyAuthor.Icon = App.CreateMenuIcon("Icons.User");
|
||||
@@ -869,6 +880,7 @@ namespace SourceGit.ViewModels
|
||||
copy.Items.Add(copySHA);
|
||||
copy.Items.Add(copySubject);
|
||||
copy.Items.Add(copyInfo);
|
||||
copy.Items.Add(copyFullInfo);
|
||||
copy.Items.Add(copyAuthor);
|
||||
copy.Items.Add(copyCommitter);
|
||||
menu.Items.Add(copy);
|
||||
|
||||
Reference in New Issue
Block a user