Skip to content

Commit

Permalink
Add about section and button to open log folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Leapward-Koex committed Nov 16, 2024
1 parent 0347c98 commit 3571776
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
30 changes: 29 additions & 1 deletion MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<ScrollViewer>
<StackPanel MaxWidth="400" Margin="0,0,0,50">
<Menu>
Expand Down Expand Up @@ -89,6 +89,7 @@
</ui:CardExpander>
<ui:CardExpander
CornerRadius="8"
Margin="0,0,0,10"
Header="{Binding LbSettings}"
d:Header="Settings">
<ui:CardExpander.Icon>
Expand All @@ -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="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"/>
<ui:Button x:Name="openLogFolderButton" Content="{Binding LbOpenLogFolder}" d:Content="Open log folder" Click="openLogFolderButton_Click" />
</StackPanel>
</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>
</ScrollViewer>

Expand Down
7 changes: 7 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Reflection;
using System.Windows;
using WpfMaiTouchEmulator.Managers;

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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());
}
}
15 changes: 15 additions & 0 deletions MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");

Expand Down
18 changes: 18 additions & 0 deletions Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Resources/Strings.ja-JP.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="LbAbout" xml:space="preserve">
<value>について</value>
</data>
<data name="lbAutoPortConnecting" xml:space="preserve">
<value>自動ポート接続</value>
</data>
Expand Down Expand Up @@ -186,6 +189,9 @@
<data name="lbMenuItemSetup" xml:space="preserve">
<value>セットアップ指示を表示</value>
</data>
<data name="LbOpenLogFolder" xml:space="preserve">
<value>ログフォルダを開く</value>
</data>
<data name="lbRecievedData" xml:space="preserve">
<value>受信データ</value>
</data>
Expand Down
6 changes: 6 additions & 0 deletions Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="LbAbout" xml:space="preserve">
<value>About</value>
</data>
<data name="lbAutoPortConnecting" xml:space="preserve">
<value>Automatic port connecting</value>
</data>
Expand Down Expand Up @@ -186,6 +189,9 @@
<data name="lbMenuItemSetup" xml:space="preserve">
<value>Show setup instructions</value>
</data>
<data name="LbOpenLogFolder" xml:space="preserve">
<value>Open log folder</value>
</data>
<data name="lbRecievedData" xml:space="preserve">
<value>Received</value>
</data>
Expand Down
6 changes: 6 additions & 0 deletions Resources/Strings.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="LbAbout" xml:space="preserve">
<value>关于</value>
</data>
<data name="lbAutoPortConnecting" xml:space="preserve">
<value>自动连接端口</value>
</data>
Expand Down Expand Up @@ -186,6 +189,9 @@
<data name="lbMenuItemSetup" xml:space="preserve">
<value>显示设置说明</value>
</data>
<data name="LbOpenLogFolder" xml:space="preserve">
<value>打开日志文件夹</value>
</data>
<data name="lbRecievedData" xml:space="preserve">
<value>已接收数据</value>
</data>
Expand Down

0 comments on commit 3571776

Please sign in to comment.