Skip to content

Commit

Permalink
Remember installation location from previous installs, do not log tra…
Browse files Browse the repository at this point in the history
…ce & debug statements to UI log
  • Loading branch information
tr4wzified committed Jan 19, 2025
1 parent efd5018 commit 27b0c1f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions Wabbajack.App.Wpf/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ private void AddLogging(ILoggingBuilder loggingBuilder)
config.AddRuleForAllLevels(uiTarget);

loggingBuilder.ClearProviders();
loggingBuilder.AddFilter("System.Net.Http.HttpClient", LogLevel.Warning);
loggingBuilder.SetMinimumLevel(LogLevel.Information);
loggingBuilder.AddNLog(config);
}
Expand Down
7 changes: 6 additions & 1 deletion Wabbajack.App.Wpf/Views/Common/LogView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<UserControl.Resources>
<CollectionViewSource x:Key="FilteredRows"
Source="{Binding LoggerProvider.MessageLog}"
Filter="CollectionViewSource_Filter" />
</UserControl.Resources>
<Border x:Name="BorderMask2" CornerRadius="8" BorderThickness="0" Background="White">
<Grid Margin="-1">
<Border x:Name="BorderMask" CornerRadius="8" Background="White" Margin="1" />
Expand All @@ -19,7 +24,7 @@
local:AutoScrollBehavior.ScrollOnNewItem="True"
BorderBrush="Transparent"
BorderThickness="0"
ItemsSource="{Binding LoggerProvider.MessageLog}"
ItemsSource="{Binding Source={StaticResource FilteredRows}}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
AlternationCount="2">
<ListBox.Resources>
Expand Down
11 changes: 8 additions & 3 deletions Wabbajack.App.Wpf/Views/Common/LogView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls;
using static Wabbajack.Models.LogStream;

namespace Wabbajack;

Expand All @@ -8,9 +8,14 @@ namespace Wabbajack;
/// </summary>
public partial class LogView : UserControl
{

public LogView()
{
InitializeComponent();
}

private void CollectionViewSource_Filter(object sender, System.Windows.Data.FilterEventArgs e)
{
var row = e.Item as ILogMessage;
e.Accepted = row.Level.Ordinal >= 2;
}
}
8 changes: 2 additions & 6 deletions Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ public InstallationView()
switch(result)
{
case InstallResult.DownloadFailed:
/*
this.BindCommand(ViewModel, vm => vm.OpenInstallFolderCommand, v => v.StoppedButton)
.DisposeWith(disposables);
*/
StoppedButton.Command = ViewModel.OpenMissingArchivesCommand;
StoppedButton.Icon = Symbol.DocumentGlobe;
StoppedButton.Text = "Show Missing Archives";
Expand Down Expand Up @@ -142,7 +138,7 @@ public InstallationView()
.Subscribe(x =>
{
InstallationLocationPicker.Watermark = x;
if (ViewModel?.Installer?.Location != null)
if (string.IsNullOrEmpty(ViewModel?.Installer?.Location?.TargetPath.ToString()))
ViewModel.Installer.Location.TargetPath = (AbsolutePath)x;
})
.DisposeWith(disposables);
Expand All @@ -152,7 +148,7 @@ public InstallationView()
.Subscribe(x =>
{
DownloadLocationPicker.Watermark = x;
if (ViewModel?.Installer?.Location != null)
if (string.IsNullOrEmpty(ViewModel?.Installer?.Location?.TargetPath.ToString()))
ViewModel.Installer.DownloadLocation.TargetPath = (AbsolutePath)x;
})
.DisposeWith(disposables);
Expand Down

0 comments on commit 27b0c1f

Please sign in to comment.