mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 02:53:21 +08:00
Show an ongoing operation when checking for updates
Addresses https://github.com/ppy/osu/discussions/30950.
This commit is contained in:
parent
ce4aac4184
commit
2ceb3f6f85
@ -44,6 +44,11 @@ namespace osu.Game.Localisation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString CheckUpdate => new TranslatableString(getKey(@"check_update"), @"Check for updates");
|
public static LocalisableString CheckUpdate => new TranslatableString(getKey(@"check_update"), @"Check for updates");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Checking for updates"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString CheckingForUpdates => new TranslatableString(getKey(@"checking_for_updates"), @"Checking for updates");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Open osu! folder"
|
/// "Open osu! folder"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -53,8 +53,16 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
checkForUpdatesButton.Enabled.Value = false;
|
checkForUpdatesButton.Enabled.Value = false;
|
||||||
|
|
||||||
|
var checkingNotification = new ProgressNotification { Text = GeneralSettingsStrings.CheckingForUpdates, };
|
||||||
|
notifications?.Post(checkingNotification);
|
||||||
|
|
||||||
Task.Run(updateManager.CheckForUpdateAsync).ContinueWith(task => Schedule(() =>
|
Task.Run(updateManager.CheckForUpdateAsync).ContinueWith(task => Schedule(() =>
|
||||||
{
|
{
|
||||||
|
// This sequence allows the notification to be immediately dismissed.
|
||||||
|
checkingNotification.State = ProgressNotificationState.Cancelled;
|
||||||
|
checkingNotification.Close(false);
|
||||||
|
|
||||||
if (!task.GetResultSafely())
|
if (!task.GetResultSafely())
|
||||||
{
|
{
|
||||||
notifications?.Post(new SimpleNotification
|
notifications?.Post(new SimpleNotification
|
||||||
|
Loading…
Reference in New Issue
Block a user