Stub out bulk dlc menu item

This commit is contained in:
Jimmy Reichley 2024-08-18 16:55:33 -04:00
parent 20e0dbe97f
commit 50cd3add3f
No known key found for this signature in database
GPG key ID: 67715DC5A329803C
2 changed files with 33 additions and 0 deletions

View file

@ -8,6 +8,7 @@ using Avalonia.Threading;
using DynamicData;
using DynamicData.Alias;
using DynamicData.Binding;
using FluentAvalonia.UI.Controls;
using LibHac.Common;
using Ryujinx.Ava.Common;
using Ryujinx.Ava.Common.Locale;
@ -39,6 +40,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Key = Ryujinx.Input.Key;
@ -1505,6 +1507,32 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
public async Task BulkLoadDlc()
{
var result = await StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
{
Title = LocaleManager.Instance[LocaleKeys.OpenFolderDialogTitle], AllowMultiple = true,
});
if (result.Count > 0)
{
var dirs = result.Select(it => it.Path.LocalPath).ToList();
var numDlcAdded = ApplicationLibrary.AutoLoadDownloadableContents(dirs);
if (numDlcAdded > 0)
{
var msg = string.Format(LocaleManager.Instance[LocaleKeys.AutoloadDlcAddedMessage], numDlcAdded);
await Dispatcher.UIThread.InvokeAsync(async () =>
{
await ContentDialogHelper.ShowTextDialog(
LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle],
msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark);
});
}
}
}
public async Task OpenFolder()
{
var result = await StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions

View file

@ -34,6 +34,11 @@
Header="{locale:Locale MenuBarFileOpenUnpacked}"
IsEnabled="{Binding EnableNonGameRunningControls}"
ToolTip.Tip="{locale:Locale LoadApplicationFolderTooltip}" />
<MenuItem
Command="{Binding BulkLoadDlc}"
Header="Bulk Load DLC"
IsEnabled="{Binding EnableNonGameRunningControls}"
ToolTip.Tip="This is the tooltip" />
<MenuItem Header="{locale:Locale MenuBarFileOpenApplet}" IsEnabled="{Binding IsAppletMenuActive}">
<MenuItem
Click="OpenMiiApplet"