Skip to content

Commit

Permalink
Merge pull request #457 from felipe19930/bump-dependencies
Browse files Browse the repository at this point in the history
Bump project dependencies
  • Loading branch information
0x90d authored Sep 15, 2023
2 parents 5ed4927 + a29a419 commit 537d165
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 64 deletions.
4 changes: 2 additions & 2 deletions VDF.Core/VDF.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<InternalsVisibleTo Include="VDF.GUI" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FFmpeg.AutoGen" Version="6.0.0" />
<PackageReference Include="FFmpeg.AutoGen" Version="6.0.0.2" />
<PackageReference Include="Mono.Posix.NETStandard" Version="5.20.1-preview" />
<PackageReference Include="protobuf-net" Version="3.2.16" />
<PackageReference Include="protobuf-net" Version="3.2.26" />
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
</ItemGroup>

Expand Down
5 changes: 3 additions & 2 deletions VDF.GUI/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

<Application.Styles>
<FluentTheme Mode="Dark" />
<FluentTheme />
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml" />
<!--<StyleInclude Source="resm:Avalonia.Controls.DataGrid.Themes.Fluent.xaml?assembly=Avalonia.Controls.DataGrid" />-->
<StyleInclude Source="/Styles/Styles.xaml" />
Expand Down
1 change: 0 additions & 1 deletion VDF.GUI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.With(new X11PlatformOptions { UseDBusFilePicker = false })
.With(new Win32PlatformOptions { UseWindowsUIComposition = true })
.UseReactiveUI();
}
}
12 changes: 6 additions & 6 deletions VDF.GUI/Utils/PickerDialogUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string?> 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;
}
Expand All @@ -69,8 +69,8 @@ private static string GetLocalPath(Uri uriPath) {

List<string> 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;
}
Expand Down
4 changes: 2 additions & 2 deletions VDF.GUI/Utils/TreeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
namespace VDF.GUI.Utils {
static class TreeHelper {

static List<T> GetVisualTreeObjects<T>(this IVisual obj) where T : IVisual {
static List<T> GetVisualTreeObjects<T>(this Control obj) where T : Control {
var objects = new List<T>();
foreach (var child in obj.GetVisualChildren()) {
foreach (Control child in obj.GetVisualChildren()) {
if (child is T requestedType)
objects.Add(requestedType);
objects.AddRange(child.GetVisualTreeObjects<T>());
Expand Down
14 changes: 7 additions & 7 deletions VDF.GUI/VDF.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
<None Remove="Styles\Styles.xaml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview4" />
<PackageReference Include="DynamicExpresso.Core" Version="2.13.0" />
<PackageReference Include="Avalonia" Version="11.0.4" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.0.4" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.4" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.4" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.4" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.2" />
<PackageReference Include="DynamicExpresso.Core" Version="2.16.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VDF.Core\VDF.Core.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions VDF.GUI/ViewModels/CustomSelectionVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public CustomSelectionData Data {
[JsonIgnore]
public ReactiveCommand<Unit, Unit> 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" }}}
Expand All @@ -100,7 +100,7 @@ public CustomSelectionData Data {
[JsonIgnore]
public ReactiveCommand<Unit, Unit> 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" }}}
});
Expand Down
2 changes: 1 addition & 1 deletion VDF.GUI/ViewModels/DuplicateItemVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
19 changes: 8 additions & 11 deletions VDF.GUI/ViewModels/MainWindowVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ public MainWindowVM() {
Scanner.ThumbnailsRetrieved += Scanner_ThumbnailsRetrieved;
Scanner.DatabaseCleaned += Scanner_DatabaseCleaned;
Scanner.FilesEnumerated += Scanner_FilesEnumerated;
var assets = AvaloniaLocator.Current.GetService<IAssetLoader>();
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"));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -392,7 +391,7 @@ void BuildDuplicatesView() {
});
public static ReactiveCommand<Unit, Unit> 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" }}}
});
Expand Down Expand Up @@ -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" }}}
Expand Down Expand Up @@ -494,7 +493,7 @@ async Task ExportScanResultsIncludingThumbnails(string? path = null) {
}
public ReactiveCommand<Unit, Unit> 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" }}}
});
Expand All @@ -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" }}}
});
Expand Down Expand Up @@ -952,8 +951,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.
});
Expand All @@ -965,8 +963,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.
});
Expand Down
4 changes: 2 additions & 2 deletions VDF.GUI/ViewModels/MainWindowVM_Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void Instance_LogItemAdded(string message) =>
});
public ReactiveCommand<Unit, Unit> 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" }}}
Expand All @@ -175,7 +175,7 @@ void Instance_LogItemAdded(string message) =>
});
public ReactiveCommand<Unit, Unit> 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" }}}
});
Expand Down
4 changes: 2 additions & 2 deletions VDF.GUI/Views/CustomSelectionView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
Grid.Row="1"
MinHeight="70"
BorderThickness="1"
Items="{Binding Data.PathContains}"
ItemsSource="{Binding Data.PathContains}"
SelectionMode="Multiple" />
<TextBlock
Grid.Row="2"
Expand Down Expand Up @@ -235,7 +235,7 @@
Grid.Row="1"
MinHeight="70"
BorderThickness="1"
Items="{Binding Data.PathNotContains}"
ItemsSource="{Binding Data.PathNotContains}"
SelectionMode="Multiple" />
<TextBlock
Grid.Row="2"
Expand Down
2 changes: 1 addition & 1 deletion VDF.GUI/Views/CustomSelectionView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public CustomSelectionView(string a) {
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
Environment.OSVersion.Version.Build >= 22000) {
Background = null;
TransparencyLevelHint = WindowTransparencyLevel.Mica;
TransparencyLevelHint = new List<WindowTransparencyLevel> { WindowTransparencyLevel.Mica };
ExtendClientAreaChromeHints = Avalonia.Platform.ExtendClientAreaChromeHints.PreferSystemChrome;
if (SettingsFile.Instance.DarkMode)
this.FindControl<ExperimentalAcrylicBorder>("ExperimentalAcrylicBorderBackgroundBlack")!.IsVisible = true;
Expand Down
2 changes: 1 addition & 1 deletion VDF.GUI/Views/DatabaseViewer.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<TextBlock Text="Search:" VerticalAlignment="Center"/>
<TextBox Text="{Binding SearchText}" Margin="10,0,0,0" Grid.Column="1"/>
</Grid>
<controls:DataGrid x:Name="datagridDatabase" Grid.Row="1" Items="{Binding DatabaseFilesView}" AutoGenerateColumns="True">
<controls:DataGrid x:Name="datagridDatabase" Grid.Row="1" ItemsSource="{Binding DatabaseFilesView}" AutoGenerateColumns="True">
<controls:DataGrid.KeyBindings>
<KeyBinding Command="{Binding DeleteSelectedEntries}" Gesture="Delete"/>
</controls:DataGrid.KeyBindings>
Expand Down
Loading

0 comments on commit 537d165

Please sign in to comment.