add:兼容性变更提示
This commit is contained in:
@@ -624,6 +624,65 @@
|
|||||||
</ikw:SimpleStackPanel>
|
</ikw:SimpleStackPanel>
|
||||||
</ikw:SimpleStackPanel>
|
</ikw:SimpleStackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
<Border x:Name="Net472CompatibilityWarningPanel"
|
||||||
|
Background="#FFFFF4C2"
|
||||||
|
BorderBrush="#FFF0C24B"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="10"
|
||||||
|
Padding="14,12"
|
||||||
|
Margin="0,14,0,0"
|
||||||
|
Visibility="Collapsed">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="0"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Foreground="#FF2A2A2A"
|
||||||
|
FontSize="14"
|
||||||
|
Text="此版本为最后一个基于.net framework 4.7.2版本,您需要手动确认才能继续接受自动更新。" />
|
||||||
|
<Button Grid.Column="1"
|
||||||
|
Margin="14,0,0,0"
|
||||||
|
Padding="18,6"
|
||||||
|
MinWidth="92"
|
||||||
|
Click="ConfirmNetCompatibilityChangeButton_Click"
|
||||||
|
Background="#FFF0C24B"
|
||||||
|
BorderBrush="#FFE0A800"
|
||||||
|
Foreground="#FF1F1F1F"
|
||||||
|
Content="确认">
|
||||||
|
<Button.Template>
|
||||||
|
<ControlTemplate TargetType="{x:Type Button}">
|
||||||
|
<Border x:Name="Bd"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="8"
|
||||||
|
SnapsToDevicePixels="True">
|
||||||
|
<ContentPresenter HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
RecognizesAccessKey="True"
|
||||||
|
Margin="{TemplateBinding Padding}" />
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter TargetName="Bd" Property="Background" Value="#FFE9B53C" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="True">
|
||||||
|
<Setter TargetName="Bd" Property="Background" Value="#FFDCA628" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter TargetName="Bd" Property="Background" Value="#FFE7E7E7" />
|
||||||
|
<Setter Property="Foreground" Value="#FF7A7A7A" />
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Button.Template>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<GroupBox Name="GroupBoxModeSettings">
|
<GroupBox Name="GroupBoxModeSettings">
|
||||||
<GroupBox.Header>
|
<GroupBox.Header>
|
||||||
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=Settings_Mode}" FontWeight="Bold" Foreground="#fafafa"
|
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=Settings_Mode}" FontWeight="Bold" Foreground="#fafafa"
|
||||||
|
|||||||
@@ -1180,6 +1180,7 @@ namespace Ink_Canvas
|
|||||||
loadPenCanvas();
|
loadPenCanvas();
|
||||||
//加载设置
|
//加载设置
|
||||||
LoadSettings(true);
|
LoadSettings(true);
|
||||||
|
ShowNetCompatibilityChangePromptIfNeeded();
|
||||||
ApplyLanguageFromSettings();
|
ApplyLanguageFromSettings();
|
||||||
AutoBackupManager.Initialize(Settings);
|
AutoBackupManager.Initialize(Settings);
|
||||||
CheckUpdateChannelAndTelemetryConsistency();
|
CheckUpdateChannelAndTelemetryConsistency();
|
||||||
@@ -1501,6 +1502,27 @@ namespace Ink_Canvas
|
|||||||
AddTouchSupportToSliders();
|
AddTouchSupportToSliders();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ShowNetCompatibilityChangePromptIfNeeded()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Settings?.Startup?.HasConfirmedNetCompatibilityChange == true)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageBox.Show(
|
||||||
|
"下个版本将更换.NET6,请前往设置确认以便继续使用自动更新",
|
||||||
|
"兼容性变更",
|
||||||
|
MessageBoxButton.OK,
|
||||||
|
MessageBoxImage.Warning);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogToFile($"兼容性变更提示弹窗失败: {ex.Message}", LogHelper.LogType.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ApplyLanguageFromSettings()
|
private void ApplyLanguageFromSettings()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -1917,6 +1939,12 @@ namespace Ink_Canvas
|
|||||||
|
|
||||||
private async void AutoUpdate()
|
private async void AutoUpdate()
|
||||||
{
|
{
|
||||||
|
if (Settings?.Startup?.HasConfirmedNetCompatibilityChange != true)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogToFile("AutoUpdate | 自动更新已暂停:未确认兼容性变更(NET472 -> .NET6)", LogHelper.LogType.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Settings.Startup.AutoUpdatePauseUntilDate))
|
if (!string.IsNullOrEmpty(Settings.Startup.AutoUpdatePauseUntilDate))
|
||||||
{
|
{
|
||||||
if (DateTime.TryParse(Settings.Startup.AutoUpdatePauseUntilDate, out DateTime pauseUntilDate))
|
if (DateTime.TryParse(Settings.Startup.AutoUpdatePauseUntilDate, out DateTime pauseUntilDate))
|
||||||
|
|||||||
@@ -617,6 +617,18 @@ namespace Ink_Canvas
|
|||||||
private void ToggleSwitchIsAutoUpdate_Toggled(object sender, RoutedEventArgs e)
|
private void ToggleSwitchIsAutoUpdate_Toggled(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!isLoaded) return;
|
if (!isLoaded) return;
|
||||||
|
|
||||||
|
if (ToggleSwitchIsAutoUpdate.IsOn && Settings?.Startup?.HasConfirmedNetCompatibilityChange != true)
|
||||||
|
{
|
||||||
|
ToggleSwitchIsAutoUpdate.IsOn = false;
|
||||||
|
MessageBox.Show(
|
||||||
|
"此版本为最后一个NET472版本,您需要手动确认才能继续接受自动更新。",
|
||||||
|
"兼容性变更",
|
||||||
|
MessageBoxButton.OK,
|
||||||
|
MessageBoxImage.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Settings.Startup.IsAutoUpdate = ToggleSwitchIsAutoUpdate.IsOn;
|
Settings.Startup.IsAutoUpdate = ToggleSwitchIsAutoUpdate.IsOn;
|
||||||
|
|
||||||
// 自动更新关闭时隐藏静默更新选项
|
// 自动更新关闭时隐藏静默更新选项
|
||||||
@@ -651,6 +663,18 @@ namespace Ink_Canvas
|
|||||||
private void ToggleSwitchIsAutoUpdateWithSilence_Toggled(object sender, RoutedEventArgs e)
|
private void ToggleSwitchIsAutoUpdateWithSilence_Toggled(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!isLoaded) return;
|
if (!isLoaded) return;
|
||||||
|
|
||||||
|
if (ToggleSwitchIsAutoUpdateWithSilence.IsOn && Settings?.Startup?.HasConfirmedNetCompatibilityChange != true)
|
||||||
|
{
|
||||||
|
ToggleSwitchIsAutoUpdateWithSilence.IsOn = false;
|
||||||
|
MessageBox.Show(
|
||||||
|
"此版本为最后一个NET472版本,您需要手动确认才能继续接受自动更新。",
|
||||||
|
"兼容性变更",
|
||||||
|
MessageBoxButton.OK,
|
||||||
|
MessageBoxImage.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Settings.Startup.IsAutoUpdateWithSilence = ToggleSwitchIsAutoUpdateWithSilence.IsOn;
|
Settings.Startup.IsAutoUpdateWithSilence = ToggleSwitchIsAutoUpdateWithSilence.IsOn;
|
||||||
|
|
||||||
// 静默更新的时间设置区域只在静默更新开启时显示
|
// 静默更新的时间设置区域只在静默更新开启时显示
|
||||||
@@ -5303,7 +5327,7 @@ namespace Ink_Canvas
|
|||||||
SaveSettingsToFile();
|
SaveSettingsToFile();
|
||||||
|
|
||||||
// 如果启用了自动更新,立即执行完整的检查更新操作
|
// 如果启用了自动更新,立即执行完整的检查更新操作
|
||||||
if (Settings.Startup.IsAutoUpdate)
|
if (Settings.Startup.IsAutoUpdate && Settings.Startup.HasConfirmedNetCompatibilityChange)
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogToFile($"AutoUpdate | Channel changed to {newChannel}, performing immediate update check");
|
LogHelper.WriteLogToFile($"AutoUpdate | Channel changed to {newChannel}, performing immediate update check");
|
||||||
ResetUpdateCheckRetry();
|
ResetUpdateCheckRetry();
|
||||||
@@ -5332,6 +5356,39 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ConfirmNetCompatibilityChangeButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Settings?.Startup == null)
|
||||||
|
{
|
||||||
|
Settings.Startup = new Startup();
|
||||||
|
}
|
||||||
|
|
||||||
|
Settings.Startup.HasConfirmedNetCompatibilityChange = true;
|
||||||
|
SaveSettingsToFile();
|
||||||
|
|
||||||
|
if (Net472CompatibilityWarningPanel != null)
|
||||||
|
{
|
||||||
|
Net472CompatibilityWarningPanel.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ToggleSwitchIsAutoUpdate != null)
|
||||||
|
{
|
||||||
|
ToggleSwitchIsAutoUpdate.IsEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ToggleSwitchIsAutoUpdateWithSilence != null)
|
||||||
|
{
|
||||||
|
ToggleSwitchIsAutoUpdateWithSilence.IsEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogToFile($"确认兼容性变更失败: {ex.Message}", LogHelper.LogType.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async void ManualUpdateButton_Click(object sender, RoutedEventArgs e)
|
private async void ManualUpdateButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ManualUpdateButton.IsEnabled = false;
|
ManualUpdateButton.IsEnabled = false;
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ namespace Ink_Canvas
|
|||||||
ToggleSwitchIsAutoUpdate.IsOn = Settings.Startup.IsAutoUpdate;
|
ToggleSwitchIsAutoUpdate.IsOn = Settings.Startup.IsAutoUpdate;
|
||||||
|
|
||||||
// 只有在启用了自动更新功能时才检查更新
|
// 只有在启用了自动更新功能时才检查更新
|
||||||
if (Settings.Startup.IsAutoUpdate && !skipAutoUpdateCheck)
|
if (Settings.Startup.IsAutoUpdate && Settings.Startup.HasConfirmedNetCompatibilityChange && !skipAutoUpdateCheck)
|
||||||
{
|
{
|
||||||
if (isStartup)
|
if (isStartup)
|
||||||
{
|
{
|
||||||
@@ -288,6 +288,8 @@ namespace Ink_Canvas
|
|||||||
ToggleSwitchIsAutoUpdateWithSilence.IsOn = true;
|
ToggleSwitchIsAutoUpdateWithSilence.IsOn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApplyNetCompatibilityConfirmationGateToUpdateSettingsUi();
|
||||||
|
|
||||||
// 初始化更新通道选择
|
// 初始化更新通道选择
|
||||||
foreach (var radioButton in UpdateChannelSelector.Items)
|
foreach (var radioButton in UpdateChannelSelector.Items)
|
||||||
{
|
{
|
||||||
@@ -1317,6 +1319,26 @@ namespace Ink_Canvas
|
|||||||
try { RefreshConfigProfileList(); } catch (Exception ex) { LogHelper.WriteLogToFile($"刷新配置文件列表失败: {ex.Message}", LogHelper.LogType.Warning); }
|
try { RefreshConfigProfileList(); } catch (Exception ex) { LogHelper.WriteLogToFile($"刷新配置文件列表失败: {ex.Message}", LogHelper.LogType.Warning); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ApplyNetCompatibilityConfirmationGateToUpdateSettingsUi()
|
||||||
|
{
|
||||||
|
bool confirmed = Settings?.Startup?.HasConfirmedNetCompatibilityChange == true;
|
||||||
|
|
||||||
|
if (Net472CompatibilityWarningPanel != null)
|
||||||
|
{
|
||||||
|
Net472CompatibilityWarningPanel.Visibility = confirmed ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ToggleSwitchIsAutoUpdate != null)
|
||||||
|
{
|
||||||
|
ToggleSwitchIsAutoUpdate.IsEnabled = confirmed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ToggleSwitchIsAutoUpdateWithSilence != null)
|
||||||
|
{
|
||||||
|
ToggleSwitchIsAutoUpdateWithSilence.IsEnabled = confirmed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 将画笔自动恢复相关的设置应用到界面控件并在启用时初始化自动恢复定时器。
|
/// 将画笔自动恢复相关的设置应用到界面控件并在启用时初始化自动恢复定时器。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -250,6 +250,8 @@ namespace Ink_Canvas
|
|||||||
public bool HasAcceptedTelemetryPrivacy { get; set; } = false;
|
public bool HasAcceptedTelemetryPrivacy { get; set; } = false;
|
||||||
[JsonProperty("hasShownOobe")]
|
[JsonProperty("hasShownOobe")]
|
||||||
public bool HasShownOobe { get; set; } = false;
|
public bool HasShownOobe { get; set; } = false;
|
||||||
|
[JsonProperty("hasConfirmedNetCompatibilityChange")]
|
||||||
|
public bool HasConfirmedNetCompatibilityChange { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Appearance
|
public class Appearance
|
||||||
|
|||||||
Reference in New Issue
Block a user