Add about section and button to open log folder
.NET Core Desktop / build (Release) (push) Has been cancelled Details

master
LeapwardKoex 2024-11-16 17:26:10 +13:00
parent 0347c983b6
commit 3571776b83
8 changed files with 89 additions and 3 deletions

View File

@ -92,7 +92,7 @@ jobs:
# Create the app package by building and packaging the Windows Application Packaging project # Create the app package by building and packaging the Windows Application Packaging project
- name: Create the app package - 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: env:
Appx_Bundle: Always Appx_Bundle: Always
Appx_Bundle_Platforms: x86|x64 Appx_Bundle_Platforms: x86|x64
@ -110,7 +110,7 @@ jobs:
aip-output-dir: ${{ github.workspace }}\setup aip-output-dir: ${{ github.workspace }}\setup
aip-commands: | aip-commands: |
SetProperty FOO="foo" SetProperty FOO="foo"
SetVersion 1.4.0.${{ github.run_number }} SetVersion 1.5.0.${{ github.run_number }}
# Remove the pfx # Remove the pfx
- name: Remove the pfx - name: Remove the pfx

View File

@ -7,7 +7,7 @@
mc:Ignorable="d" mc:Ignorable="d"
Closing="MainWindow_Closing" Closing="MainWindow_Closing"
Background="AliceBlue" Background="AliceBlue"
Title="MainWindow" Height="750" Width="500" WindowStartupLocation="CenterScreen"> Title="MainWindow" Height="700" Width="500" WindowStartupLocation="CenterScreen">
<ScrollViewer> <ScrollViewer>
<StackPanel MaxWidth="400" Margin="0,0,0,50"> <StackPanel MaxWidth="400" Margin="0,0,0,50">
<Menu> <Menu>
@ -89,6 +89,7 @@
</ui:CardExpander> </ui:CardExpander>
<ui:CardExpander <ui:CardExpander
CornerRadius="8" CornerRadius="8"
Margin="0,0,0,10"
Header="{Binding LbSettings}" Header="{Binding LbSettings}"
d:Header="Settings"> d:Header="Settings">
<ui:CardExpander.Icon> <ui:CardExpander.Icon>
@ -104,8 +105,35 @@
<CheckBox x:Name="automaticPortConnecting" d:Content="Automatic port connecting" Content="{Binding LbAutoPortConnecting}" IsChecked="{Binding Path=IsAutomaticPortConnectingEnabled}" Click="automaticPortConnecting_Click" ToolTip="{Binding LbAutoPortConnectingTT}"/> <CheckBox x:Name="automaticPortConnecting" d:Content="Automatic port connecting" Content="{Binding LbAutoPortConnecting}" IsChecked="{Binding Path=IsAutomaticPortConnectingEnabled}" Click="automaticPortConnecting_Click" ToolTip="{Binding LbAutoPortConnectingTT}"/>
<CheckBox x:Name="exitWithSinmai" Content="{Binding LbExitWithSinmai}" d:Content="Exit with Sinmai" IsChecked="{Binding IsExitWithSinmaiEnabled}" Click="exitWithSinmai_Click" ToolTip="{Binding LbExitWithSinmaiTT}"/> <CheckBox x:Name="exitWithSinmai" Content="{Binding LbExitWithSinmai}" d:Content="Exit with Sinmai" IsChecked="{Binding IsExitWithSinmaiEnabled}" Click="exitWithSinmai_Click" ToolTip="{Binding LbExitWithSinmaiTT}"/>
<CheckBox x:Name="emulateRingButtons" Content="{Binding LbEmulateRingButtons}" d:Content="Emulate ring buttons" IsChecked="{Binding IsRingButtonEmulationEnabled}" ToolTip="{Binding LbEmulateRingButtonsTT}" Click="emulateRingButtons_Click"/> <CheckBox x:Name="emulateRingButtons" Content="{Binding LbEmulateRingButtons}" d:Content="Emulate ring buttons" IsChecked="{Binding IsRingButtonEmulationEnabled}" ToolTip="{Binding LbEmulateRingButtonsTT}" Click="emulateRingButtons_Click"/>
<ui:Button x:Name="openLogFolderButton" Content="{Binding LbOpenLogFolder}" d:Content="Open log folder" Click="openLogFolderButton_Click" />
</StackPanel> </StackPanel>
</ui:CardExpander> </ui:CardExpander>
<ui:Card>
<StackPanel>
<TextBlock Text="{Binding LbAbout}" d:Text="About" Margin="0,0,0,10"/>
<ui:Anchor
Margin="0"
Padding="16"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Background="Transparent"
BorderThickness="0,1,0,0"
CornerRadius="0"
NavigateUri="https://github.com/Leapward-Koex/MaiTouchSensorEmulator">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="Github" />
<ui:SymbolIcon Grid.Column="1" Symbol="WindowNew20" />
</Grid>
</ui:Anchor>
<Label Content="{Binding LbAppVersion}" d:Content="1.0.0.0"/>
<Label Content="By Leapward-Koex"/>
</StackPanel>
</ui:Card>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>

View File

@ -1,4 +1,5 @@
using System.Diagnostics; using System.Diagnostics;
using System.Reflection;
using System.Windows; using System.Windows;
using WpfMaiTouchEmulator.Managers; using WpfMaiTouchEmulator.Managers;
@ -29,6 +30,7 @@ public partial class MainWindow : Window
IsExitWithSinmaiEnabled = Properties.Settings.Default.IsExitWithSinmaiEnabled, IsExitWithSinmaiEnabled = Properties.Settings.Default.IsExitWithSinmaiEnabled,
IsRingButtonEmulationEnabled = Properties.Settings.Default.IsRingButtonEmulationEnabled, IsRingButtonEmulationEnabled = Properties.Settings.Default.IsRingButtonEmulationEnabled,
BorderColour = Properties.Settings.Default.BorderColour, BorderColour = Properties.Settings.Default.BorderColour,
LbAppVersion = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "1.0.0.0",
}; };
LoadBorderRadioButtonSetting(); LoadBorderRadioButtonSetting();
@ -312,4 +314,9 @@ public partial class MainWindow : Window
_touchPanel?.SetBorderMode(BorderSetting.Solid, textWithHash); _touchPanel?.SetBorderMode(BorderSetting.Solid, textWithHash);
} }
} }
private void openLogFolderButton_Click(object sender, RoutedEventArgs e)
{
Process.Start("explorer.exe", Logger.GetLogPath());
}
} }

View File

@ -44,6 +44,18 @@ public class MainWindowViewModel : INotifyPropertyChanged
{ {
get; set; get; set;
} }
public string? LbOpenLogFolder
{
get; set;
}
public string? LbAppVersion
{
get; set;
}
public string? LbAbout
{
get; set;
}
public string? LbInstallComPort public string? LbInstallComPort
{ {
get; set; get; set;
@ -339,6 +351,9 @@ public class MainWindowViewModel : INotifyPropertyChanged
LbDebugMode = resourceManager.GetString("lbDebugMode"); LbDebugMode = resourceManager.GetString("lbDebugMode");
LbExitWithSinmai = resourceManager.GetString("lbExitWithSinmai"); LbExitWithSinmai = resourceManager.GetString("lbExitWithSinmai");
LbEmulateRingButtons = resourceManager.GetString("lbEmulateRingButtons"); LbEmulateRingButtons = resourceManager.GetString("lbEmulateRingButtons");
LbOpenLogFolder = resourceManager.GetString("LbOpenLogFolder");
LbAbout = resourceManager.GetString("LbAbout");
LbInstallComPort = resourceManager.GetString("lbInstallComPort"); LbInstallComPort = resourceManager.GetString("lbInstallComPort");
LbLanguageDropdown = resourceManager.GetString("lbLanguageDropdown"); LbLanguageDropdown = resourceManager.GetString("lbLanguageDropdown");

View File

@ -60,6 +60,15 @@ namespace WpfMaiTouchEmulator.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to About.
/// </summary>
internal static string LbAbout {
get {
return ResourceManager.GetString("LbAbout", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Automatic port connecting. /// Looks up a localized string similar to Automatic port connecting.
/// </summary> /// </summary>
@ -267,6 +276,15 @@ namespace WpfMaiTouchEmulator.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Open log folder.
/// </summary>
internal static string LbOpenLogFolder {
get {
return ResourceManager.GetString("LbOpenLogFolder", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Received. /// Looks up a localized string similar to Received.
/// </summary> /// </summary>

View File

@ -117,6 +117,9 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="LbAbout" xml:space="preserve">
<value>について</value>
</data>
<data name="lbAutoPortConnecting" xml:space="preserve"> <data name="lbAutoPortConnecting" xml:space="preserve">
<value>自動ポート接続</value> <value>自動ポート接続</value>
</data> </data>
@ -186,6 +189,9 @@
<data name="lbMenuItemSetup" xml:space="preserve"> <data name="lbMenuItemSetup" xml:space="preserve">
<value>セットアップ指示を表示</value> <value>セットアップ指示を表示</value>
</data> </data>
<data name="LbOpenLogFolder" xml:space="preserve">
<value>ログフォルダを開く</value>
</data>
<data name="lbRecievedData" xml:space="preserve"> <data name="lbRecievedData" xml:space="preserve">
<value>受信データ</value> <value>受信データ</value>
</data> </data>

View File

@ -117,6 +117,9 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="LbAbout" xml:space="preserve">
<value>About</value>
</data>
<data name="lbAutoPortConnecting" xml:space="preserve"> <data name="lbAutoPortConnecting" xml:space="preserve">
<value>Automatic port connecting</value> <value>Automatic port connecting</value>
</data> </data>
@ -186,6 +189,9 @@
<data name="lbMenuItemSetup" xml:space="preserve"> <data name="lbMenuItemSetup" xml:space="preserve">
<value>Show setup instructions</value> <value>Show setup instructions</value>
</data> </data>
<data name="LbOpenLogFolder" xml:space="preserve">
<value>Open log folder</value>
</data>
<data name="lbRecievedData" xml:space="preserve"> <data name="lbRecievedData" xml:space="preserve">
<value>Received</value> <value>Received</value>
</data> </data>

View File

@ -117,6 +117,9 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="LbAbout" xml:space="preserve">
<value>关于</value>
</data>
<data name="lbAutoPortConnecting" xml:space="preserve"> <data name="lbAutoPortConnecting" xml:space="preserve">
<value>自动连接端口</value> <value>自动连接端口</value>
</data> </data>
@ -186,6 +189,9 @@
<data name="lbMenuItemSetup" xml:space="preserve"> <data name="lbMenuItemSetup" xml:space="preserve">
<value>显示设置说明</value> <value>显示设置说明</value>
</data> </data>
<data name="LbOpenLogFolder" xml:space="preserve">
<value>打开日志文件夹</value>
</data>
<data name="lbRecievedData" xml:space="preserve"> <data name="lbRecievedData" xml:space="preserve">
<value>已接收数据</value> <value>已接收数据</value>
</data> </data>