mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Plugins - Fixed cancelling prerequisite installation
Plugins - Tweaked prerequisite installation popup size Account settings - Added personal access token management Workshop - Added plugin loading, installing and removal
This commit is contained in:
1 parent
21b8112de5
commit
f2c8de1746
33 files changed
+516
-113
No files matched your search
@@ -9,7 +9,6 @@ using Artemis.UI.Shared.Utilities;
|
||||
using Artemis.WebClient.Workshop;
|
||||
using Artemis.WebClient.Workshop.Handlers.InstallationHandlers;
|
||||
using Artemis.WebClient.Workshop.Models;
|
||||
using Artemis.WebClient.Workshop.Services;
|
||||
using Humanizer;
|
||||
using ReactiveUI;
|
||||
|
||||
@@ -29,11 +28,13 @@ public class EntryReleasesViewModel : ViewModelBase
|
||||
|
||||
Entry = entry;
|
||||
DownloadLatestRelease = ReactiveCommand.CreateFromTask(ExecuteDownloadLatestRelease);
|
||||
OnInstallationStarted = Confirm;
|
||||
}
|
||||
|
||||
public IGetEntryById_Entry Entry { get; }
|
||||
public ReactiveCommand<Unit, Unit> DownloadLatestRelease { get; }
|
||||
|
||||
public Func<IEntryDetails, Task<bool>> OnInstallationStarted { get; set; }
|
||||
public Func<InstalledEntry, Task>? OnInstallationFinished { get; set; }
|
||||
|
||||
private async Task ExecuteDownloadLatestRelease(CancellationToken cancellationToken)
|
||||
@@ -41,11 +42,7 @@ public class EntryReleasesViewModel : ViewModelBase
|
||||
if (Entry.LatestRelease == null)
|
||||
return;
|
||||
|
||||
bool confirm = await _windowService.ShowConfirmContentDialog(
|
||||
"Install latest release",
|
||||
$"Are you sure you want to download and install version {Entry.LatestRelease.Version} of {Entry.Name}?"
|
||||
);
|
||||
if (!confirm)
|
||||
if (await OnInstallationStarted(Entry))
|
||||
return;
|
||||
|
||||
IEntryInstallationHandler installationHandler = _factory.CreateHandler(Entry.EntryType);
|
||||
@@ -64,4 +61,14 @@ public class EntryReleasesViewModel : ViewModelBase
|
||||
.WithSeverity(NotificationSeverity.Error).Show();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<bool> Confirm(IEntryDetails entryDetails)
|
||||
{
|
||||
bool confirm = await _windowService.ShowConfirmContentDialog(
|
||||
"Install latest release",
|
||||
$"Are you sure you want to download and install version {entryDetails.LatestRelease?.Version} of {entryDetails.Name}?"
|
||||
);
|
||||
|
||||
return !confirm;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user