From 313890e52663d79d19eea2b362500f3ddf11a2fd Mon Sep 17 00:00:00 2001 From: Justin Swanson <justin.c.swanson@gmail.com> Date: Thu, 31 Oct 2019 21:57:49 -0500 Subject: [PATCH] Modlist website button added to installer view --- Wabbajack/View Models/InstallerVM.cs | 6 ++++++ Wabbajack/View Models/SlideShow.cs | 5 ----- Wabbajack/Views/InstallationView.xaml | 13 ++++++++++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Wabbajack/View Models/InstallerVM.cs b/Wabbajack/View Models/InstallerVM.cs index c574ccfd..cbb59d0a 100644 --- a/Wabbajack/View Models/InstallerVM.cs +++ b/Wabbajack/View Models/InstallerVM.cs @@ -93,6 +93,7 @@ namespace Wabbajack public IReactiveCommand BeginCommand { get; } public IReactiveCommand ShowReportCommand { get; } public IReactiveCommand OpenReadmeCommand { get; } + public IReactiveCommand VisitWebsiteCommand { get; } public InstallerVM(MainWindowVM mainWindowVM) { @@ -250,6 +251,11 @@ namespace Wabbajack canExecute: this.WhenAny(x => x.Installing) .Select(installing => !installing) .ObserveOnGuiThread()); + this.VisitWebsiteCommand = ReactiveCommand.Create( + execute: () => Process.Start(this.ModList.Website), + canExecute: this.WhenAny(x => x.ModList.Website) + .Select(x => x?.StartsWith("https://") ?? false) + .ObserveOnGuiThread()); // Have Installation location updates modify the downloads location if empty this.WhenAny(x => x.Location) diff --git a/Wabbajack/View Models/SlideShow.cs b/Wabbajack/View Models/SlideShow.cs index 2aaf7d46..12196fc4 100644 --- a/Wabbajack/View Models/SlideShow.cs +++ b/Wabbajack/View Models/SlideShow.cs @@ -83,11 +83,6 @@ namespace Wabbajack .ObserveOnGuiThread() .Do(modList => { - this.NexusSiteURL = modList.Website; - this.ModName = modList.Name; - this.AuthorName = modList.Author; - this.Summary = modList.Description; - this.SlideShowElements = modList.Archives .Select(m => m.State) .OfType<NexusDownloader.State>() diff --git a/Wabbajack/Views/InstallationView.xaml b/Wabbajack/Views/InstallationView.xaml index 4edac7a9..933edeef 100644 --- a/Wabbajack/Views/InstallationView.xaml +++ b/Wabbajack/Views/InstallationView.xaml @@ -408,15 +408,22 @@ <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> + <RowDefinition Height="*" /> </Grid.RowDefinitions> <Button Grid.Row="0" - Margin="30, 10" + Margin="30, 5" Content="Readme" - ToolTip="Open the readme webpage for the modlist" + ToolTip="Open the readme for the modlist" FontSize="20" Command="{Binding OpenReadmeCommand}" /> <Button Grid.Row="1" - Margin="30, 10" + Margin="30, 5" + Content="Website" + ToolTip="Open the webpage for the modlist" + FontSize="20" + Command="{Binding VisitWebsiteCommand}" /> + <Button Grid.Row="2" + Margin="30, 5" Content="Manifest" ToolTip="Open an explicit listing of all actions this modlist will take" FontSize="20"