add:Dlass遥测
This commit is contained in:
@@ -3894,6 +3894,22 @@
|
|||||||
<Button x:Name="RefreshDeviceInfoButton" Content="刷新设备信息"
|
<Button x:Name="RefreshDeviceInfoButton" Content="刷新设备信息"
|
||||||
Width="120" Height="30" Margin="0,8,0,0"
|
Width="120" Height="30" Margin="0,8,0,0"
|
||||||
Click="RefreshDeviceInfo_Click" />
|
Click="RefreshDeviceInfo_Click" />
|
||||||
|
|
||||||
|
<Line X1="0" Y1="0" X2="460" Y2="0" Stroke="#3f3f46"
|
||||||
|
StrokeThickness="1" Margin="0,6,0,6" />
|
||||||
|
|
||||||
|
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||||
|
<TextBlock Text="匿名使用数据上传:" Foreground="#a1a1aa" FontSize="12"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
<ComboBox x:Name="ComboBoxTelemetryUploadLevel"
|
||||||
|
Width="160"
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
SelectionChanged="ComboBoxTelemetryUploadLevel_SelectionChanged">
|
||||||
|
<ComboBoxItem Tag="0">关闭(不上传)</ComboBoxItem>
|
||||||
|
<ComboBoxItem Tag="1">上传基础数据</ComboBoxItem>
|
||||||
|
<ComboBoxItem Tag="2">上传基础 + 可选数据</ComboBoxItem>
|
||||||
|
</ComboBox>
|
||||||
|
</ui:SimpleStackPanel>
|
||||||
</ui:SimpleStackPanel>
|
</ui:SimpleStackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,30 @@ namespace Ink_Canvas
|
|||||||
{
|
{
|
||||||
#region Behavior
|
#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)
|
private void ToggleSwitchIsAutoUpdate_Toggled(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!isLoaded) return;
|
if (!isLoaded) return;
|
||||||
|
|||||||
@@ -142,6 +142,34 @@ namespace Ink_Canvas
|
|||||||
CursorIcon_Click(null, null);
|
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
|
try
|
||||||
{
|
{
|
||||||
if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) +
|
if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) +
|
||||||
|
|||||||
@@ -146,6 +146,25 @@ namespace Ink_Canvas
|
|||||||
Beta
|
Beta
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 遥测上传等级
|
||||||
|
/// </summary>
|
||||||
|
public enum TelemetryUploadLevel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 不上传任何匿名使用数据
|
||||||
|
/// </summary>
|
||||||
|
None = 0,
|
||||||
|
/// <summary>
|
||||||
|
/// 仅上传基础数据
|
||||||
|
/// </summary>
|
||||||
|
Basic = 1,
|
||||||
|
/// <summary>
|
||||||
|
/// 上传基础数据 + 可选数据
|
||||||
|
/// </summary>
|
||||||
|
Extended = 2
|
||||||
|
}
|
||||||
|
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
[JsonProperty("isAutoUpdate")]
|
[JsonProperty("isAutoUpdate")]
|
||||||
@@ -168,6 +187,8 @@ namespace Ink_Canvas
|
|||||||
public bool IsFoldAtStartup { get; set; }
|
public bool IsFoldAtStartup { get; set; }
|
||||||
[JsonProperty("crashAction")]
|
[JsonProperty("crashAction")]
|
||||||
public int CrashAction { get; set; }
|
public int CrashAction { get; set; }
|
||||||
|
[JsonProperty("telemetryUploadLevel")]
|
||||||
|
public TelemetryUploadLevel TelemetryUploadLevel { get; set; } = TelemetryUploadLevel.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Appearance
|
public class Appearance
|
||||||
|
|||||||
Reference in New Issue
Block a user