feature: add global configuration for custom action (#1077)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-03-10 21:19:38 +08:00
parent 0f9087fac6
commit 5c279b4b56
No known key found for this signature in database
6 changed files with 182 additions and 6 deletions

View file

@ -1444,6 +1444,12 @@ namespace SourceGit.ViewModels
public ContextMenu CreateContextMenuForCustomAction()
{
var actions = new List<Models.CustomAction>();
foreach (var action in Preferences.Instance.CustomActions)
{
if (action.Scope == Models.CustomActionScope.Repository)
actions.Add(action);
}
foreach (var action in _settings.CustomActions)
{
if (action.Scope == Models.CustomActionScope.Repository)
@ -2350,6 +2356,12 @@ namespace SourceGit.ViewModels
private void TryToAddCustomActionsToBranchContextMenu(ContextMenu menu, Models.Branch branch)
{
var actions = new List<Models.CustomAction>();
foreach (var action in Preferences.Instance.CustomActions)
{
if (action.Scope == Models.CustomActionScope.Branch)
actions.Add(action);
}
foreach (var action in Settings.CustomActions)
{
if (action.Scope == Models.CustomActionScope.Branch)