From 3571776b83407b4c8c5ee25d76a9d5627e223e88 Mon Sep 17 00:00:00 2001 From: LeapwardKoex Date: Sat, 16 Nov 2024 17:26:10 +1300 Subject: [PATCH] Add about section and button to open log folder --- .github/workflows/dotnet-desktop.yml | 4 ++-- MainWindow.xaml | 30 +++++++++++++++++++++++++++- MainWindow.xaml.cs | 7 +++++++ MainWindowViewModel.cs | 15 ++++++++++++++ Resources/Strings.Designer.cs | 18 +++++++++++++++++ Resources/Strings.ja-JP.resx | 6 ++++++ Resources/Strings.resx | 6 ++++++ Resources/Strings.zh-CN.resx | 6 ++++++ 8 files changed, 89 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 469191b..b96d922 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -92,7 +92,7 @@ jobs: # Create the app package by building and packaging the Windows Application Packaging project - name: Create the app package - run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} + run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} /p:Version=1.5.0.${{ github.run_number }} env: Appx_Bundle: Always Appx_Bundle_Platforms: x86|x64 @@ -110,7 +110,7 @@ jobs: aip-output-dir: ${{ github.workspace }}\setup aip-commands: | SetProperty FOO="foo" - SetVersion 1.4.0.${{ github.run_number }} + SetVersion 1.5.0.${{ github.run_number }} # Remove the pfx - name: Remove the pfx diff --git a/MainWindow.xaml b/MainWindow.xaml index 4da9091..6a1b9a3 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -7,7 +7,7 @@ mc:Ignorable="d" Closing="MainWindow_Closing" Background="AliceBlue" - Title="MainWindow" Height="750" Width="500" WindowStartupLocation="CenterScreen"> + Title="MainWindow" Height="700" Width="500" WindowStartupLocation="CenterScreen"> @@ -89,6 +89,7 @@ @@ -104,8 +105,35 @@ + + + + + + + + + + + + + + + + + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 3de283b..7a8c585 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using System.Reflection; using System.Windows; using WpfMaiTouchEmulator.Managers; @@ -29,6 +30,7 @@ public MainWindow() IsExitWithSinmaiEnabled = Properties.Settings.Default.IsExitWithSinmaiEnabled, IsRingButtonEmulationEnabled = Properties.Settings.Default.IsRingButtonEmulationEnabled, BorderColour = Properties.Settings.Default.BorderColour, + LbAppVersion = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "1.0.0.0", }; LoadBorderRadioButtonSetting(); @@ -312,4 +314,9 @@ private void txtBorderHexColor_TextChanged(object sender, System.Windows.Control _touchPanel?.SetBorderMode(BorderSetting.Solid, textWithHash); } } + + private void openLogFolderButton_Click(object sender, RoutedEventArgs e) + { + Process.Start("explorer.exe", Logger.GetLogPath()); + } } diff --git a/MainWindowViewModel.cs b/MainWindowViewModel.cs index 664e0eb..e68a6e8 100644 --- a/MainWindowViewModel.cs +++ b/MainWindowViewModel.cs @@ -44,6 +44,18 @@ public string? LbEmulateRingButtons { get; set; } + public string? LbOpenLogFolder + { + get; set; + } + public string? LbAppVersion + { + get; set; + } + public string? LbAbout + { + get; set; + } public string? LbInstallComPort { get; set; @@ -339,6 +351,9 @@ private void UpdateLocalizedResources(ResourceManager resourceManager) LbDebugMode = resourceManager.GetString("lbDebugMode"); LbExitWithSinmai = resourceManager.GetString("lbExitWithSinmai"); LbEmulateRingButtons = resourceManager.GetString("lbEmulateRingButtons"); + LbOpenLogFolder = resourceManager.GetString("LbOpenLogFolder"); + LbAbout = resourceManager.GetString("LbAbout"); + LbInstallComPort = resourceManager.GetString("lbInstallComPort"); LbLanguageDropdown = resourceManager.GetString("lbLanguageDropdown"); diff --git a/Resources/Strings.Designer.cs b/Resources/Strings.Designer.cs index 2c5fcc6..1381273 100644 --- a/Resources/Strings.Designer.cs +++ b/Resources/Strings.Designer.cs @@ -60,6 +60,15 @@ internal Strings() { } } + /// + /// Looks up a localized string similar to About. + /// + internal static string LbAbout { + get { + return ResourceManager.GetString("LbAbout", resourceCulture); + } + } + /// /// Looks up a localized string similar to Automatic port connecting. /// @@ -267,6 +276,15 @@ internal static string lbMenuItemSetup { } } + /// + /// Looks up a localized string similar to Open log folder. + /// + internal static string LbOpenLogFolder { + get { + return ResourceManager.GetString("LbOpenLogFolder", resourceCulture); + } + } + /// /// Looks up a localized string similar to Received. /// diff --git a/Resources/Strings.ja-JP.resx b/Resources/Strings.ja-JP.resx index f175f30..9c49fa4 100644 --- a/Resources/Strings.ja-JP.resx +++ b/Resources/Strings.ja-JP.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + について + 自動ポート接続 @@ -186,6 +189,9 @@ セットアップ指示を表示 + + ログフォルダを開く + 受信データ diff --git a/Resources/Strings.resx b/Resources/Strings.resx index c7f55b2..46215ee 100644 --- a/Resources/Strings.resx +++ b/Resources/Strings.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + About + Automatic port connecting @@ -186,6 +189,9 @@ Show setup instructions + + Open log folder + Received diff --git a/Resources/Strings.zh-CN.resx b/Resources/Strings.zh-CN.resx index 0d43a3b..13cb59c 100644 --- a/Resources/Strings.zh-CN.resx +++ b/Resources/Strings.zh-CN.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 关于 + 自动连接端口 @@ -186,6 +189,9 @@ 显示设置说明 + + 打开日志文件夹 + 已接收数据