From f9f4e20c65a8179514acb22b3529d6ded02d70c7 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] =?UTF-8?q?feat(=E5=85=B3=E4=BA=8E=E9=9D=A2=E6=9D=BF):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=8D=E9=A6=88=E9=97=AE=E9=A2=98=E6=8C=89?= =?UTF-8?q?=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 @@ namespace Ink_Canvas.Windows.SettingsViews } } + 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}"); + } + } + /// /// 应用主题 ///