8 public class PluginAbout
10 [Widget
] Window PluginAboutWindow
;
12 [Widget
] Label Author
;
15 [Widget
] Button CloseButton
;
16 [Widget
] TreeView MatchIn
;
17 [Widget
] TreeView MatchOut
;
19 private void CommonTasks(IInfo info
, string type
)
21 Glade
.XML gxml
= new Glade
.XML("PluginAbout.glade", "PluginAboutWindow");
22 gxml
.BindFields(this);
24 PluginAboutWindow
.DeleteEvent
+= CloseWindow
;
25 CloseButton
.Clicked
+= CloseWindow
;
27 PluginAboutWindow
.Title
= String
.Format(Catalog
.GetString("About plugin {0}"), info
.Name
);
28 PluginAboutWindow
.IconList
= new Gdk
.Pixbuf
[2] {new Gdk.Pixbuf(null, "plugin-48.png"), new Gdk.Pixbuf(null, "plugin-16.png")}
;
30 Name
.Text
= "<big><big><big><b>" + info
.Name
+ " " + info
.Version
+ "</b></big></big></big>";
31 Name
.UseMarkup
= true;
32 Author
.Text
= Catalog
.GetString("Author: ") + info
.Author
;
33 Author
.UseMarkup
= true;
34 Desc
.Text
= "<small>" + info
.Description
+ "</small>";
35 Desc
.UseMarkup
= true;
37 Type
.Text
= "<small>" + type
+ "</small>";
38 Type
.UseMarkup
= true;
40 PluginAboutWindow
.ShowAll();
43 private void FillMatchInfo(IPlugin p
)
45 MatchIn
.Model
= new ListStore(typeof(string));
46 MatchOut
.Model
= new ListStore(typeof(string));
48 MatchIn
.AppendColumn(Catalog
.GetString("Input matches"), new CellRendererText(), "text", 0);
49 MatchOut
.AppendColumn(Catalog
.GetString("Output matches"), new CellRendererText(), "text", 0);
52 foreach(string s
in p
.MatchIn
)
53 (MatchIn
.Model
as ListStore
).AppendValues(s
);
55 if(p
.MatchOut
!= null)
56 foreach(string s
in p
.MatchOut
)
57 (MatchOut
.Model
as ListStore
).AppendValues(s
);
60 public PluginAbout(IPlugin p
)
65 type
= Catalog
.GetString("Input");
66 else if (p
is IOutPlugin
)
67 type
= Catalog
.GetString("Output");
68 else if (p
is IImgProcPlugin
)
69 type
= Catalog
.GetString("Image processing");
70 else if (p
is IResProcPlugin
)
71 type
= Catalog
.GetString("Result processing");
72 else if (p
is IComparatorPlugin
)
73 type
= Catalog
.GetString("Comparator");
75 type
= Catalog
.GetString("Other");
77 CommonTasks(p
.Info
, type
);
81 public PluginAbout(IFactory f
)
88 type
= Catalog
.GetString("Input");
92 type
= Catalog
.GetString("Output");
96 type
= Catalog
.GetString("Image processing");
100 type
= Catalog
.GetString("Result processing");
103 case IType
.Comparator
:
104 type
= Catalog
.GetString("Comparator");
108 type
= Catalog
.GetString("Other");
112 CommonTasks(f
.Info
, type
);
114 IPlugin tmp
= f
.Create();
118 private void CloseWindow(object o
, EventArgs args
)
120 PluginAboutWindow
.Destroy();