mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix install failure UI elements
This commit is contained in:
parent
7b5b483303
commit
88610cd7db
@ -164,6 +164,11 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM
|
||||
UIUtils.OpenFolder(_configuration.LogLocation);
|
||||
});
|
||||
|
||||
CloseWhenCompleteCommand = ReactiveCommand.Create(() =>
|
||||
{
|
||||
Environment.Exit(0);
|
||||
});
|
||||
|
||||
GoToInstallCommand = ReactiveCommand.Create(() =>
|
||||
{
|
||||
UIUtils.OpenFolder(Installer.Location.TargetPath);
|
||||
@ -267,16 +272,25 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM
|
||||
|
||||
TaskBarUpdate.Send(update.StatusText, TaskbarItemProgressState.Indeterminate, update.StepsProgress.Value);
|
||||
};
|
||||
await installer.Begin(CancellationToken.None);
|
||||
|
||||
TaskBarUpdate.Send($"Finished install of {ModList.Name}", TaskbarItemProgressState.Normal);
|
||||
|
||||
InstallState = InstallState.Success;
|
||||
if (!await installer.Begin(CancellationToken.None))
|
||||
{
|
||||
TaskBarUpdate.Send($"Error during install of {ModList.Name}", TaskbarItemProgressState.Error);
|
||||
InstallState = InstallState.Failure;
|
||||
StatusText = $"Error during install of {ModList.Name}";
|
||||
StatusProgress = Percent.Zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
TaskBarUpdate.Send($"Finished install of {ModList.Name}", TaskbarItemProgressState.Normal);
|
||||
InstallState = InstallState.Success;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TaskBarUpdate.Send($"Error during install of {ModList.Name}", TaskbarItemProgressState.Error);
|
||||
InstallState = InstallState.Failure;
|
||||
StatusText = $"Error during install of {ModList.Name}";
|
||||
StatusProgress = Percent.Zero;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4"
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5"
|
||||
x:Name="TitleText"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Bottom"
|
||||
|
@ -31,7 +31,7 @@ namespace Wabbajack
|
||||
.DisposeWith(disposables);
|
||||
|
||||
ViewModel.WhenAnyValue(vm => vm.InstallState)
|
||||
.Select(es => es == InstallState.Success ? Visibility.Visible : Visibility.Collapsed)
|
||||
.Select(es => es is InstallState.Success or InstallState.Failure ? Visibility.Visible : Visibility.Collapsed)
|
||||
.BindToStrict(this, view => view.InstallComplete.Visibility)
|
||||
.DisposeWith(disposables);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user