Skip to content

Commit 27b0c1f

Browse files
committed
Remember installation location from previous installs, do not log trace & debug statements to UI log
1 parent efd5018 commit 27b0c1f

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

Wabbajack.App.Wpf/App.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ private void AddLogging(ILoggingBuilder loggingBuilder)
156156
config.AddRuleForAllLevels(uiTarget);
157157

158158
loggingBuilder.ClearProviders();
159+
loggingBuilder.AddFilter("System.Net.Http.HttpClient", LogLevel.Warning);
159160
loggingBuilder.SetMinimumLevel(LogLevel.Information);
160161
loggingBuilder.AddNLog(config);
161162
}

Wabbajack.App.Wpf/Views/Common/LogView.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
d:DesignHeight="450"
99
d:DesignWidth="800"
1010
mc:Ignorable="d">
11+
<UserControl.Resources>
12+
<CollectionViewSource x:Key="FilteredRows"
13+
Source="{Binding LoggerProvider.MessageLog}"
14+
Filter="CollectionViewSource_Filter" />
15+
</UserControl.Resources>
1116
<Border x:Name="BorderMask2" CornerRadius="8" BorderThickness="0" Background="White">
1217
<Grid Margin="-1">
1318
<Border x:Name="BorderMask" CornerRadius="8" Background="White" Margin="1" />
@@ -19,7 +24,7 @@
1924
local:AutoScrollBehavior.ScrollOnNewItem="True"
2025
BorderBrush="Transparent"
2126
BorderThickness="0"
22-
ItemsSource="{Binding LoggerProvider.MessageLog}"
27+
ItemsSource="{Binding Source={StaticResource FilteredRows}}"
2328
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
2429
AlternationCount="2">
2530
<ListBox.Resources>
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.Windows;
2-
using System.Windows.Controls;
1+
using System.Windows.Controls;
2+
using static Wabbajack.Models.LogStream;
33

44
namespace Wabbajack;
55

@@ -8,9 +8,14 @@ namespace Wabbajack;
88
/// </summary>
99
public partial class LogView : UserControl
1010
{
11-
1211
public LogView()
1312
{
1413
InitializeComponent();
1514
}
15+
16+
private void CollectionViewSource_Filter(object sender, System.Windows.Data.FilterEventArgs e)
17+
{
18+
var row = e.Item as ILogMessage;
19+
e.Accepted = row.Level.Ordinal >= 2;
20+
}
1621
}

Wabbajack.App.Wpf/Views/Installers/InstallationView.xaml.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ public InstallationView()
8888
switch(result)
8989
{
9090
case InstallResult.DownloadFailed:
91-
/*
92-
this.BindCommand(ViewModel, vm => vm.OpenInstallFolderCommand, v => v.StoppedButton)
93-
.DisposeWith(disposables);
94-
*/
9591
StoppedButton.Command = ViewModel.OpenMissingArchivesCommand;
9692
StoppedButton.Icon = Symbol.DocumentGlobe;
9793
StoppedButton.Text = "Show Missing Archives";
@@ -142,7 +138,7 @@ public InstallationView()
142138
.Subscribe(x =>
143139
{
144140
InstallationLocationPicker.Watermark = x;
145-
if (ViewModel?.Installer?.Location != null)
141+
if (string.IsNullOrEmpty(ViewModel?.Installer?.Location?.TargetPath.ToString()))
146142
ViewModel.Installer.Location.TargetPath = (AbsolutePath)x;
147143
})
148144
.DisposeWith(disposables);
@@ -152,7 +148,7 @@ public InstallationView()
152148
.Subscribe(x =>
153149
{
154150
DownloadLocationPicker.Watermark = x;
155-
if (ViewModel?.Installer?.Location != null)
151+
if (string.IsNullOrEmpty(ViewModel?.Installer?.Location?.TargetPath.ToString()))
156152
ViewModel.Installer.DownloadLocation.TargetPath = (AbsolutePath)x;
157153
})
158154
.DisposeWith(disposables);

0 commit comments

Comments
 (0)