ErrorAppletDialog.cs 913 B

12345678910111213141516171819202122232425262728293031
  1. using Gtk;
  2. using Ryujinx.Ui.Common.Configuration;
  3. using System.Reflection;
  4. namespace Ryujinx.Ui.Applet
  5. {
  6. internal class ErrorAppletDialog : MessageDialog
  7. {
  8. public ErrorAppletDialog(Window parentWindow, DialogFlags dialogFlags, MessageType messageType, string[] buttons) : base(parentWindow, dialogFlags, messageType, ButtonsType.None, null)
  9. {
  10. Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png");
  11. int responseId = 0;
  12. if (buttons != null)
  13. {
  14. foreach (string buttonText in buttons)
  15. {
  16. AddButton(buttonText, responseId);
  17. responseId++;
  18. }
  19. }
  20. else
  21. {
  22. AddButton("OK", 0);
  23. }
  24. ShowAll();
  25. }
  26. }
  27. }