UI: Change the background updater notification to a persistent button on the status bar when not in a game
This commit is contained in:
parent
13388e972a
commit
1024aa8757
@ -17747,6 +17747,31 @@
|
|||||||
"zh_TW": "更新已停用!"
|
"zh_TW": "更新已停用!"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ID": "UpdaterBackgroundStatusBarButtonText",
|
||||||
|
"Translations": {
|
||||||
|
"ar_SA": "",
|
||||||
|
"de_DE": "",
|
||||||
|
"el_GR": "",
|
||||||
|
"en_US": "Update Available!",
|
||||||
|
"es_ES": "",
|
||||||
|
"fr_FR": "",
|
||||||
|
"he_IL": "",
|
||||||
|
"it_IT": "",
|
||||||
|
"ja_JP": "",
|
||||||
|
"ko_KR": "",
|
||||||
|
"no_NO": "",
|
||||||
|
"pl_PL": "",
|
||||||
|
"pt_BR": "",
|
||||||
|
"ru_RU": "",
|
||||||
|
"sv_SE": "",
|
||||||
|
"th_TH": "",
|
||||||
|
"tr_TR": "",
|
||||||
|
"uk_UA": "",
|
||||||
|
"zh_CN": "",
|
||||||
|
"zh_TW": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ID": "ControllerSettingsRotate90",
|
"ID": "ControllerSettingsRotate90",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
@ -23873,4 +23898,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ using Avalonia.Media.Imaging;
|
|||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using DynamicData;
|
using DynamicData;
|
||||||
using DynamicData.Binding;
|
using DynamicData.Binding;
|
||||||
using FluentAvalonia.UI.Controls;
|
using FluentAvalonia.UI.Controls;
|
||||||
@ -104,6 +105,13 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
[ObservableProperty] private bool _isSubMenuOpen;
|
[ObservableProperty] private bool _isSubMenuOpen;
|
||||||
[ObservableProperty] private ApplicationContextMenu _listAppContextMenu;
|
[ObservableProperty] private ApplicationContextMenu _listAppContextMenu;
|
||||||
[ObservableProperty] private ApplicationContextMenu _gridAppContextMenu;
|
[ObservableProperty] private ApplicationContextMenu _gridAppContextMenu;
|
||||||
|
[ObservableProperty] private bool _updateAvailable;
|
||||||
|
|
||||||
|
public static AsyncRelayCommand UpdateCommand => Commands.Create(async () =>
|
||||||
|
{
|
||||||
|
if (Updater.CanUpdate(true))
|
||||||
|
await Updater.BeginUpdateAsync(true);
|
||||||
|
});
|
||||||
|
|
||||||
private bool _showLoadProgress;
|
private bool _showLoadProgress;
|
||||||
private bool _isGameRunning;
|
private bool _isGameRunning;
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
Background="{DynamicResource ThemeContentBackgroundColor}"
|
Background="{DynamicResource ThemeContentBackgroundColor}"
|
||||||
DockPanel.Dock="Bottom"
|
DockPanel.Dock="Bottom"
|
||||||
IsVisible="{Binding ShowMenuAndStatusBar}"
|
IsVisible="{Binding ShowMenuAndStatusBar}"
|
||||||
ColumnDefinitions="Auto,Auto,*,Auto,Auto">
|
ColumnDefinitions="Auto,Auto,*,Auto,Auto,Auto">
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="5"
|
Margin="5"
|
||||||
@ -280,9 +280,24 @@
|
|||||||
Text="{Binding GpuNameText}"
|
Text="{Binding GpuNameText}"
|
||||||
TextAlignment="Start" />
|
TextAlignment="Start" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Column="4"
|
Grid.Column="4"
|
||||||
Margin="0,0,5,0"
|
Margin="0,0,5,0"
|
||||||
|
IsVisible="{Binding EnableNonGameRunningControls}"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<Button Margin="0, 0, 5, 0"
|
||||||
|
Command="{Binding UpdateCommand}">
|
||||||
|
<TextBlock
|
||||||
|
Margin="-5"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{ext:Locale UpdaterBackgroundStatusBarButtonText}" />
|
||||||
|
</Button>
|
||||||
|
<controls:MiniVerticalSeparator IsVisible="{Binding UpdateAvailable}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
Grid.Column="5"
|
||||||
|
Margin="0,0,5,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
IsVisible="{Binding ShowFirmwareStatus}"
|
IsVisible="{Binding ShowFirmwareStatus}"
|
||||||
Orientation="Horizontal">
|
Orientation="Horizontal">
|
||||||
|
@ -413,15 +413,8 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
case UpdaterType.CheckInBackground:
|
case UpdaterType.CheckInBackground:
|
||||||
if ((await Updater.CheckVersionAsync()).TryGet(out (Version Current, Version Incoming) versions))
|
if ((await Updater.CheckVersionAsync()).TryGet(out (Version Current, Version Incoming) versions))
|
||||||
{
|
{
|
||||||
string newVersionString = ReleaseInformation.IsCanaryBuild
|
|
||||||
? $"Canary {versions.Current} -> Canary {versions.Incoming}"
|
|
||||||
: $"{versions.Current} -> {versions.Incoming}";
|
|
||||||
|
|
||||||
if (versions.Current < versions.Incoming)
|
if (versions.Current < versions.Incoming)
|
||||||
NotificationHelper.ShowInformation(
|
Dispatcher.UIThread.Post(() => RyujinxApp.MainWindow.ViewModel.UpdateAvailable = true);
|
||||||
title: "Update Available",
|
|
||||||
text: newVersionString,
|
|
||||||
onClick: () => _ = Updater.BeginUpdateAsync());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user