mirror of
https://git.ryujinx.app/kenji-nx/ryujinx.git
synced 2025-12-16 04:37:02 +00:00
Fixed mime types button not updating after install/uninstall
This commit is contained in:
parent
d77d6b7cee
commit
ef4ea7794b
2 changed files with 13 additions and 9 deletions
|
|
@ -106,6 +106,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
private float _volumeBeforeMute;
|
private float _volumeBeforeMute;
|
||||||
private string _backendText;
|
private string _backendText;
|
||||||
|
|
||||||
|
private bool _areMimeTypesRegistered = FileAssociationHelper.AreMimeTypesRegistered;
|
||||||
private bool _canUpdate = true;
|
private bool _canUpdate = true;
|
||||||
private Cursor _cursor;
|
private Cursor _cursor;
|
||||||
private string _title;
|
private string _title;
|
||||||
|
|
@ -957,7 +958,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
public bool AreMimeTypesRegistered
|
public bool AreMimeTypesRegistered
|
||||||
{
|
{
|
||||||
get => FileAssociationHelper.AreMimeTypesRegistered;
|
get => _areMimeTypesRegistered;
|
||||||
|
set {
|
||||||
|
_areMimeTypesRegistered = value;
|
||||||
|
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObservableCollectionExtended<ApplicationData> Applications
|
public ObservableCollectionExtended<ApplicationData> Applications
|
||||||
|
|
|
||||||
|
|
@ -208,11 +208,10 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||||
|
|
||||||
private async void InstallFileTypes_Click(object sender, RoutedEventArgs e)
|
private async void InstallFileTypes_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (FileAssociationHelper.Install())
|
ViewModel.AreMimeTypesRegistered = FileAssociationHelper.Install();
|
||||||
{
|
if (ViewModel.AreMimeTypesRegistered)
|
||||||
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogInstallFileTypesSuccessMessage], string.Empty, LocaleManager.Instance[LocaleKeys.InputDialogOk], string.Empty, string.Empty);
|
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogInstallFileTypesSuccessMessage], string.Empty, LocaleManager.Instance[LocaleKeys.InputDialogOk], string.Empty, string.Empty);
|
||||||
}
|
else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogInstallFileTypesErrorMessage]);
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogInstallFileTypesErrorMessage]);
|
||||||
}
|
}
|
||||||
|
|
@ -220,10 +219,9 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||||
|
|
||||||
private async void UninstallFileTypes_Click(object sender, RoutedEventArgs e)
|
private async void UninstallFileTypes_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (FileAssociationHelper.Uninstall())
|
ViewModel.AreMimeTypesRegistered = !FileAssociationHelper.Uninstall();
|
||||||
{
|
if (!ViewModel.AreMimeTypesRegistered)
|
||||||
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogUninstallFileTypesSuccessMessage], string.Empty, LocaleManager.Instance[LocaleKeys.InputDialogOk], string.Empty, string.Empty);
|
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogUninstallFileTypesSuccessMessage], string.Empty, LocaleManager.Instance[LocaleKeys.InputDialogOk], string.Empty, string.Empty);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogUninstallFileTypesErrorMessage]);
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogUninstallFileTypesErrorMessage]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue