From c29f308072287549032d7138d1ebaacb991f48b4 Mon Sep 17 00:00:00 2001 From: felipe19930 <35700659+felipe19930@users.noreply.github.com> Date: Tue, 12 Sep 2023 03:47:57 -0300 Subject: [PATCH 1/4] Bump FFmpeg.AutoGen from 6.0.0 to 6.0.0.2 --- VDF.Core/VDF.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDF.Core/VDF.Core.csproj b/VDF.Core/VDF.Core.csproj index df76be22..a9866e89 100644 --- a/VDF.Core/VDF.Core.csproj +++ b/VDF.Core/VDF.Core.csproj @@ -9,7 +9,7 @@ - + From 2e84acba2942671f45a6d327064b311ce90b5291 Mon Sep 17 00:00:00 2001 From: felipe19930 <35700659+felipe19930@users.noreply.github.com> Date: Tue, 12 Sep 2023 03:48:37 -0300 Subject: [PATCH 2/4] Bump protobuf-net from 3.2.16 to 3.2.26 --- VDF.Core/VDF.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDF.Core/VDF.Core.csproj b/VDF.Core/VDF.Core.csproj index a9866e89..bcf69581 100644 --- a/VDF.Core/VDF.Core.csproj +++ b/VDF.Core/VDF.Core.csproj @@ -11,7 +11,7 @@ - + From 52f8fff17d653248677e3ffd52e18818cbc62bf6 Mon Sep 17 00:00:00 2001 From: felipe19930 <35700659+felipe19930@users.noreply.github.com> Date: Tue, 12 Sep 2023 03:50:37 -0300 Subject: [PATCH 3/4] Bump DynamicExpresso.Core from 2.13.0 to 2.16.1 --- VDF.GUI/VDF.GUI.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDF.GUI/VDF.GUI.csproj b/VDF.GUI/VDF.GUI.csproj index c6762113..b2f1c3da 100644 --- a/VDF.GUI/VDF.GUI.csproj +++ b/VDF.GUI/VDF.GUI.csproj @@ -37,7 +37,7 @@ - + From a29a41937a65734377152c00066bc4520fad93e2 Mon Sep 17 00:00:00 2001 From: felipe19930 <35700659+felipe19930@users.noreply.github.com> Date: Tue, 12 Sep 2023 03:51:55 -0300 Subject: [PATCH 4/4] Bump Avalonia.* from 11.0.0-preview4 to 11.0.4 - Bump Avalonia from 11.0.0-preview4 to 11.0.4 - Bump Avalonia.Controls.DataGrid from 11.0.0-preview4 to 11.0.4 - Bump Avalonia.Desktop from 11.0.0-preview4 to 11.0.4 - Bump Avalonia.ReactiveUI from 11.0.0-preview4 to 11.0.4 - Bump Avalonia.Themes.Fluent from 11.0.0-preview4 to 11.0.4 - Bump Avalonia.Xaml.Behaviors from 11.0.0-preview4 to 11.0.2 --- VDF.GUI/App.xaml | 5 ++-- VDF.GUI/Program.cs | 1 - VDF.GUI/Utils/PickerDialogUtils.cs | 12 ++++----- VDF.GUI/Utils/TreeHelper.cs | 4 +-- VDF.GUI/VDF.GUI.csproj | 12 ++++----- VDF.GUI/ViewModels/CustomSelectionVM.cs | 4 +-- VDF.GUI/ViewModels/DuplicateItemVM.cs | 2 +- VDF.GUI/ViewModels/MainWindowVM.cs | 19 ++++++-------- VDF.GUI/ViewModels/MainWindowVM_Settings.cs | 4 +-- VDF.GUI/Views/CustomSelectionView.xaml | 4 +-- VDF.GUI/Views/CustomSelectionView.xaml.cs | 2 +- VDF.GUI/Views/DatabaseViewer.xaml | 2 +- VDF.GUI/Views/MainWindow.xaml | 18 ++++++------- VDF.GUI/Views/MainWindow.xaml.cs | 28 +++++++++++---------- VDF.GUI/Views/ThumbnailComparer.xaml | 2 +- VDF.GUI/Views/ThumbnailComparer.xaml.cs | 2 +- 16 files changed, 60 insertions(+), 61 deletions(-) diff --git a/VDF.GUI/App.xaml b/VDF.GUI/App.xaml index c9ed988e..866575b7 100644 --- a/VDF.GUI/App.xaml +++ b/VDF.GUI/App.xaml @@ -2,10 +2,11 @@ x:Class="VDF.GUI.App" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="clr-namespace:VDF.GUI"> + xmlns:local="clr-namespace:VDF.GUI" + RequestedThemeVariant="Dark"> - + diff --git a/VDF.GUI/Program.cs b/VDF.GUI/Program.cs index 41790325..0b5241ac 100644 --- a/VDF.GUI/Program.cs +++ b/VDF.GUI/Program.cs @@ -35,7 +35,6 @@ public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure() .UsePlatformDetect() .With(new X11PlatformOptions { UseDBusFilePicker = false }) - .With(new Win32PlatformOptions { UseWindowsUIComposition = true }) .UseReactiveUI(); } } diff --git a/VDF.GUI/Utils/PickerDialogUtils.cs b/VDF.GUI/Utils/PickerDialogUtils.cs index d03fb28c..db433e4a 100644 --- a/VDF.GUI/Utils/PickerDialogUtils.cs +++ b/VDF.GUI/Utils/PickerDialogUtils.cs @@ -48,16 +48,16 @@ private static string GetLocalPath(Uri uriPath) { if (paths != null && paths.Count > 0 && - paths[0].TryGetUri(out Uri? uriPath)) - return GetLocalPath(uriPath); + paths[0].TryGetLocalPath() is string uriPath) + return uriPath; return null; } internal static async Task SaveFilePicker(FilePickerSaveOptions options) { var path = await ApplicationHelpers.MainWindow.StorageProvider.SaveFilePickerAsync(options); - if (path != null && path.TryGetUri(out Uri? uriPath)) - return GetLocalPath(uriPath); + if (path != null && path.TryGetLocalPath() is string uriPath) + return uriPath; return null; } @@ -69,8 +69,8 @@ private static string GetLocalPath(Uri uriPath) { List results = new(); foreach (var item in paths) { - if (item.TryGetUri(out Uri? uriPath)) - results.Add(GetLocalPath(uriPath)); + if (item.TryGetLocalPath() is string uriPath) + results.Add(uriPath); } return results; } diff --git a/VDF.GUI/Utils/TreeHelper.cs b/VDF.GUI/Utils/TreeHelper.cs index a009039f..07ff97b9 100644 --- a/VDF.GUI/Utils/TreeHelper.cs +++ b/VDF.GUI/Utils/TreeHelper.cs @@ -22,9 +22,9 @@ namespace VDF.GUI.Utils { static class TreeHelper { - static List GetVisualTreeObjects(this IVisual obj) where T : IVisual { + static List GetVisualTreeObjects(this Control obj) where T : Control { var objects = new List(); - foreach (var child in obj.GetVisualChildren()) { + foreach (Control child in obj.GetVisualChildren()) { if (child is T requestedType) objects.Add(requestedType); objects.AddRange(child.GetVisualTreeObjects()); diff --git a/VDF.GUI/VDF.GUI.csproj b/VDF.GUI/VDF.GUI.csproj index b2f1c3da..e32ae0a5 100644 --- a/VDF.GUI/VDF.GUI.csproj +++ b/VDF.GUI/VDF.GUI.csproj @@ -31,12 +31,12 @@ - - - - - - + + + + + + diff --git a/VDF.GUI/ViewModels/CustomSelectionVM.cs b/VDF.GUI/ViewModels/CustomSelectionVM.cs index 334f237d..a763cf91 100644 --- a/VDF.GUI/ViewModels/CustomSelectionVM.cs +++ b/VDF.GUI/ViewModels/CustomSelectionVM.cs @@ -83,7 +83,7 @@ public CustomSelectionData Data { [JsonIgnore] public ReactiveCommand SaveCommand => ReactiveCommand.CreateFromTask(async () => { var result = await Utils.PickerDialogUtils.SaveFilePicker(new FilePickerSaveOptions() { - SuggestedStartLocation = new BclStorageFolder(CoreUtils.CurrentFolder), + SuggestedStartLocation = await ApplicationHelpers.MainWindow.StorageProvider.TryGetFolderFromPathAsync(CoreUtils.CurrentFolder), DefaultExtension = ".vdfselection", FileTypeChoices = new FilePickerFileType[] { new FilePickerFileType("Selection File") { Patterns = new string[] { "*.vdfselection" }}} @@ -100,7 +100,7 @@ public CustomSelectionData Data { [JsonIgnore] public ReactiveCommand LoadCommand => ReactiveCommand.CreateFromTask(async () => { var result = await Utils.PickerDialogUtils.OpenFilePicker(new FilePickerOpenOptions() { - SuggestedStartLocation = new BclStorageFolder(CoreUtils.CurrentFolder), + SuggestedStartLocation = await ApplicationHelpers.MainWindow.StorageProvider.TryGetFolderFromPathAsync(CoreUtils.CurrentFolder), FileTypeFilter = new FilePickerFileType[] { new FilePickerFileType("Selection File") { Patterns = new string[] { "*.vdfselection" }}} }); diff --git a/VDF.GUI/ViewModels/DuplicateItemVM.cs b/VDF.GUI/ViewModels/DuplicateItemVM.cs index 06170911..6ebc1080 100644 --- a/VDF.GUI/ViewModels/DuplicateItemVM.cs +++ b/VDF.GUI/ViewModels/DuplicateItemVM.cs @@ -37,7 +37,7 @@ public DuplicateItemVM(DuplicateItem item) { Thumbnail = ImageUtils.JoinImages(ItemInfo.ImageList)!; Dispatcher.UIThread.Post(() => { this.RaisePropertyChanged(nameof(Thumbnail)); - }, DispatcherPriority.Layout); + }, DispatcherPriority.Render); // DispatcherPriority.Layout was removed in https://github.com/AvaloniaUI/Avalonia/commit/f300a24402afc9f7f3c177e835a0cec10ce52e6c }; } public DuplicateItem ItemInfo { get; set; } diff --git a/VDF.GUI/ViewModels/MainWindowVM.cs b/VDF.GUI/ViewModels/MainWindowVM.cs index 050f6ab4..e13219b9 100644 --- a/VDF.GUI/ViewModels/MainWindowVM.cs +++ b/VDF.GUI/ViewModels/MainWindowVM.cs @@ -162,8 +162,7 @@ public MainWindowVM() { Scanner.ThumbnailsRetrieved += Scanner_ThumbnailsRetrieved; Scanner.DatabaseCleaned += Scanner_DatabaseCleaned; Scanner.FilesEnumerated += Scanner_FilesEnumerated; - var assets = AvaloniaLocator.Current.GetService(); - Scanner.NoThumbnailImage = SixLabors.ImageSharp.Image.Load(assets!.Open(new Uri("avares://VDF.GUI/Assets/icon.png"))); + Scanner.NoThumbnailImage = SixLabors.ImageSharp.Image.Load(AssetLoader.Open(new Uri("avares://VDF.GUI/Assets/icon.png"))); try { File.Delete(Path.Combine(CoreUtils.CurrentFolder, "log.txt")); @@ -346,7 +345,7 @@ void BuildDuplicatesView() { view = new DataGridCollectionView(Duplicates); view.GroupDescriptions.Add(new DataGridPathGroupDescription($"{nameof(DuplicateItemVM.ItemInfo)}.{nameof(DuplicateItem.GroupId)}")); view.Filter += DuplicatesFilter; - GetDataGrid.Items = view; + GetDataGrid.ItemsSource = view; TotalDuplicates = Duplicates.Count; TotalDuplicatesSize = Duplicates.Sum(x => x.ItemInfo.SizeLong).BytesToString(); TotalSizeRemovedInternal = 0; @@ -392,7 +391,7 @@ void BuildDuplicatesView() { }); public static ReactiveCommand ImportDataBaseFromJsonCommand => ReactiveCommand.CreateFromTask(async () => { var result = await Utils.PickerDialogUtils.OpenFilePicker(new FilePickerOpenOptions() { - SuggestedStartLocation = new BclStorageFolder(CoreUtils.CurrentFolder), + SuggestedStartLocation = await ApplicationHelpers.MainWindow.StorageProvider.TryGetFolderFromPathAsync(CoreUtils.CurrentFolder), FileTypeFilter = new FilePickerFileType[] { new FilePickerFileType("Json File") { Patterns = new string[] { "*.json" }}} }); @@ -464,7 +463,7 @@ async void ExportScanResultsToJson(JsonSerializerOptions options) { }); async Task ExportScanResultsIncludingThumbnails(string? path = null) { path ??= await Utils.PickerDialogUtils.SaveFilePicker(new FilePickerSaveOptions() { - SuggestedStartLocation = new BclStorageFolder(CoreUtils.CurrentFolder), + SuggestedStartLocation = await ApplicationHelpers.MainWindow.StorageProvider.TryGetFolderFromPathAsync(CoreUtils.CurrentFolder), DefaultExtension = ".json", FileTypeChoices = new FilePickerFileType[] { new FilePickerFileType("Scan Results") { Patterns = new string[] { "*.scanresults" }}} @@ -494,7 +493,7 @@ async Task ExportScanResultsIncludingThumbnails(string? path = null) { } public ReactiveCommand ImportScanResultsFromFileCommand => ReactiveCommand.CreateFromTask(async () => { var result = await Utils.PickerDialogUtils.OpenFilePicker(new FilePickerOpenOptions { - SuggestedStartLocation = new BclStorageFolder(CoreUtils.CurrentFolder), + SuggestedStartLocation = await ApplicationHelpers.MainWindow.StorageProvider.TryGetFolderFromPathAsync(CoreUtils.CurrentFolder), FileTypeFilter = new FilePickerFileType[] { new FilePickerFileType("Scan Results") { Patterns = new string[] { "*.scanresults" }}} }); @@ -509,7 +508,7 @@ async void ImportScanResultsIncludingThumbnails(string? path = null) { if (path == null) { path = await Utils.PickerDialogUtils.OpenFilePicker(new FilePickerOpenOptions() { - SuggestedStartLocation = new BclStorageFolder(CoreUtils.CurrentFolder), + SuggestedStartLocation = await ApplicationHelpers.MainWindow.StorageProvider.TryGetFolderFromPathAsync(CoreUtils.CurrentFolder), FileTypeFilter = new FilePickerFileType[] { new FilePickerFileType("Scan Results") { Patterns = new string[] { "*.scanresults" }}} }); @@ -951,8 +950,7 @@ async void DeleteInternal(bool fromDisk, } #pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. #pragma warning disable CS8602 // Dereference of a possibly null reference. - await ((IClipboard)AvaloniaLocator.Current.GetService(typeof(IClipboard))) - .SetTextAsync(sb.ToString().TrimEnd(new char[2] { '\r', '\n' })); + await (ApplicationHelpers.MainWindow.Clipboard.SetTextAsync(sb.ToString().TrimEnd(new char[2] { '\r', '\n' }))); #pragma warning restore CS8602 // Dereference of a possibly null reference. #pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type. }); @@ -964,8 +962,7 @@ async void DeleteInternal(bool fromDisk, } #pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. #pragma warning disable CS8602 // Dereference of a possibly null reference. - await ((IClipboard)AvaloniaLocator.Current.GetService(typeof(IClipboard))) - .SetTextAsync(sb.ToString().TrimEnd(new char[2] { '\r', '\n' })); + await (ApplicationHelpers.MainWindow.Clipboard.SetTextAsync(sb.ToString().TrimEnd(new char[2] { '\r', '\n' }))); #pragma warning restore CS8602 // Dereference of a possibly null reference. #pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type. }); diff --git a/VDF.GUI/ViewModels/MainWindowVM_Settings.cs b/VDF.GUI/ViewModels/MainWindowVM_Settings.cs index 7fdcf72b..a1365a44 100644 --- a/VDF.GUI/ViewModels/MainWindowVM_Settings.cs +++ b/VDF.GUI/ViewModels/MainWindowVM_Settings.cs @@ -159,7 +159,7 @@ void Instance_LogItemAdded(string message) => }); public ReactiveCommand SaveSettingsProfileCommand => ReactiveCommand.CreateFromTask(async () => { var result = await Utils.PickerDialogUtils.SaveFilePicker(new FilePickerSaveOptions() { - SuggestedStartLocation = new BclStorageFolder(CoreUtils.CurrentFolder), + SuggestedStartLocation = await ApplicationHelpers.MainWindow.StorageProvider.TryGetFolderFromPathAsync(CoreUtils.CurrentFolder), DefaultExtension = ".json", FileTypeChoices = new FilePickerFileType[] { new FilePickerFileType("Setting File") { Patterns = new string[] { "*.json" }}} @@ -175,7 +175,7 @@ void Instance_LogItemAdded(string message) => }); public ReactiveCommand LoadSettingsProfileCommand => ReactiveCommand.CreateFromTask(async () => { var result = await Utils.PickerDialogUtils.OpenFilePicker(new FilePickerOpenOptions() { - SuggestedStartLocation = new BclStorageFolder(CoreUtils.CurrentFolder), + SuggestedStartLocation = await ApplicationHelpers.MainWindow.StorageProvider.TryGetFolderFromPathAsync(CoreUtils.CurrentFolder), FileTypeFilter = new FilePickerFileType[] { new FilePickerFileType("Setting File") { Patterns = new string[] { "*.json", "*.xml" }}} }); diff --git a/VDF.GUI/Views/CustomSelectionView.xaml b/VDF.GUI/Views/CustomSelectionView.xaml index f8a529bb..10abd1dc 100644 --- a/VDF.GUI/Views/CustomSelectionView.xaml +++ b/VDF.GUI/Views/CustomSelectionView.xaml @@ -189,7 +189,7 @@ Grid.Row="1" MinHeight="70" BorderThickness="1" - Items="{Binding Data.PathContains}" + ItemsSource="{Binding Data.PathContains}" SelectionMode="Multiple" /> = 22000) { Background = null; - TransparencyLevelHint = WindowTransparencyLevel.Mica; + TransparencyLevelHint = new List { WindowTransparencyLevel.Mica }; ExtendClientAreaChromeHints = Avalonia.Platform.ExtendClientAreaChromeHints.PreferSystemChrome; if (SettingsFile.Instance.DarkMode) this.FindControl("ExperimentalAcrylicBorderBackgroundBlack")!.IsVisible = true; diff --git a/VDF.GUI/Views/DatabaseViewer.xaml b/VDF.GUI/Views/DatabaseViewer.xaml index b4536b42..3b4b82eb 100644 --- a/VDF.GUI/Views/DatabaseViewer.xaml +++ b/VDF.GUI/Views/DatabaseViewer.xaml @@ -17,7 +17,7 @@ - + diff --git a/VDF.GUI/Views/MainWindow.xaml b/VDF.GUI/Views/MainWindow.xaml index 82531ed8..f6223178 100644 --- a/VDF.GUI/Views/MainWindow.xaml +++ b/VDF.GUI/Views/MainWindow.xaml @@ -746,7 +746,7 @@ @@ -761,7 +761,7 @@ @@ -1470,7 +1470,7 @@ + ItemsSource="{Binding Source={x:Static Settings:SettingsFile.Instance}, Path=Includes}" /> + ItemsSource="{Binding Source={x:Static Settings:SettingsFile.Instance}, Path=Blacklists}" /> @@ -1731,7 +1731,7 @@ MinHeight="70" BorderThickness="1" IsEnabled="{Binding #CheckboxFilterByFilePathContains.IsChecked}" - Items="{Binding Source={x:Static Settings:SettingsFile.Instance}, Path=FilePathContainsTexts}" /> + ItemsSource="{Binding Source={x:Static Settings:SettingsFile.Instance}, Path=FilePathContainsTexts}" /> + ItemsSource="{Binding Source={x:Static Settings:SettingsFile.Instance}, Path=FilePathNotContainsTexts}" />