2 using System
.Collections
;
9 public class PluginListContent
: TextBuffer
11 public PluginListContent() : base(null)
15 TextIter iter
= EndIter
;
17 InsertWithTagsByName(ref iter
, "\n", "spacer");
18 InsertWithTagsByName(ref iter
, Catalog
.GetString("Input plugins\n"), "category");
19 Append(ref iter
, PluginDB
.In
);
21 InsertWithTagsByName(ref iter
, Catalog
.GetString("\nImage processing plugins\n"), "category");
22 Append(ref iter
, PluginDB
.ImgProc
);
24 InsertWithTagsByName(ref iter
, Catalog
.GetString("\nComparator plugins\n"), "category");
25 Append(ref iter
, PluginDB
.Comparator
);
27 InsertWithTagsByName(ref iter
, Catalog
.GetString("\nResult processing plugins\n"), "category");
28 Append(ref iter
, PluginDB
.ResProc
);
30 InsertWithTagsByName(ref iter
, Catalog
.GetString("\nOutput plugins\n"), "category");
31 Append(ref iter
, PluginDB
.Out
);
33 InsertWithTagsByName(ref iter
, Catalog
.GetString("\nOther plugins\n"), "category");
34 Append(ref iter
, PluginDB
.Other
);
37 private void SetupTags()
39 TextTag tag
= new TextTag("category");
40 tag
.Weight
= Pango
.Weight
.Bold
;
42 tag
.Background
= "#ddd";
43 tag
.BackgroundFullHeight
= true;
46 tag
= new TextTag("name");
47 tag
.Weight
= Pango
.Weight
.Bold
;
50 tag
.PixelsAboveLines
= 5;
51 tag
.PixelsBelowLines
= 5;
54 tag
= new TextTag("author");
56 tag
.PixelsBelowLines
= 5;
59 tag
= new TextTag("description");
60 tag
.Style
= Pango
.Style
.Italic
;
64 tag
= new TextTag("spacer");
69 private void Append(ref TextIter iter
, ArrayList plugins
)
71 if(plugins
.Count
== 0)
73 InsertWithTagsByName(ref iter
, Catalog
.GetString("No plugins available.\n"), "description");
77 foreach(IFactory p
in plugins
)
81 private void Append(ref TextIter iter
, IFactory p
)
83 InsertWithTagsByName(ref iter
, p
.Info
.Name
+ " " + p
.Info
.Version
+ "\n", "name");
84 InsertWithTagsByName(ref iter
, Catalog
.GetString("Author: ") + p
.Info
.Author
+ "\n", "author");
85 InsertWithTagsByName(ref iter
, p
.Info
.Description
+ "\n", "description");
89 public class PluginList
91 [Widget
] Window PluginListWindow
;
92 [Widget
] Image PluginImage
;
93 [Widget
] TextView PluginListDisplay
;
94 [Widget
] Button CloseButton
;
98 Glade
.XML gxml
= new Glade
.XML("PluginList.glade", "PluginListWindow");
99 gxml
.BindFields(this);
101 PluginListWindow
.DeleteEvent
+= CloseWindow
;
102 CloseButton
.Clicked
+= CloseWindow
;
104 PluginListWindow
.IconList
= new Gdk
.Pixbuf
[2] {new Gdk
.Pixbuf(null, "plugin-48.png"),
105 new Gdk
.Pixbuf(null, "plugin-16.png")};
106 PluginImage
.FromPixbuf
= new Gdk
.Pixbuf(null, "plugin-48.png");
108 PluginListDisplay
.Buffer
= new PluginListContent();
110 PluginListWindow
.ShowAll();
113 private void CloseWindow(object o
, EventArgs args
)
115 PluginListWindow
.Destroy();