Skip to content

Commit

Permalink
chore: add button to open config folder
Browse files Browse the repository at this point in the history
fix: remove utf8 chinese character escaping
  • Loading branch information
randolf committed Feb 6, 2025
1 parent 205cca4 commit 26b28e6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/TwincatToolbox/Services/AppConfigService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public static class AppConfigService

private static readonly JsonSerializerOptions jsonSerializerOptions = new()
{
WriteIndented = true
WriteIndented = true,
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};

/// <summary>
Expand Down
10 changes: 10 additions & 0 deletions src/TwincatToolbox/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO.Pipes;
using System.Linq;
using System.Threading.Tasks;

Expand Down Expand Up @@ -82,4 +83,13 @@ private async Task ScanAndSelectAdsRouteAsync() {
Debug.WriteLine($"Selected NetId: {NetId}");
}
}

[RelayCommand]
private void OpenConfigFolder() {
Process.Start(new ProcessStartInfo
{
FileName = AppConfig.FolderName,
UseShellExecute = true
});
}
}
8 changes: 8 additions & 0 deletions src/TwincatToolbox/Views/MainView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@
</suki:GlassCard>
</suki:SukiSideMenu.FooterContent>
</suki:SukiSideMenu>
<suki:SukiWindow.RightWindowTitleBarControls>
<!-- Controls show on the right of title bar -->
<Button Classes="Basic Rounded WindowControlsButton"
Command="{Binding OpenConfigFolderCommand}"
ToolTip.Tip="Open Config Folder">
<materialIcons:MaterialIcon Kind="Cog" Foreground="{DynamicResource SukiText}" />
</Button>
</suki:SukiWindow.RightWindowTitleBarControls>
<suki:SukiWindow.Hosts>
<suki:SukiDialogHost Manager="{Binding DialogManager}"/>
</suki:SukiWindow.Hosts>
Expand Down

0 comments on commit 26b28e6

Please sign in to comment.