Improve keys and 'game already running' dialogs
This commit is contained in:
parent
203f7f3f1f
commit
78d43694c3
3 changed files with 16 additions and 6 deletions
|
@ -51,7 +51,7 @@ namespace Ryujinx
|
|||
string userProfilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".switch", "prod.keys");
|
||||
if (!File.Exists(appDataPath) && !File.Exists(userProfilePath) && !Migration.IsMigrationNeeded())
|
||||
{
|
||||
GtkDialog.CreateErrorDialog("Key file was not found. Please refer to `KEYS.md` for more info");
|
||||
GtkDialog.CreateWarningDialog("Key file was not found", "Please refer to `KEYS.md` for more info");
|
||||
}
|
||||
|
||||
MainWindow mainWindow = new MainWindow();
|
||||
|
|
|
@ -5,19 +5,29 @@ namespace Ryujinx.Ui
|
|||
{
|
||||
internal class GtkDialog
|
||||
{
|
||||
internal static void CreateErrorDialog(string errorMessage)
|
||||
internal static void CreateDialog(string title, string text, string secondaryText)
|
||||
{
|
||||
MessageDialog errorDialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, null)
|
||||
{
|
||||
Title = "Ryujinx - Error",
|
||||
Title = title,
|
||||
Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png"),
|
||||
Text = "Ryujinx has encountered an error",
|
||||
SecondaryText = errorMessage,
|
||||
Text = text,
|
||||
SecondaryText = secondaryText,
|
||||
WindowPosition = WindowPosition.Center
|
||||
};
|
||||
errorDialog.SetSizeRequest(100, 20);
|
||||
errorDialog.Run();
|
||||
errorDialog.Dispose();
|
||||
}
|
||||
|
||||
internal static void CreateWarningDialog(string text, string secondaryText)
|
||||
{
|
||||
CreateDialog("Ryujinx - Warning", text, secondaryText);
|
||||
}
|
||||
|
||||
internal static void CreateErrorDialog(string errorMessage)
|
||||
{
|
||||
CreateDialog("Ryujinx - Error", "Ryujinx has encountered an error", errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ namespace Ryujinx.Ui
|
|||
{
|
||||
if (_gameLoaded)
|
||||
{
|
||||
GtkDialog.CreateErrorDialog("A game has already been loaded. Please close the emulator and try again");
|
||||
GtkDialog.CreateDialog("Ryujinx", "A game has already been loaded", "Please close it first and try again.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue