- note about fixing multithreaded fftw crashes
[FaRetSys.git] / PluginError.cs
blob9519fee7adea70633acdb7ea028303a2ab79a83e
1 using System;
2 using Gtk;
3 using Glade;
4 using Mono.Unix;
6 namespace Eithne
8 class PluginError
10 [Widget] Window PluginErrorWindow;
11 [Widget] Image StopImage;
12 [Widget] Button CloseButton;
13 [Widget] Label ErrorText;
14 [Widget] Label BottomText;
15 [Widget] Label TitleText;
16 [Widget] TextView FullErrorText;
18 private Block b;
20 public PluginError(Exception e, Block b, bool setup)
22 this.b = b;
24 Glade.XML gxml = new Glade.XML("PluginError.glade", "PluginErrorWindow");
25 gxml.BindFields(this);
27 PluginErrorWindow.IconList = new Gdk.Pixbuf[2] {new Gdk.Pixbuf(null, "dialog-warning.png"), new Gdk.Pixbuf(null, "dialog-warning-16.png")};
29 PluginErrorWindow.DeleteEvent += CloseWindow;
30 CloseButton.Clicked += CloseWindow;
32 StopImage.FromPixbuf = new Gdk.Pixbuf(null, "dialog-warning.png");
34 ErrorText.Text = e.Message;
35 TextBuffer buf = new TextBuffer(null);
36 buf.Text = e.ToString();
37 FullErrorText.Buffer = buf;
39 if(setup)
41 TitleText.Text = String.Format(Catalog.GetString("<big><big><b>{0} has encountered error while trying to configure plugin.</b></big></big>"), About.Name);
42 BottomText.Text = Catalog.GetString("Please report bug to plugin's author.");
44 else
46 TitleText.Text = String.Format(Catalog.GetString("<big><big><b>{0} has encountered error while trying to run plugin.</b></big></big>"), About.Name);
48 TitleText.UseMarkup = true;
50 PluginErrorWindow.ShowAll();
53 private void CloseWindow(object o, EventArgs args)
55 PluginErrorWindow.Destroy();
57 b.ShowError = false;
58 MainWindow.RedrawSchematic();