feature: supports custom actions (#638)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2024-11-01 17:23:31 +08:00
parent 7c5de7e48c
commit a36058ec51
No known key found for this signature in database
17 changed files with 478 additions and 2 deletions

View file

@ -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;
}
}