feat(反馈): 添加反馈窗口替代直接打开链接

重构关于面板的反馈功能,将直接打开GitHub问题链接改为显示一个反馈窗口。用户可以在窗口中自定义包含哪些系统信息。
This commit is contained in:
doudou0720
2026-03-21 23:28:41 +08:00
parent f9f4e20c65
commit 956f3b12ac
3 changed files with 267 additions and 87 deletions
@@ -464,96 +464,12 @@ namespace Ink_Canvas.Windows.SettingsViews
{
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}");
}
}