From 005466e53b8d4a778957ac679edf965a7eaa6028 Mon Sep 17 00:00:00 2001 From: JanuarySnow <85711747+JanuarySnow@users.noreply.github.com> Date: Sun, 16 Jul 2023 22:24:02 +0100 Subject: [PATCH] Hide back button and settings button during install (#2368) * hide back button and settings button during install phase, so that user does not press back or settings( and then back to main screen again ) while a download thread still runs in th ebackground * updated changelog --------- Co-authored-by: Timothy Baldridge --- CHANGELOG.md | 1 + .../Views/Installers/InstallationView.xaml.cs | 5 +++++ Wabbajack.App.Wpf/Views/MainWindow.xaml.cs | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4620f168..1e7876a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ #### Version TBD * Fixed issues related to high RAM usage * The resumable downloads now reserve drive space to write to in advance instead of being managed in system RAM + * Fixed allowing back button during install which can result in multiple install processes * fixed search filter not applying when pressing back button and reaccessing gallery * Added more robust checking for protected location paths and subfolders for the launcher exe and install and download paths * Fixed readme double opening when modlist details are prepoulated diff --git a/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs b/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs index 9c35cf80..871ba5c0 100644 --- a/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs @@ -39,6 +39,11 @@ namespace Wabbajack .BindToStrict(this, view => view.BackButton.Command) .DisposeWith(disposables); + ViewModel.WhenAnyValue(vm => vm.InstallState) + .Select(v => v == InstallState.Installing ? Visibility.Collapsed : Visibility.Visible) + .BindToStrict(this, view => view.BackButton.Visibility) + .DisposeWith(disposables); + ViewModel.WhenAnyValue(vm => vm.OpenReadmeCommand) .BindToStrict(this, view => view.OpenReadmePreInstallButton.Command) .DisposeWith(disposables); diff --git a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs index 4cf49089..5bb1d787 100644 --- a/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs +++ b/Wabbajack.App.Wpf/Views/MainWindow.xaml.cs @@ -118,7 +118,12 @@ namespace Wabbajack ((MainWindowVM) DataContext).WhenAnyValue(vm => vm.OpenSettingsCommand) .BindTo(this, view => view.SettingsButton.Command); - + + ((MainWindowVM)DataContext).WhenAnyValue(vm => vm.Installer.InstallState) + .ObserveOn(RxApp.MainThreadScheduler) + .Select(v => v == InstallState.Installing ? Visibility.Collapsed : Visibility.Visible) + .BindTo(this, view => view.SettingsButton.Visibility); + } catch (Exception ex) {