diff --git a/src/MeoAsstGui/Resources/Localizations/en-us.xaml b/src/MeoAsstGui/Resources/Localizations/en-us.xaml index 6046de1cf7..aa3a0c20b1 100644 --- a/src/MeoAsstGui/Resources/Localizations/en-us.xaml +++ b/src/MeoAsstGui/Resources/Localizations/en-us.xaml @@ -122,6 +122,7 @@ Auto check update Auto download update + Stable release Beta release Nightly release Download via aria2 diff --git a/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml b/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml index 3019a48f59..06df5a8059 100644 --- a/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml +++ b/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml @@ -122,8 +122,9 @@ 自动检查更新 自动下载更新包 - 检查测试版本更新 - 检查内测版本更新 + 稳定版 + 测试版 + 内测版 使用 aria2 进行下载 检查更新 diff --git a/src/MeoAsstGui/UserControl/VersionUpdateSettingsUserControl.xaml b/src/MeoAsstGui/UserControl/VersionUpdateSettingsUserControl.xaml index 026ec8871c..b4229607bc 100644 --- a/src/MeoAsstGui/UserControl/VersionUpdateSettingsUserControl.xaml +++ b/src/MeoAsstGui/UserControl/VersionUpdateSettingsUserControl.xaml @@ -36,20 +36,23 @@ Content="{DynamicResource UpdateAutoDownload}" IsChecked="{Binding AutoDownloadUpdatePackage}" IsEnabled="{Binding UpdateCheck}" /> - - + Orientation="Horizontal"> + + + + { + new CombData { Display = Localization.GetString("UpdateCheckStable"), Value = "Stable" }, + new CombData { Display = Localization.GetString("UpdateCheckBeta"), Value = "Beta" }, + new CombData { Display = Localization.GetString("UpdateCheckNightly"), Value = "Nightly" }, + }; + LanguageList = new List(); foreach (var pair in Localization.SupportedLanguages) { @@ -494,6 +501,11 @@ namespace MeoAsstGui /// public List InverseClearModeList { get; set; } + /// + /// Gets or sets the list of the version type. + /// + public List VersionTypeList { get; set; } + /// /// Gets or sets the language list. /// @@ -1379,34 +1391,35 @@ namespace MeoAsstGui } /* 软件更新设置 */ - private bool _updateNightly = Convert.ToBoolean(ViewStatusStorage.Get("VersionUpdate.UpdateNightly", bool.FalseString)); + private string _versionType = ViewStatusStorage.Get("VersionUpdate.VersionType", "Stable"); /// - /// Gets or sets a value indicating whether to update nightly. + /// Gets or sets the type of version to update. /// - public bool UpdateNightly + public string VersionType { - get => _updateNightly; + get => _versionType; set { - SetAndNotify(ref _updateNightly, value); - ViewStatusStorage.Set("VersionUpdate.UpdateNightly", value.ToString()); + SetAndNotify(ref _versionType, value); + ViewStatusStorage.Set("VersionUpdate.VersionType", value); } } - private bool _updateBeta = Convert.ToBoolean(ViewStatusStorage.Get("VersionUpdate.UpdateBeta", bool.FalseString)); + /// + /// Gets a value indicating whether to update nightly. + /// + public bool UpdateNightly + { + get => _versionType == "Nightly"; + } /// - /// Gets or sets a value indicating whether to update beta version. + /// Gets a value indicating whether to update beta version. /// public bool UpdateBeta { - get => _updateBeta; - set - { - SetAndNotify(ref _updateBeta, value); - ViewStatusStorage.Set("VersionUpdate.UpdateBeta", value.ToString()); - } + get => _versionType == "Beta"; } private bool _updateCheck = Convert.ToBoolean(ViewStatusStorage.Get("VersionUpdate.UpdateCheck", bool.TrueString)); diff --git a/src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs b/src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs index 06e0f549e6..b688af5cf1 100644 --- a/src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs +++ b/src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs @@ -530,8 +530,15 @@ namespace MeoAsstGui return true; } - var errorView = new ErrorView("Download Failed", "It was not possible to find a suitable OTA file to download.", false); - errorView.ShowDialog(); + Execute.OnUIThread(() => + { + using (var toast = new ToastNotification("找不到合适的更新文件")) + { + toast.AppendContentText("新版本:" + _latestVersion) + .AppendContentText("请自行下载完整包更新!") + .ShowUpdateVersion(); + } + }); return false; } catch (Exception e)