From ce4b83dbe04c4ae159c9c46361da7a8a7cdbe38c Mon Sep 17 00:00:00 2001
From: CJKmkp <2564608840@qq.com>
Date: Fri, 6 Feb 2026 23:00:57 +0800
Subject: [PATCH] =?UTF-8?q?add:Dlass=E9=81=A5=E6=B5=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Ink Canvas/MainWindow.xaml | 16 +++++++++++
Ink Canvas/MainWindow_cs/MW_Settings.cs | 24 ++++++++++++++++
Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs | 28 +++++++++++++++++++
Ink Canvas/Resources/Settings.cs | 21 ++++++++++++++
4 files changed, 89 insertions(+)
diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml
index 16704010..9dfe361b 100644
--- a/Ink Canvas/MainWindow.xaml
+++ b/Ink Canvas/MainWindow.xaml
@@ -3894,6 +3894,22 @@
+
+
+
+
+
+
+ 关闭(不上传)
+ 上传基础数据
+ 上传基础 + 可选数据
+
+
diff --git a/Ink Canvas/MainWindow_cs/MW_Settings.cs b/Ink Canvas/MainWindow_cs/MW_Settings.cs
index 5d3e8222..683ce024 100644
--- a/Ink Canvas/MainWindow_cs/MW_Settings.cs
+++ b/Ink Canvas/MainWindow_cs/MW_Settings.cs
@@ -30,6 +30,30 @@ namespace Ink_Canvas
{
#region Behavior
+ private void ComboBoxTelemetryUploadLevel_SelectionChanged(object sender, RoutedEventArgs e)
+ {
+ if (!isLoaded) return;
+ var item = ComboBoxTelemetryUploadLevel?.SelectedItem as ComboBoxItem;
+ if (item == null) return;
+
+ var tag = item.Tag?.ToString() ?? "0";
+ switch (tag)
+ {
+ case "1":
+ Settings.Startup.TelemetryUploadLevel = TelemetryUploadLevel.Basic;
+ break;
+ case "2":
+ Settings.Startup.TelemetryUploadLevel = TelemetryUploadLevel.Extended;
+ break;
+ default:
+ Settings.Startup.TelemetryUploadLevel = TelemetryUploadLevel.None;
+ break;
+ }
+
+ SaveSettingsToFile();
+ ShowNotification("匿名使用数据上传设置已保存");
+ }
+
private void ToggleSwitchIsAutoUpdate_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
diff --git a/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs b/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs
index 0f3de7e1..66fe6b9a 100644
--- a/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs
+++ b/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs
@@ -142,6 +142,34 @@ namespace Ink_Canvas
CursorIcon_Click(null, null);
}
+ try
+ {
+ if (ComboBoxTelemetryUploadLevel != null && Settings?.Startup != null)
+ {
+ int idx = 0;
+ switch (Settings.Startup.TelemetryUploadLevel)
+ {
+ case TelemetryUploadLevel.None:
+ idx = 0;
+ break;
+ case TelemetryUploadLevel.Basic:
+ idx = 1;
+ break;
+ case TelemetryUploadLevel.Extended:
+ idx = 2;
+ break;
+ default:
+ idx = 0;
+ break;
+ }
+
+ ComboBoxTelemetryUploadLevel.SelectedIndex = idx;
+ }
+ }
+ catch
+ {
+ }
+
try
{
if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) +
diff --git a/Ink Canvas/Resources/Settings.cs b/Ink Canvas/Resources/Settings.cs
index cc34cf62..4bc255a2 100644
--- a/Ink Canvas/Resources/Settings.cs
+++ b/Ink Canvas/Resources/Settings.cs
@@ -146,6 +146,25 @@ namespace Ink_Canvas
Beta
}
+ ///
+ /// 遥测上传等级
+ ///
+ public enum TelemetryUploadLevel
+ {
+ ///
+ /// 不上传任何匿名使用数据
+ ///
+ None = 0,
+ ///
+ /// 仅上传基础数据
+ ///
+ Basic = 1,
+ ///
+ /// 上传基础数据 + 可选数据
+ ///
+ Extended = 2
+ }
+
public class Startup
{
[JsonProperty("isAutoUpdate")]
@@ -168,6 +187,8 @@ namespace Ink_Canvas
public bool IsFoldAtStartup { get; set; }
[JsonProperty("crashAction")]
public int CrashAction { get; set; }
+ [JsonProperty("telemetryUploadLevel")]
+ public TelemetryUploadLevel TelemetryUploadLevel { get; set; } = TelemetryUploadLevel.None;
}
public class Appearance