diff --git a/src/Files.App/Data/Items/OpenSourceLibraryItem.cs b/src/Files.App/Data/Items/OpenSourceLibraryItem.cs new file mode 100644 index 000000000000..1e6d2428a07a --- /dev/null +++ b/src/Files.App/Data/Items/OpenSourceLibraryItem.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2024 Files Community +// Licensed under the MIT License. See the LICENSE. + +namespace Files.App.Data.Items +{ + /// + /// Represents an item for open source library shown on . + /// + public class OpenSourceLibraryItem + { + /// + /// Gets the URL that navigates to the open source library. + /// + public string Url { get; } = ""; + + /// + /// Gets the name of the open source library. + /// + public string Name { get; } = ""; + + /// + /// Initializes an instance of class. + /// + /// The URL + /// The name + public OpenSourceLibraryItem(string url, string name) + { + Url = url; + Name = name; + } + } +} diff --git a/src/Files.App/Files.App.csproj b/src/Files.App/Files.App.csproj index e181346644b6..93019cb21b0a 100644 --- a/src/Files.App/Files.App.csproj +++ b/src/Files.App/Files.App.csproj @@ -48,10 +48,6 @@ PreserveNewest - - NOTICE.md - PreserveNewest - PreserveNewest diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 4c9ebf1059ba..78ab9d2632b5 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -1820,8 +1820,8 @@ No reduced color - - Third party licenses + + Third party libraries This option modifies the system registry and can have unexpected side effects on your device. Continue at your own risk. diff --git a/src/Files.App/ViewModels/Settings/AboutViewModel.cs b/src/Files.App/ViewModels/Settings/AboutViewModel.cs index 746cd2bb0e51..2e804bdc6eb7 100644 --- a/src/Files.App/ViewModels/Settings/AboutViewModel.cs +++ b/src/Files.App/ViewModels/Settings/AboutViewModel.cs @@ -11,9 +11,25 @@ namespace Files.App.ViewModels.Settings { + /// + /// Represents view model of . + /// public sealed class AboutViewModel : ObservableObject { - protected readonly IFileTagsSettingsService FileTagsSettingsService = Ioc.Default.GetRequiredService(); + // Properties + + public string Version + => string.Format($"{"SettingsAboutVersionTitle".GetLocalizedResource()} {AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}"); + + public string AppName + => Package.Current.DisplayName; + + public PackageVersion AppVersion + => Package.Current.Id.Version; + + public ObservableCollection OpenSourceLibraries { get; } + + // Commands public ICommand CopyAppVersionCommand { get; } public ICommand CopyWindowsVersionCommand { get; } @@ -27,15 +43,42 @@ public sealed class AboutViewModel : ObservableObject public ICommand OpenPrivacyPolicyCommand { get; } public ICommand OpenCrowdinCommand { get; } - private string _ThirdPartyNotices = string.Empty; - public string ThirdPartyNotices - { - get => _ThirdPartyNotices; - set => SetProperty(ref _ThirdPartyNotices, value); - } + // Constructor + /// + /// Initializes an instance of class. + /// public AboutViewModel() { + OpenSourceLibraries = + [ + new ("https://github.com/omar/ByteSize", "ByteSize"), + new ("https://github.com/CommunityToolkit/dotnet", "CommunityToolkit.Mvvm"), + new ("https://github.com/DiscUtils/DiscUtils", "DiscUtils.Udf"), + new ("https://github.com/robinrodricks/FluentFTP", "FluentFTP"), + new ("https://github.com/rickyah/ini-parser", "INI File Parser"), + new ("https://github.com/libgit2/libgit2sharp", "libgit2sharp"), + new ("https://github.com/mbdavid/LiteDB", "LiteDB"), + new ("https://github.com/beto-rodriguez/LiveCharts2", "LiveCharts2"), + new ("https://github.com/jeffijoe/messageformat.net", "MessageFormat"), + new ("https://github.com/dotnet/efcore", "EF Core for SQLite"), + new ("https://github.com/dotnet/runtime", "Microsoft.Extensions"), + new ("https://github.com/files-community/SevenZipSharp", "SevenZipSharp"), + new ("https://sourceforge.net/projects/sevenzip", "7zip"), + new ("https://github.com/ericsink/SQLitePCL.raw", "PCL for SQLite"), + new ("https://github.com/microsoft/WindowsAppSDK", "WindowsAppSDK"), + new ("https://github.com/microsoft/microsoft-ui-xaml", "WinUI 3"), + new ("https://github.com/microsoft/Win2D", "Win2D"), + new ("https://github.com/CommunityToolkit/WindowsCommunityToolkit", "Windows Community Toolkit 7.x"), + new ("https://github.com/mono/taglib-sharp", "TagLibSharp"), + new ("https://github.com/Tulpep/Active-Directory-Object-Picker", "ActiveDirectoryObjectPicker"), + new ("https://github.com/dotMorten/WinUIEx", "WinUIEx"), + new ("https://github.com/dahall/Vanara", "Vanara"), + new ("https://github.com/PowerShell/MMI", "MMI"), + new ("https://github.com/microsoft/CsWin32", "CsWin32"), + new ("https://github.com/microsoft/CsWinRT", "CsWinRT"), + ]; + CopyAppVersionCommand = new RelayCommand(CopyAppVersion); CopyWindowsVersionCommand = new RelayCommand(CopyWindowsVersion); SupportUsCommand = new AsyncRelayCommand(SupportUs); @@ -49,6 +92,8 @@ public AboutViewModel() OpenCrowdinCommand = new AsyncRelayCommand(DoOpenCrowdin); } + // Methods + private async Task OpenLogLocation() { await Launcher.LaunchFolderAsync(ApplicationData.Current.LocalFolder).AsTask(); @@ -95,7 +140,6 @@ public Task DoOpenPrivacyPolicy() return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.PrivacyPolicyUrl)).AsTask(); } - public Task DoOpenCrowdin() { return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.CrowdinUrl)).AsTask(); @@ -128,12 +172,6 @@ public Task SupportUs() return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask(); } - public async Task LoadThirdPartyNoticesAsync() - { - StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(Constants.DocsPath.ThirdPartyNoticePath)); - ThirdPartyNotices = await FileIO.ReadTextAsync(file); - } - public string GetAppVersion() { return string.Format($"{AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}"); @@ -151,16 +189,5 @@ public string GetVersionsQueryString() query["windows_version"] = GetWindowsVersion(); return query.ToString() ?? string.Empty; } - - public string Version - { - get - { - return string.Format($"{"SettingsAboutVersionTitle".GetLocalizedResource()} {AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}"); - } - } - - public string AppName => Package.Current.DisplayName; - public PackageVersion AppVersion => Package.Current.Id.Version; } } diff --git a/src/Files.App/Views/Settings/AboutPage.xaml b/src/Files.App/Views/Settings/AboutPage.xaml index ce843a43d7f3..ecc09c8e4644 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml +++ b/src/Files.App/Views/Settings/AboutPage.xaml @@ -5,6 +5,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:dataitems="using:Files.App.Data.Items" xmlns:helpers="using:Files.App.Helpers" xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" @@ -181,21 +182,31 @@ - + - - - + + + + + + + + + + + + + + diff --git a/src/Files.App/Views/Settings/AboutPage.xaml.cs b/src/Files.App/Views/Settings/AboutPage.xaml.cs index 07d55d0926a2..456b3b7ebc5b 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml.cs +++ b/src/Files.App/Views/Settings/AboutPage.xaml.cs @@ -1,9 +1,7 @@ // Copyright (c) 2024 Files Community // Licensed under the MIT License. See the LICENSE. -using CommunityToolkit.WinUI.UI.Controls; using Microsoft.UI.Xaml.Controls; -using Windows.System; namespace Files.App.Views.Settings { @@ -13,17 +11,5 @@ public AboutPage() { InitializeComponent(); } - - private async void ThirdPartyLicenses_Click(object sender, bool e) - { - if (e && string.IsNullOrEmpty(ViewModel.ThirdPartyNotices)) - await ViewModel.LoadThirdPartyNoticesAsync(); - } - - private async void MarkdownTextBlock_LinkClicked(object sender, LinkClickedEventArgs e) - { - if (Uri.TryCreate(e.Link, UriKind.Absolute, out Uri? link)) - await Launcher.LaunchUriAsync(link); - } } }