mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
feature: add global configuration for custom action (#1077)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
0f9087fac6
commit
5c279b4b56
6 changed files with 182 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue