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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Nickvision
Copyright (c) 2026 Nickvision

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<Platforms>AnyCPU;ARM64;x64</Platforms>
<Version>2026.2.0</Version>
<Version>2026.3.0</Version>
<PublishAot>true</PublishAot>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GirCore.Adw-1" Version="0.7.0" />
<PackageReference Include="Nickvision.Desktop.GNOME" Version="2026.3.2" />
<PackageReference Include="Nickvision.Desktop.GNOME" Version="2026.3.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Nickvision.Application.Shared\Nickvision.Application.Shared.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Nickvision.Application.GNOME/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
using Nickvision.Application.GNOME.Views;
using Nickvision.Application.Shared.Helpers;
using Nickvision.Desktop.GNOME.Helpers;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;

namespace Nickvision.Application.GNOME;

public class Program
{
[RequiresDynamicCode("Calls ConfigureAdw<T>() which may use dynamic code generation.")]
public static async Task Main(string[] args)
{
var newArgs = new string[args.Length + 1];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging;
using Nickvision.Application.Shared.Helpers;
using Nickvision.Application.Shared.Models;
using Nickvision.Application.Shared.Services;
using Nickvision.Desktop.Application;
Expand Down Expand Up @@ -32,7 +33,7 @@ public MainWindowController(ILogger<MainWindowController> logger, AppInfo appInf
_translationService = translationService;
_updaterService = updaterService;
_latestVersion = appInfo.Version!;
_translationService.Language = _jsonFileService.Load<Configuration>(Configuration.Key).TranslationLanguage;
_translationService.Language = _jsonFileService.Load(ApplicationJsonContext.Default.Configuration, Configuration.Key).TranslationLanguage;
_logger.LogInformation($"Received command-line arguments: [{string.Join(", ", argumentsService.Data)}]");
// Translate strings
_appInfo.ShortName = _translationService._("Application");
Expand All @@ -58,24 +59,24 @@ public MainWindowController(ILogger<MainWindowController> logger, AppInfo appInf
var _ => _translationService._("Good Day!")
};

public Theme Theme => _jsonFileService.Load<Configuration>(Configuration.Key).Theme;
public Theme Theme => _jsonFileService.Load(ApplicationJsonContext.Default.Configuration, Configuration.Key).Theme;

public WindowGeometry WindowGeometry
{
get => _jsonFileService.Load<Configuration>(Configuration.Key).WindowGeometry;
get => _jsonFileService.Load(ApplicationJsonContext.Default.Configuration, Configuration.Key).WindowGeometry;

set
{
var config = _jsonFileService.Load<Configuration>(Configuration.Key);
var config = _jsonFileService.Load(ApplicationJsonContext.Default.Configuration, Configuration.Key);
config.WindowGeometry = value;
_jsonFileService.Save(config, Configuration.Key);
_jsonFileService.Save(config, ApplicationJsonContext.Default.Configuration, Configuration.Key);
}
}

public async Task CheckForUpdatesAsync(bool showNotificationForNoUpdates)
{
_logger.LogInformation("Checking for updates...");
var config = _jsonFileService.Load<Configuration>(Configuration.Key);
var config = _jsonFileService.Load(ApplicationJsonContext.Default.Configuration, Configuration.Key);
var stableVersion = await _updaterService.GetLatestStableVersionAsync();
if (stableVersion is not null)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Nickvision.Application.Shared.Models;
using Nickvision.Application.Shared.Helpers;
using Nickvision.Application.Shared.Models;
using Nickvision.Desktop.Application;
using Nickvision.Desktop.Filesystem;
using Nickvision.Desktop.Globalization;
Expand All @@ -22,7 +23,7 @@ public PreferencesViewController(IJsonFileService jsonFileService, ITranslationS
{
_jsonFileService = jsonFileService;
_translationService = translationService;
_configuration = _jsonFileService.Load<Configuration>(Configuration.Key);
_configuration = _jsonFileService.Load(ApplicationJsonContext.Default.Configuration, Configuration.Key);
AvailableTranslationLanguages = new List<SelectionItem<string>>()
{
new SelectionItem<string>(string.Empty, _translationService._("System"), string.IsNullOrEmpty(_configuration.TranslationLanguage)),
Expand Down Expand Up @@ -58,5 +59,5 @@ public bool AllowPreviewUpdates
set => _configuration.AllowPreviewUpdates = value;
}

public Task SaveConfigurationAsync() => _jsonFileService.SaveAsync(_configuration, Configuration.Key);
public Task SaveConfigurationAsync() => _jsonFileService.SaveAsync(_configuration, ApplicationJsonContext.Default.Configuration, Configuration.Key);
}
11 changes: 11 additions & 0 deletions Nickvision.Application.Shared/Helpers/ApplicationJsonContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Nickvision.Application.Shared.Models;
using System.Text.Json.Serialization;

namespace Nickvision.Application.Shared.Helpers;

[JsonSourceGenerationOptions(DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, WriteIndented = true)]
[JsonSerializable(typeof(Configuration))]
public partial class ApplicationJsonContext : JsonSerializerContext
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public IHostApplicationBuilder ConfigureApplication(string[] args)
{
var appInfo = new AppInfo("org.nickvision.application", "Nickvision Application", "Application")
{
Version = new AppVersion("2026.2.0-next"),
Version = new AppVersion("2026.3.0-next"),
Changelog = "- Initial release",
SourceRepository = new Uri("https://github.com/NickvisionApps/Application"),
IssueTracker = new Uri("https://github.com/NickvisionApps/Application/issues/new"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;ARM64;x64</Platforms>
<Version>2026.2.0</Version>
<Version>2026.3.0</Version>
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nickvision.Desktop" Version="2026.3.3" />
<PackageReference Include="Nickvision.Desktop" Version="2026.3.6" />
<PackageReference Include="NReco.Logging.File" Version="1.3.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<WindowsPackageType>None</WindowsPackageType>
<DefineConstants>DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<StartupObject>Nickvision.Application.WinUI.Program</StartupObject>
<Version>2026.2.0</Version>
<Version>2026.3.0</Version>
<PublishAot>true</PublishAot>
</PropertyGroup>

<ItemGroup>
Expand All @@ -32,8 +33,8 @@
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.251219" />
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.2.251219" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.7705" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.260209005" />
<PackageReference Include="Nickvision.Desktop.WinUI" Version="2026.3.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.260317003" />
<PackageReference Include="Nickvision.Desktop.WinUI" Version="2026.3.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Nickvision.Application.Shared\Nickvision.Application.Shared.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions Nickvision.Application.WinUI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Nickvision.Application.WinUI.Helpers;
using Nickvision.Desktop.WinUI.Helpers;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;

namespace Nickvision.Application.WinUI;
Expand All @@ -13,6 +14,7 @@ public static partial class Program
private static partial void XamlCheckProcessRequirements();

[STAThread]
[RequiresDynamicCode("Calls ConfigureWinUI<T>() which may use dynamic code generation.")]
private static void Main(string[] args)
{
XamlCheckProcessRequirements();
Expand Down
17 changes: 15 additions & 2 deletions Nickvision.Application.WinUI/Views/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Nickvision.Application.WinUI.Views"
xmlns:nickvision="using:Nickvision.Desktop.WinUI.Controls"
xmlns:helpers="using:Nickvision.Desktop.WinUI.Helpers"
xmlns:community="using:CommunityToolkit.WinUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Expand Down Expand Up @@ -47,15 +48,27 @@
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE793;"/>
</community:SettingsCard.HeaderIcon>

<ComboBox x:Name="CmbTheme" DisplayMemberPath="Label" SelectionChanged="Cmb_SelectionChanged"/>
<ComboBox x:Name="CmbTheme" SelectionChanged="Cmb_SelectionChanged">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="helpers:BindableSelectionItem">
<TextBlock Text="{x:Bind Label}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</community:SettingsCard>

<community:SettingsCard x:Name="RowTranslationLanguage">
<community:SettingsCard.HeaderIcon>
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xF2B7;"/>
</community:SettingsCard.HeaderIcon>

<ComboBox x:Name="CmbTranslationLanguage" DisplayMemberPath="Label" SelectionChanged="Cmb_SelectionChanged"/>
<ComboBox x:Name="CmbTranslationLanguage" SelectionChanged="Cmb_SelectionChanged">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="helpers:BindableSelectionItem">
<TextBlock Text="{x:Bind Label}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</community:SettingsCard>

<community:SettingsCard x:Name="RowPreviewUpdates">
Expand Down
9 changes: 4 additions & 5 deletions Nickvision.Application.WinUI/Views/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Microsoft.UI.Xaml.Controls;
using Nickvision.Application.Shared.Controllers;
using Nickvision.Application.Shared.Models;
using Nickvision.Desktop.Application;
using Nickvision.Desktop.Globalization;
using Nickvision.Desktop.WinUI.Helpers;
using System.Threading.Tasks;
Expand All @@ -25,10 +24,10 @@ public SettingsPage(PreferencesViewController controller, ITranslationService tr
LblSettings.Text = _translationService._("Settings");
SelectorUI.Text = _translationService._("User Interface");
RowTheme.Header = _translationService._("Theme");
CmbTheme.ItemsSource = _controller.Themes;
CmbTheme.ItemsSource = _controller.Themes.ToBindableSelectonItems();
RowTranslationLanguage.Header = _translationService._("Translation Language");
RowTranslationLanguage.Description = _translationService._("An application restart is required for a change to take effect");
CmbTranslationLanguage.ItemsSource = _controller.AvailableTranslationLanguages;
CmbTranslationLanguage.ItemsSource = _controller.AvailableTranslationLanguages.ToBindableSelectonItems();
RowPreviewUpdates.Header = _translationService._("Receive Preview Updates");
TglPreviewUpdates.OnContent = _translationService._("On");
TglPreviewUpdates.OffContent = _translationService._("Off");
Expand Down Expand Up @@ -58,8 +57,8 @@ private async Task ApplyChangesAsync()
{
return;
}
_controller.Theme = (CmbTheme.SelectedItem as SelectionItem<Theme>)!;
_controller.TranslationLanguage = (CmbTranslationLanguage.SelectedItem as SelectionItem<string>)!;
_controller.Theme = (CmbTheme.SelectedItem as BindableSelectionItem)!.ToSelectionItem<Theme>()!;
_controller.TranslationLanguage = (CmbTranslationLanguage.SelectedItem as BindableSelectionItem)!.ToSelectionItem<string>()!;
_controller.AllowPreviewUpdates = TglPreviewUpdates.IsOn;
await _controller.SaveConfigurationAsync();
}
Expand Down
Loading
Loading