Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CompactGUI.Core/Analyser.cs
Original file line numberDiff line numberDiff line change
Expand Up@@ -116,7 +116,7 @@ private static bool GetContainsCompressedFiles(List<AnalysedFileDetails> fileCom
? WOFCompressionAlgorithm.NO_COMPRESSION
: WOFHelper.DetectCompression(fileInfo);

return new AnalysedFileDetails { FileName = file, CompressedSize = compressedSize, UncompressedSize = uncompressedSize, CompressionMode = compressionMode, FileInfo = fileInfo };
return new AnalysedFileDetails { FileName = file, CompressedSize = compressedSize, UncompressedSize = uncompressedSize, CompressionMode = compressionMode};
}
catch (IOException ex)
{
Expand DownExpand Up@@ -151,7 +151,7 @@ public List<ExtensionResult> GetPoorlyCompressedExtensions()
public void Dispose()
{
_folderMonitor.Dispose();
_analysedFileDetails?.Clear();
_analysedFileDetails = null;
}
}

Expand Down
2 changes: 1 addition & 1 deletion CompactGUI.Core/Settings/Settings.cs
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ public partial class Settings : ObservableRecipient
[ObservableProperty] private WindowState windowState = WindowState.Normal;
[ObservableProperty] private bool alwaysShowDetailedCompressionMode = false;

[ObservableProperty] private string language = "en-US";
[ObservableProperty] private string language = "en-AU";

partial void OnScheduledBackgroundIntervalChanged(int value) => UpdateNextScheduledBackgroundRun();

Expand Down
1 change: 0 additions & 1 deletion CompactGUI.Core/SharedObjects.cs
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@ public sealed class AnalysedFileDetails
publiclongUncompressedSize{get;set;}
publiclongCompressedSize{get;set;}
publicWOFCompressionAlgorithmCompressionMode{get;set;}
publicFileInfo?FileInfo{get;set;}
}


Expand Down
6 changes: 3 additions & 3 deletions CompactGUI/Application.xaml.vb
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,6 +58,7 @@ Partial Public Class Application

'Settings handler
services.AddSingleton(Of ISettingsService)(SettingsService)
services.AddSingleton(Of LocalisationService)()

services.AddLogging(Sub(logging)
logging.SetMinimumLevel(SettingsService.AppSettings.LogLevel)
Expand DownExpand Up@@ -131,7 +132,6 @@ Partial Public Class Application
Return TryCast(_host?.Services.GetService(GetType(T)), T)
End Function


Public Shared ReadOnly mutex As New Mutex(False, "Global\CompactGUI")
Private pipeServerCancellation As New CancellationTokenSource()
Private pipeServerTask As Task
Expand All@@ -155,7 +155,7 @@ Partial Public Class Application
End If

InitializeHost()
LanguageHelper.Initialize(GetService(Of ISettingsService).AppSettings)
Await GetService(Of LocalisationService).InitializeAsync()

GetService(Of Watcher.Watcher)()

Expand DownExpand Up@@ -345,4 +345,4 @@ Partial Public Class Application
' End If
'End Function

End Class
End Class
29 changes: 6 additions & 23 deletions CompactGUI/CompactGUI.vbproj
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,6 +27,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</NoWarn>
<WarningsAsErrors></WarningsAsErrors>
<CopyDebugSymbolFilesFromPackages>true</CopyDebugSymbolFilesFromPackages>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand All@@ -45,6 +46,7 @@
<Import Include="System.Windows.Media.Imaging" />
<Import Include="System.Windows.Navigation" />
<Import Include="System.Windows.Shapes" />
<Import Include="LazyTranslate.LocalisationExtensions" />
</ItemGroup>

<ItemGroup>
Expand All@@ -55,6 +57,8 @@
<PackageReference Include="FunctionalConverters" Version="0.1.0" />
<PackageReference Include="Gameloop.Vdf" Version="0.6.2" />
<PackageReference Include="IridiumIO.MVVM.VBSourceGenerators" Version="0.6.1" PrivateAssets="All" />
<PackageReference Include="LazyTranslate" Version="0.1.1" />
<PackageReference Include="LazyTranslate.CatalogueBuilder" Version="0.1.1" Condition="'$(Configuration)' == 'Debug'" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.7" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.7" />
Expand All@@ -79,29 +83,8 @@
</ItemGroup>

<ItemGroup>
<Compile Update="i18n\i18n.es-ES.Designer.vb">
<DependentUpon>i18n.es-ES.resx</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="i18n\i18n.Designer.vb">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>i18n.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="i18n\i18n.es-ES.resx">
<CustomToolNamespace>i18n</CustomToolNamespace>
<LastGenOutput>i18n.es-ES.Designer.vb</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="i18n\i18n.resx">
<CustomToolNamespace>i18n</CustomToolNamespace>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>i18n.Designer.vb</LastGenOutput>
</EmbeddedResource>
<None Remove="Resources\Localisation\*.toml" />
<EmbeddedResource Include="Resources\Localisation\*.toml" />
</ItemGroup>

<Target Name="RenamePublishedExe" AfterTargets="Publish" Condition="'$(IsMonolithic)' == 'true'">
Expand Down
36 changes: 18 additions & 18 deletions CompactGUI/Components/Converters/IValueConverters.vb
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,13 +18,13 @@ Public Class BytesToReadableConverter : Implements IValueConverter
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert

Dim suf As String() = {
LanguageHelper.GetString("SizeUnit_B"),
LanguageHelper.GetString("SizeUnit_KB"),
LanguageHelper.GetString("SizeUnit_MB"),
LanguageHelper.GetString("SizeUnit_GB"),
LanguageHelper.GetString("SizeUnit_TB"),
LanguageHelper.GetString("SizeUnit_PB"),
LanguageHelper.GetString("SizeUnit_EB")
"B".LT("File size"),
"KB".LT("File size"),
"MB".LT("File size"),
"GB".LT("File size"),
"TB".LT("File size"),
"PB".LT("File size"),
"EB".LT("File size")
}

If value = 1010101010101010 Then Return "?"
Expand DownExpand Up@@ -102,16 +102,16 @@ Public Class RelativeDateConverter : Implements IValueConverter
Dim ts As TimeSpan = DateTime.Now - dt

If ts > TimeSpan.FromDays(19000) Then
Return LanguageHelper.GetString("Time_Unknown")
Return "Unknown".LT("Relative date")
End If
If ts > TimeSpan.FromDays(2) Then
Return String.Format(LanguageHelper.GetString("Time_DaysAgo"), ts.TotalDays)
Return "{0:0} days ago".LTF(ts.TotalDays)
ElseIf ts > TimeSpan.FromHours(2) Then
Return String.Format(LanguageHelper.GetString("Time_HoursAgo"), ts.TotalHours)
Return "{0:0} hours ago".LTF(ts.TotalHours)
ElseIf ts > TimeSpan.FromMinutes(2) Then
Return String.Format(LanguageHelper.GetString("Time_MinutesAgo"), ts.TotalMinutes)
Return "{0:0} minutes ago".LTF(ts.TotalMinutes)
Else
Return LanguageHelper.GetString("Time_Now")
Return "just now".LT()
End If
End Function

Expand DownExpand Up@@ -300,15 +300,15 @@ Public Class FolderStatusToStringConverter : Implements IValueConverter
Dim status = CType(value, ActionState)
Select Case status
Case ActionState.Idle
Return LanguageHelper.GetString("Status_AwaitingCompression")
Return "Awaiting Compression".LT()
Case ActionState.Analysing
Return LanguageHelper.GetString("Status_Analysing")
Return "Analysing".LT()
Case ActionState.Working, ActionState.Paused
Return LanguageHelper.GetString("Status_Working")
Return "Working".LT()
Case ActionState.Results
Return LanguageHelper.GetString("Status_Compressed")
Return "Compressed".LT()
Case Else
Return LanguageHelper.GetString("Status_Unknown")
Return "Unknown".LT("Folder status")
End Select
End Function
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Expand DownExpand Up@@ -493,4 +493,4 @@ Public Class EnumToIntConverter
If targetType Is Nothing OrElse Not targetType.IsEnum OrElse value Is Nothing Then Return Binding.DoNothing
Return [Enum].ToObject(targetType, value)
End Function
End Class
End Class
35 changes: 16 additions & 19 deletions CompactGUI/Components/Settings/Settings_skiplistflyout.xaml
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:CompactGUI"
xmlns:loc="clr-namespace:LazyTranslate;assembly=LazyTranslate"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Width="620"
Expand DownExpand Up@@ -89,9 +90,8 @@
</Grid.RowDefinitions>
<ui:TitleBar Panel.ZIndex="10" ShowMaximize="False" ShowMinimize="False" />
<TextBlock x:Name="UiTitle"
Margin="10"
d:Text="edit skipped filetypes" FontSize="22" FontWeight="SemiBold"
Text="{local:Localize SetFiletypeManagement_LocalSkipFiletypesEdit}" />
Margin="10" FontSize="22" FontWeight="SemiBold"
loc:L.Value="edit skipped filetypes" />
<Grid Grid.Row="0" Margin="10 50 10 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
Expand All@@ -104,9 +104,8 @@
Background="{StaticResource CardBackground}"
Visibility="Collapsed">
<DockPanel>
<TextBlock Margin="10 8 10 8"
d:Text="Extensions in this folder" DockPanel.Dock="Top" FontSize="13" FontWeight="SemiBold"
Text="{local:Localize SkipListFlyout_ExtensionsInFolder}" />
<TextBlock Margin="10 8 10 8" DockPanel.Dock="Top" FontSize="13" FontWeight="SemiBold"
loc:L.Value="Extensions in this folder" />
<ListBox x:Name="UiExtensionList"
Background="Transparent" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" SelectionChanged="UiExtensionList_SelectionChanged">
<ListBox.ItemTemplate>
Expand DownExpand Up@@ -145,15 +144,13 @@
Margin="10 10 10 0"
Visibility="Collapsed">
<CheckBox x:Name="UiChkIncludeGlobal"
Margin="0 0 20 0" VerticalAlignment="Center"
d:Content="Include global skipped file types" Checked="UiChkIncludeGlobal_Checked"
Content="{local:Localize SkipListFlyout_IncludeGlobal}"
Margin="0 0 20 0" VerticalAlignment="Center" Checked="UiChkIncludeGlobal_Checked"
loc:L.Value="Include global skipped file types"
Unchecked="UiChkIncludeGlobal_Unchecked" />
<CheckBox x:Name="UiChkIncludeWiki"
VerticalAlignment="Center"
d:Content="Include wiki/estimator skipped file types" Checked="UiChkIncludeWiki_Checked"
Content="{local:Localize SkipListFlyout_IncludeWiki}"
ToolTip="{local:Localize SkipListFlyout_IncludeWikiTip}" Unchecked="UiChkIncludeWiki_Unchecked" />
VerticalAlignment="Center" Checked="UiChkIncludeWiki_Checked"
loc:L.Value="Include smart skipped file types"
ToolTip="{loc:T 'For Steam Games, this uses the database to determine types to skip. For non-Steam folders this is based on the smart analyser.'}" Unchecked="UiChkIncludeWiki_Unchecked" />
</WrapPanel>
<ui:TextBox x:Name="UiTokenInput"
Grid.Row="2"
Expand All@@ -165,15 +162,15 @@
<Button x:Name="UiSave"
Grid.Row="3"
Width="100"
Margin="0 0 130 20" HorizontalAlignment="Right" VerticalAlignment="Bottom"
d:Content="Save" Click="UISave_Click"
Content="{local:Localize UniSave}" />
Margin="0 0 130 20" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="UISave_Click"
loc:L.Context="Skiplist editor"
loc:L.Value="Save" />
<Button x:Name="UiReset"
Grid.Row="3"
Width="100"
Margin="0 0 10 20" HorizontalAlignment="Right" VerticalAlignment="Bottom"
d:Content="Reset" Click="UIReset_Click"
Content="{local:Localize UniReset}" />
Margin="0 0 10 20" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="UIReset_Click"
loc:L.Value="Reset" />

</Grid>
</ui:FluentWindow>

Loading