From 4d4bc7590ad616bbc4e52fe4d489b4dfb1f3cb76 Mon Sep 17 00:00:00 2001 From: doudou0720 <98651603+doudou0720@users.noreply.github.com> Date: Sat, 21 Mar 2026 23:17:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(=E5=85=B3=E4=BA=8E=E9=9D=A2=E6=9D=BF):?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E5=8F=8D=E9=A6=88=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=8F=8A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在关于面板中添加反馈问题按钮,点击后收集系统信息并跳转到GitHub问题提交页面 Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com> --- .../SettingsViews/AboutPanel.xaml | 35 +++++++ .../SettingsViews/AboutPanel.xaml.cs | 97 +++++++++++++++++++ 2 files changed, 132 insertions(+) diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml index e9accf11..c49eece4 100644 --- a/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml +++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml @@ -178,6 +178,41 @@ + + + + + + + diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs index 7d56337f..db84b8e0 100644 --- a/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs @@ -460,6 +460,103 @@ private void LinkContributors_MouseLeftButtonDown(object sender, MouseButtonEven } } + private void BtnReportIssue_Click(object sender, RoutedEventArgs e) + { + try + { + string version = ""; + string updateChannel = ""; + string osInfo = ""; + string netVersion = ""; + string touchSupport = ""; + + try + { + var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version; + version = $"v{assemblyVersion}"; + } + catch (Exception ex) + { + version = "未知"; + System.Diagnostics.Debug.WriteLine($"获取软件版本失败: {ex.Message}"); + } + + try + { + if (MainWindow.Settings?.Startup != null) + { + updateChannel = MainWindow.Settings.Startup.UpdateChannel.ToString(); + } + } + catch (Exception ex) + { + updateChannel = "未知"; + System.Diagnostics.Debug.WriteLine($"获取更新通道失败: {ex.Message}"); + } + + try + { + osInfo = $"{OSVersion.GetOperatingSystem()} {OSVersion.GetOSVersion().Version}"; + } + catch (Exception ex) + { + osInfo = "未知"; + System.Diagnostics.Debug.WriteLine($"获取系统版本失败: {ex.Message}"); + } + + try + { + netVersion = RuntimeInformation.FrameworkDescription; + } + catch (Exception ex) + { + netVersion = "未知"; + System.Diagnostics.Debug.WriteLine($"获取.NET版本失败: {ex.Message}"); + } + + try + { + var support = TouchTabletDetectHelper.IsTouchEnabled(); + var touchcount = TouchTabletDetectHelper.GetTouchTabletDevices().Count; + if (support) + { + if (touchcount > 0) + { + touchSupport = $"支持({touchcount}个设备)"; + } + else + { + touchSupport = "支持"; + } + } + else + { + touchSupport = "不支持"; + } + } + catch (Exception ex) + { + touchSupport = "未知"; + System.Diagnostics.Debug.WriteLine($"获取触控支持失败: {ex.Message}"); + } + + string versionInfo = $"{version} ({updateChannel})"; + string systemInfo = $"{osInfo} | {netVersion} | 触控:{touchSupport}"; + + string url = $"https://github.com/InkCanvasForClass/community/issues/new?template=01-bug_report.yml&version={Uri.EscapeDataString(versionInfo)}&os={Uri.EscapeDataString(systemInfo)}"; + + Process.Start(new ProcessStartInfo + { + FileName = url, + UseShellExecute = true + }); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine($"打开反馈链接失败: {ex.Message}"); + } + } + /// /// 应用主题 /// From a2edb47e59abad1fa158662083290de8da5c750a Mon Sep 17 00:00:00 2001 From: doudou0720 <98651603+doudou0720@users.noreply.github.com> Date: Sat, 21 Mar 2026 23:28:41 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat(=E5=8F=8D=E9=A6=88):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8F=8D=E9=A6=88=E7=AA=97=E5=8F=A3=E6=9B=BF=E4=BB=A3?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E6=89=93=E5=BC=80=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构关于面板的反馈功能,将直接打开GitHub问题链接改为显示一个反馈窗口。用户可以在窗口中自定义包含哪些系统信息。 --- Ink Canvas/Windows/FeedbackWindow.xaml | 64 ++++++ Ink Canvas/Windows/FeedbackWindow.xaml.cs | 200 ++++++++++++++++++ .../SettingsViews/AboutPanel.xaml.cs | 90 +------- 3 files changed, 267 insertions(+), 87 deletions(-) create mode 100644 Ink Canvas/Windows/FeedbackWindow.xaml create mode 100644 Ink Canvas/Windows/FeedbackWindow.xaml.cs diff --git a/Ink Canvas/Windows/FeedbackWindow.xaml b/Ink Canvas/Windows/FeedbackWindow.xaml new file mode 100644 index 00000000..5a19e1b1 --- /dev/null +++ b/Ink Canvas/Windows/FeedbackWindow.xaml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ink Canvas/Windows/FeedbackWindow.xaml.cs b/Ink Canvas/Windows/FeedbackWindow.xaml.cs new file mode 100644 index 00000000..973510b4 --- /dev/null +++ b/Ink Canvas/Windows/FeedbackWindow.xaml.cs @@ -0,0 +1,200 @@ +using Ink_Canvas.Helpers; +using OSVersionExtension; +using System; +using System.Diagnostics; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; + +namespace Ink_Canvas +{ + public partial class FeedbackWindow : Window + { + private string _appVersion = ""; + private string _updateChannel = ""; + private string _osVersion = ""; + private string _netVersion = ""; + private string _touchSupport = ""; + private string _deviceId = ""; + + public FeedbackWindow() + { + InitializeComponent(); + LoadInformation(); + UpdatePreviewText(); + } + + private void LoadInformation() + { + try + { + var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version; + _appVersion = $"v{assemblyVersion}"; + } + catch (Exception ex) + { + _appVersion = "未知"; + System.Diagnostics.Debug.WriteLine($"获取软件版本失败: {ex.Message}"); + } + + try + { + if (MainWindow.Settings?.Startup != null) + { + _updateChannel = MainWindow.Settings.Startup.UpdateChannel.ToString(); + } + } + catch (Exception ex) + { + _updateChannel = "未知"; + System.Diagnostics.Debug.WriteLine($"获取更新通道失败: {ex.Message}"); + } + + try + { + _osVersion = $"{OSVersion.GetOperatingSystem()} {OSVersion.GetOSVersion().Version}"; + } + catch (Exception ex) + { + _osVersion = "未知"; + System.Diagnostics.Debug.WriteLine($"获取系统版本失败: {ex.Message}"); + } + + try + { + _netVersion = RuntimeInformation.FrameworkDescription; + } + catch (Exception ex) + { + _netVersion = "未知"; + System.Diagnostics.Debug.WriteLine($"获取.NET版本失败: {ex.Message}"); + } + + try + { + var support = Ink_Canvas.Windows.SettingsViews.AboutPanel.TouchTabletDetectHelper.IsTouchEnabled(); + var touchcount = Ink_Canvas.Windows.SettingsViews.AboutPanel.TouchTabletDetectHelper.GetTouchTabletDevices().Count; + if (support) + { + if (touchcount > 0) + { + _touchSupport = $"支持({touchcount}个设备)"; + } + else + { + _touchSupport = "支持"; + } + } + else + { + _touchSupport = "不支持"; + } + } + catch (Exception ex) + { + _touchSupport = "未知"; + System.Diagnostics.Debug.WriteLine($"获取触控支持失败: {ex.Message}"); + } + + try + { + _deviceId = DeviceIdentifier.GetDeviceId(); + } + catch (Exception ex) + { + _deviceId = "获取失败"; + System.Diagnostics.Debug.WriteLine($"获取设备ID失败: {ex.Message}"); + } + } + + private void UpdatePreviewText() + { + TextAppVersionInfo.Text = $"{_appVersion} ({_updateChannel})"; + TextSystemInfo.Text = $"{_osVersion} | {_netVersion} | 触控:{_touchSupport}"; + TextDeviceInfo.Text = $"设备ID: {_deviceId}"; + } + + private void ButtonCancel_Click(object sender, RoutedEventArgs e) + { + Close(); + } + + private void ButtonSubmit_Click(object sender, RoutedEventArgs e) + { + try + { + string versionInfo = ""; + string systemInfo = ""; + + if (CheckBoxAppVersion.IsChecked == true || CheckBoxUpdateChannel.IsChecked == true) + { + if (CheckBoxAppVersion.IsChecked == true) + { + versionInfo += _appVersion; + } + if (CheckBoxUpdateChannel.IsChecked == true) + { + if (!string.IsNullOrEmpty(versionInfo)) + { + versionInfo += " "; + } + versionInfo += $"({_updateChannel})"; + } + } + + if (CheckBoxOSVersion.IsChecked == true || CheckBoxNetVersion.IsChecked == true || CheckBoxTouchSupport.IsChecked == true) + { + if (CheckBoxOSVersion.IsChecked == true) + { + systemInfo += _osVersion; + } + if (CheckBoxNetVersion.IsChecked == true) + { + if (!string.IsNullOrEmpty(systemInfo)) + { + systemInfo += " | "; + } + systemInfo += _netVersion; + } + if (CheckBoxTouchSupport.IsChecked == true) + { + if (!string.IsNullOrEmpty(systemInfo)) + { + systemInfo += " | "; + } + systemInfo += $"触控:{_touchSupport}"; + } + } + + string url = "https://github.com/InkCanvasForClass/community/issues/new?template=01-bug_report.yml"; + + if (!string.IsNullOrEmpty(versionInfo)) + { + url += $"&version={Uri.EscapeDataString(versionInfo)}"; + } + + if (!string.IsNullOrEmpty(systemInfo)) + { + url += $"&os={Uri.EscapeDataString(systemInfo)}"; + } + + if (CheckBoxDeviceId.IsChecked == true) + { + url += $"&device={Uri.EscapeDataString(_deviceId)}"; + } + + Process.Start(new ProcessStartInfo + { + FileName = url, + UseShellExecute = true + }); + + Close(); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine($"打开反馈链接失败: {ex.Message}"); + } + } + } +} diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs index db84b8e0..05d4028b 100644 --- a/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs +++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/AboutPanel.xaml.cs @@ -464,96 +464,12 @@ private void BtnReportIssue_Click(object sender, RoutedEventArgs e) { try { - string version = ""; - string updateChannel = ""; - string osInfo = ""; - string netVersion = ""; - string touchSupport = ""; - - try - { - var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version; - version = $"v{assemblyVersion}"; - } - catch (Exception ex) - { - version = "未知"; - System.Diagnostics.Debug.WriteLine($"获取软件版本失败: {ex.Message}"); - } - - try - { - if (MainWindow.Settings?.Startup != null) - { - updateChannel = MainWindow.Settings.Startup.UpdateChannel.ToString(); - } - } - catch (Exception ex) - { - updateChannel = "未知"; - System.Diagnostics.Debug.WriteLine($"获取更新通道失败: {ex.Message}"); - } - - try - { - osInfo = $"{OSVersion.GetOperatingSystem()} {OSVersion.GetOSVersion().Version}"; - } - catch (Exception ex) - { - osInfo = "未知"; - System.Diagnostics.Debug.WriteLine($"获取系统版本失败: {ex.Message}"); - } - - try - { - netVersion = RuntimeInformation.FrameworkDescription; - } - catch (Exception ex) - { - netVersion = "未知"; - System.Diagnostics.Debug.WriteLine($"获取.NET版本失败: {ex.Message}"); - } - - try - { - var support = TouchTabletDetectHelper.IsTouchEnabled(); - var touchcount = TouchTabletDetectHelper.GetTouchTabletDevices().Count; - if (support) - { - if (touchcount > 0) - { - touchSupport = $"支持({touchcount}个设备)"; - } - else - { - touchSupport = "支持"; - } - } - else - { - touchSupport = "不支持"; - } - } - catch (Exception ex) - { - touchSupport = "未知"; - System.Diagnostics.Debug.WriteLine($"获取触控支持失败: {ex.Message}"); - } - - string versionInfo = $"{version} ({updateChannel})"; - string systemInfo = $"{osInfo} | {netVersion} | 触控:{touchSupport}"; - - string url = $"https://github.com/InkCanvasForClass/community/issues/new?template=01-bug_report.yml&version={Uri.EscapeDataString(versionInfo)}&os={Uri.EscapeDataString(systemInfo)}"; - - Process.Start(new ProcessStartInfo - { - FileName = url, - UseShellExecute = true - }); + var feedbackWindow = new FeedbackWindow(); + feedbackWindow.ShowDialog(); } catch (Exception ex) { - System.Diagnostics.Debug.WriteLine($"打开反馈链接失败: {ex.Message}"); + System.Diagnostics.Debug.WriteLine($"打开反馈窗口失败: {ex.Message}"); } } From 05318099a920cff651cb43905af873e34b4b1641 Mon Sep 17 00:00:00 2001 From: doudou0720 <98651603+doudou0720@users.noreply.github.com> Date: Fri, 27 Mar 2026 23:28:25 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat(FeedBack):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=81=A5=E6=B5=8BID=E6=94=AF=E6=8C=81=E5=B9=B6=E6=94=B9?= =?UTF-8?q?=E8=BF=9BUI=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增遥测ID获取功能及相关UI控制逻辑 - 重构反馈窗口为分页式布局,增加确认页面 - 使用ModernWPF控件改进界面样式和用户体验 - 重命名控件变量以保持命名一致性 Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com> --- Ink Canvas/Windows/FeedbackWindow.xaml | 205 +++++++++++++++++----- Ink Canvas/Windows/FeedbackWindow.xaml.cs | 179 +++++++++++++++++-- 2 files changed, 330 insertions(+), 54 deletions(-) diff --git a/Ink Canvas/Windows/FeedbackWindow.xaml b/Ink Canvas/Windows/FeedbackWindow.xaml index 5a19e1b1..bad65f47 100644 --- a/Ink Canvas/Windows/FeedbackWindow.xaml +++ b/Ink Canvas/Windows/FeedbackWindow.xaml @@ -8,55 +8,178 @@ xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf" mc:Ignorable="d" Topmost="True" WindowStartupLocation="CenterScreen" ui:WindowHelper.UseModernWindowStyle="True" ResizeMode="NoResize" ui:ThemeManager.RequestedTheme="Light" - Title="反馈问题 - Ink Canvas For Class CE" Height="500" Width="600" FontFamily="Microsoft YaHei UI"> - + Title="反馈问题 - Ink Canvas For Class CE" Height="550" Width="650" FontFamily="Microsoft YaHei UI"> + - + - - - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + +