- renamed aa to offset
[FaRetSys.git] / LoadError.cs
blob25c7b39557738e12ce7e545c8b7cfc7d54c07432
1 using System;
2 using System.Collections;
3 using Gtk;
4 using Glade;
5 using Mono.Unix;
7 namespace Eithne
9 class LoadErrorList : TreeView
11 public LoadErrorList(ArrayList errors) : base()
13 Model = new ListStore(typeof(string), typeof(string), typeof(string));
15 foreach(BlockError e in errors)
17 (Model as ListStore).AppendValues(e.Name + " " + e.Version, e.Assembly, e.Class);
20 Selection.Mode = SelectionMode.None;
22 CellRendererText cr = new CellRendererText();
23 AppendColumn(Catalog.GetString("Plugin name"), cr, "text", 0);
24 Columns[0].SetCellDataFunc(cr, new Gtk.TreeCellDataFunc(RenderCell));
25 cr = new CellRendererText();
26 AppendColumn(Catalog.GetString("Source assembly"), cr, "text", 1);
27 cr = new CellRendererText();
28 AppendColumn(Catalog.GetString("Class"), cr, "text", 2);
31 private void RenderCell(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
33 (cell as CellRendererText).Markup = (string)model.GetValue(iter, 0);
38 class LoadError
40 [Widget] Window LoadErrorWindow;
41 [Widget] Image StopImage;
42 [Widget] Button CloseButton;
43 [Widget] Label ErrorText;
44 [Widget] ScrolledWindow ErrorListSocket;
46 public LoadError(string fn, ArrayList errors)
48 Glade.XML gxml = new Glade.XML("LoadError.glade", "LoadErrorWindow");
49 gxml.BindFields(this);
51 LoadErrorWindow.IconList = new Gdk.Pixbuf[2] {new Gdk.Pixbuf(null, "dialog-error.png"), new Gdk.Pixbuf(null, "dialog-error-16.png")};
53 LoadErrorWindow.DeleteEvent += CloseWindow;
54 CloseButton.Clicked += CloseWindow;
56 StopImage.FromPixbuf = new Gdk.Pixbuf(null, "dialog-error.png");
58 ErrorText.Text = String.Format(Catalog.GetString("File <i>{0}</i> cannot be open because the following plugins are not available:"), fn);
59 ErrorText.UseMarkup = true;
61 ErrorListSocket.AddWithViewport(new LoadErrorList(errors));
63 LoadErrorWindow.ShowAll();
66 private void CloseWindow(object o, EventArgs args)
68 LoadErrorWindow.Destroy();