mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
feature: supports custom actions (#638)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
7c5de7e48c
commit
a36058ec51
17 changed files with 478 additions and 2 deletions
|
@ -127,6 +127,17 @@ namespace SourceGit.ViewModels
|
|||
set => _repo.Settings.PreferedOpenAIService = value;
|
||||
}
|
||||
|
||||
public AvaloniaList<Models.CustomAction> CustomActions
|
||||
{
|
||||
get => _repo.Settings.CustomActions;
|
||||
}
|
||||
|
||||
public Models.CustomAction SelectedCustomAction
|
||||
{
|
||||
get => _selectedCustomAction;
|
||||
set => SetProperty(ref _selectedCustomAction, value);
|
||||
}
|
||||
|
||||
public RepositoryConfigure(Repository repo)
|
||||
{
|
||||
_repo = repo;
|
||||
|
@ -233,11 +244,21 @@ namespace SourceGit.ViewModels
|
|||
|
||||
public void RemoveSelectedIssueTracker()
|
||||
{
|
||||
if (_selectedIssueTrackerRule != null)
|
||||
_repo.Settings.RemoveIssueTracker(_selectedIssueTrackerRule);
|
||||
_repo.Settings.RemoveIssueTracker(_selectedIssueTrackerRule);
|
||||
SelectedIssueTrackerRule = null;
|
||||
}
|
||||
|
||||
public void AddNewCustomAction()
|
||||
{
|
||||
SelectedCustomAction = _repo.Settings.AddNewCustomAction();
|
||||
}
|
||||
|
||||
public void RemoveSelectedCustomAction()
|
||||
{
|
||||
_repo.Settings.RemoveCustomAction(_selectedCustomAction);
|
||||
SelectedCustomAction = null;
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
SetIfChanged("user.name", UserName, "");
|
||||
|
@ -271,5 +292,6 @@ namespace SourceGit.ViewModels
|
|||
private string _httpProxy;
|
||||
private Models.CommitTemplate _selectedCommitTemplate = null;
|
||||
private Models.IssueTrackerRule _selectedIssueTrackerRule = null;
|
||||
private Models.CustomAction _selectedCustomAction = null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue