From 28e7e1f01a654686f34f6a09176d10428acd9c2b Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Tue, 12 Jul 2022 22:51:12 -0600 Subject: [PATCH] Implement compile complete view, hook up buttons and error alerts --- .../Compilers/CompilationCompleteView.xaml | 3 +- .../Views/Compilers/CompilerView.xaml.cs | 29 +++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/Wabbajack.App.Wpf/Views/Compilers/CompilationCompleteView.xaml b/Wabbajack.App.Wpf/Views/Compilers/CompilationCompleteView.xaml index 57fc7589..0a1df3fd 100644 --- a/Wabbajack.App.Wpf/Views/Compilers/CompilationCompleteView.xaml +++ b/Wabbajack.App.Wpf/Views/Compilers/CompilationCompleteView.xaml @@ -75,7 +75,8 @@ + HorizontalAlignment="Center" + Text="Output Folder"/> { + ViewModel.WhenAny(vm => vm.State) + .Select(x => x == CompilerState.Errored) + .BindToStrict(this, x => x.CompilationComplete.AttentionBorder.Failure) + .DisposeWith(disposables); + + ViewModel.WhenAny(vm => vm.State) + .Select(x => x == CompilerState.Errored) + .Select(failed => $"Installation {(failed ? "Failed" : "Complete")}") + .BindToStrict(this, x => x.CompilationComplete.TitleText.Text) + .DisposeWith(disposables); + + CompilationComplete.GoToModlistButton.Command = ReactiveCommand.Create(() => + { + UIUtils.OpenFolder(ViewModel.OutputLocation.TargetPath.Parent); + }).DisposeWith(disposables); + + ViewModel.WhenAnyValue(vm => vm.BackCommand) + .BindToStrict(this, view => view.CompilationComplete.BackButton.Command) + .DisposeWith(disposables); + + CompilationComplete.CloseWhenCompletedButton.Command = ReactiveCommand.Create(() => + { + Environment.Exit(0); + }).DisposeWith(disposables); ViewModel.WhenAnyValue(vm => vm.ExecuteCommand) @@ -56,7 +81,7 @@ namespace Wabbajack .Select(v => v == CompilerState.Completed ? Visibility.Visible : Visibility.Collapsed) .BindToStrict(this, view => view.CompilationComplete.Visibility) .DisposeWith(disposables); - + ViewModel.WhenAnyValue(vm => vm.ModlistLocation) .BindToStrict(this, view => view.CompilerConfigView.ModListLocation.PickerVM) .DisposeWith(disposables);