ErrorAppletDialog.cs 889 B

1234567891011121314151617181920212223242526272829303132
  1. using Gtk;
  2. using System.Reflection;
  3. namespace Ryujinx.Ui
  4. {
  5. internal class ErrorAppletDialog : MessageDialog
  6. {
  7. internal static bool _isExitDialogOpen = false;
  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.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.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. }