some background code for manager workspaces
This commit is contained in:
@@ -1,26 +1,30 @@
|
||||
using ModpackUpdater.Apps.Manager.Api.Model;
|
||||
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
||||
using ModpackUpdater.Apps.Manager.Api.Plugins.Features;
|
||||
using ModpackUpdater.Apps.Manager.LangRes;
|
||||
using Pilz.Plugins.Advanced;
|
||||
using Pilz.UI.Extensions;
|
||||
using Pilz.UI.Symbols;
|
||||
using Pilz.UI.Telerik.Dialogs;
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Features.Workspaces.GitLabRepo;
|
||||
|
||||
internal class GitLabRepoWorkspaceFeature : PluginFunction, IPluginFeatureProvider<GitLabRepoWorkspaceFeature>
|
||||
internal class GitLabRepoWorkspaceFeature : WorkspaceFeature, IPluginFeatureProvider<GitLabRepoWorkspaceFeature>
|
||||
{
|
||||
public static GitLabRepoWorkspaceFeature Instance { get; } = new();
|
||||
|
||||
public GitLabRepoWorkspaceFeature() : base(FeatureTypes.Workspace, "origin.gitlab", "GitLab repository")
|
||||
public GitLabRepoWorkspaceFeature() : base("origin.gitlab", "GitLab repository")
|
||||
{
|
||||
Icon = AppGlobals.Symbols.GetSvgImage(AppSymbols.github, Pilz.UI.Symbols.SymbolSize.Small);
|
||||
Icon = AppGlobals.Symbols.GetSvgImage(AppSymbols.gitlab, SymbolSize.Small);
|
||||
}
|
||||
|
||||
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
|
||||
protected override bool OnConfigure(ref IWorkspace workspace)
|
||||
{
|
||||
if (@params is not WorkspaceInitParameters p)
|
||||
return null;
|
||||
var settings = workspace?.Config as GitLabRepoWorkspaceConfig ?? new();
|
||||
|
||||
/// Open config UI
|
||||
/// ...
|
||||
if (RadDialogBase.ShowDialog(new GitLabRepoWorkspaceConfigEditor(settings), TitlesLangRes.GitLabRepoWorkspaceEditor, AppGlobals.Symbols.GetSvgImage(AppSymbols.gitlab, SymbolSize.Small)).Result.IsNotOk())
|
||||
return false;
|
||||
|
||||
return new GitLabRepoWorkspace();
|
||||
workspace = new GitLabRepoWorkspace(settings);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user