Prompt user on first launch to manage profiles

Related to #3396

Checks if system/Profiles.json exists, if it does not then prompt the
user to manage user profiles.
This commit is contained in:
Diana Atsuko Herring 2024-03-30 23:49:30 -05:00
parent ba9e0ca6dc
commit 46ebdcfe03
No known key found for this signature in database
GPG key ID: 401811DABE38E924
3 changed files with 24 additions and 1 deletions

View file

@ -118,6 +118,13 @@ namespace Ryujinx.Ava
}
}
// Check if we've made any profiles yet
if (!File.Exists(Path.Combine(AppDataManager.BaseDirPath, "system", "Profiles.json")))
{
MainWindow.ShowNewUserEditPrompt = true;
}
if (CommandLineState.LaunchPathArg != null)
{
MainWindow.DeferLoadApplication(CommandLineState.LaunchPathArg, CommandLineState.StartFullscreenArg);

View file

@ -54,6 +54,8 @@ namespace Ryujinx.Ava.UI.Windows
public SettingsWindow SettingsWindow { get; set; }
public static bool ShowKeyErrorOnLoad { get; set; }
public static bool ShowNewUserEditPrompt { get; set; }
public ApplicationLibrary ApplicationLibrary { get; set; }
public MainWindow()
@ -295,6 +297,20 @@ namespace Ryujinx.Ava.UI.Windows
await Dispatcher.UIThread.InvokeAsync(async () => await UserErrorDialog.ShowUserErrorDialog(UserError.NoKeys));
}
if (ShowNewUserEditPrompt)
{
ShowNewUserEditPrompt = false;
await Dispatcher.UIThread.InvokeAsync(async () =>
{
UserResult result = await ContentDialogHelper.CreateInfoDialog("The default profile has been created.", "Would you like to manage profiles now?", "Yes", "No", "First Launch");
if (result == UserResult.Ok)
{
await ViewModel.ManageProfiles();
}
});
}
if (ConfigurationState.Instance.CheckUpdatesOnStart.Value && Updater.CanUpdate(false))
{
await Updater.BeginParse(this, false).ContinueWith(task =>