update
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
using ModpackUpdater.Apps.Manager.Api.Plugins.Features;
|
||||
using ModpackUpdater.Apps.Manager.LangRes;
|
||||
using Pilz.Features;
|
||||
using Pilz.UI.Symbols;
|
||||
using Pilz.UI.WinForms.Extensions;
|
||||
using Pilz.UI.WinForms.Telerik.Dialogs;
|
||||
using Pilz.UI.AvaloniaUI.Dialogs;
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Features.Workspaces.GitLabRepo;
|
||||
|
||||
@@ -14,26 +12,26 @@ internal class GitLabRepoWorkspaceFeature : WorkspaceFeature, IPluginFeatureProv
|
||||
|
||||
public GitLabRepoWorkspaceFeature() : base("origin.gitlab", FeatureNamesLangRes.GitLabWorkspace)
|
||||
{
|
||||
Icon = AppGlobals.Symbols.GetSvgImage(AppSymbols.gitlab, SymbolSize.Small);
|
||||
Icon = AppGlobals.Symbols.GetImageSource(AppSymbols.gitlab);
|
||||
}
|
||||
|
||||
protected override bool OnConfigure(ref IWorkspace? workspace)
|
||||
protected override async Task OnConfigure(WorkspaceContext context)
|
||||
{
|
||||
var settings = workspace?.Config as GitLabRepoWorkspaceConfig ?? new();
|
||||
var settings = context.Workspace?.Config as GitLabRepoWorkspaceConfig ?? new();
|
||||
|
||||
if (RadDialogBase.ShowDialog(new GitLabRepoWorkspaceConfigEditor(settings), TitlesLangRes.GitLabRepoWorkspaceEditor, AppGlobals.Symbols.GetSvgImage(AppSymbols.gitlab, SymbolSize.Small)).Result.IsNotOk())
|
||||
return false;
|
||||
|
||||
workspace = new GitLabRepoWorkspace(settings);
|
||||
|
||||
return true;
|
||||
if ((await AvaloniaFlyoutBase.Show(
|
||||
new GitLabRepoWorkspaceConfigEditorView((GitLabRepoWorkspaceConfig)settings.Clone()),
|
||||
context.MainApi.MainWindow,
|
||||
TitlesLangRes.GitLabRepoWorkspaceEditor,
|
||||
AppGlobals.Symbols.GetImageSource(AppSymbols.gitlab)))
|
||||
.Result is GitLabRepoWorkspaceConfig settingsNew)
|
||||
context.Workspace = new GitLabRepoWorkspace(settingsNew);
|
||||
}
|
||||
|
||||
protected override void OnCreate(out IWorkspace workspace, WorkspaceConfig config)
|
||||
{
|
||||
if (config is not GitLabRepoWorkspaceConfig gitlabConfig)
|
||||
throw new NotImplementedException($"Only configs of type {typeof(GitLabRepoWorkspaceConfig).Name} are allowed.");
|
||||
|
||||
throw new NotImplementedException($"Only configs of type {nameof(GitLabRepoWorkspaceConfig)} are allowed.");
|
||||
workspace = new GitLabRepoWorkspace(gitlabConfig);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user