ErrorAppletDialog.cs 850 B

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