Merge lp:~mjs7231/do-plugins/files-folders-extensions into lp:do-plugins

Proposed by MShepanski
Status: Needs review
Proposed branch: lp:~mjs7231/do-plugins/files-folders-extensions
Merge into: lp:do-plugins
Diff against target: 1256 lines (+520/-479)
9 files modified
File/gtk-gui/Do.FilesAndFolders.Configuration.cs (+310/-331)
File/gtk-gui/generated.cs (+113/-113)
File/gtk-gui/gui.stetic (+17/-5)
File/src/Do/Do.FilesAndFolders/Configuration.cs (+1/-1)
File/src/Do/Do.FilesAndFolders/FileItemSource.cs (+22/-13)
File/src/Do/Do.FilesAndFolders/IndexedFolder.cs (+18/-5)
File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs (+7/-7)
File/src/IndexPathNodeView.cs (+31/-3)
File/src/PathNodeView.cs (+1/-1)
To merge this branch: bzr merge lp:~mjs7231/do-plugins/files-folders-extensions
Reviewer Review Type Date Requested Status
Chris Halse Rogers Pending
Review via email: mp+93903@code.launchpad.net

Description of the change

Added option to filter folders and files by an extensions list. Includes the following updates:
  * Extensions is a simple whitelist of extensions to include (leave blank for old behavior).
  * Preferences UI updated to contain third column for extensions.
  * Preferences UI updated to include note & example about adding extension (in English).
  * Extensions list is propagated throughout the IndexedFolder classes in the code.

To post a comment you must log in.
Revision history for this message
MShepanski (mjs7231) wrote :

I can't link it like normally because they are attached to the wrong project, but the following blueprints may be solved by this update. I would argue that also including a blacklist would be a bit confusing to the UI at this point.

https://blueprints.launchpad.net/do/+spec/files-plugin-filetypes
https://blueprints.launchpad.net/do/+spec/gnome-do-file-types

Unmerged revisions

754. By MShepanski

Add option to filter files by an extensions list

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'File/gtk-gui/Do.FilesAndFolders.Configuration.cs'
2--- File/gtk-gui/Do.FilesAndFolders.Configuration.cs 2009-06-23 00:52:54 +0000
3+++ File/gtk-gui/Do.FilesAndFolders.Configuration.cs 2012-02-20 22:25:22 +0000
4@@ -1,333 +1,312 @@
5-// ------------------------------------------------------------------------------
6-// <autogenerated>
7-// This code was generated by a tool.
8-//
9-//
10-// Changes to this file may cause incorrect behavior and will be lost if
11-// the code is regenerated.
12-// </autogenerated>
13-// ------------------------------------------------------------------------------
14
15-namespace Do.FilesAndFolders {
16-
17-
18- public partial class Configuration {
19-
20- private Gtk.Alignment alignment1;
21-
22- private Gtk.VBox vbox2;
23-
24- private Gtk.VBox vbox1;
25-
26- private Gtk.Notebook notebook1;
27-
28- private Gtk.VBox vbox4;
29-
30- private Gtk.Alignment alignment3;
31-
32- private Gtk.VBox vbox6;
33-
34- private Gtk.ScrolledWindow index_node_scroll;
35-
36- private Gtk.HBox hbox1;
37-
38- private Gtk.Label IndexLabel;
39-
40- private Gtk.HButtonBox hbuttonbox2;
41-
42- private Gtk.Button index_remove_btn;
43-
44- private Gtk.Button index_add_btn;
45-
46- private Gtk.CheckButton show_hidden_chk;
47-
48- private Gtk.Label label1;
49-
50- private Gtk.VBox vbox5;
51-
52- private Gtk.Alignment alignment2;
53-
54- private Gtk.VBox vbox3;
55-
56- private Gtk.ScrolledWindow ignore_node_scroll;
57-
58- private Gtk.HBox hbox3;
59-
60- private Gtk.Label IgnoreLabel;
61-
62- private Gtk.HButtonBox hbuttonbox3;
63-
64- private Gtk.Button ignore_remove_btn;
65-
66- private Gtk.Button ignore_add_btn;
67-
68- private Gtk.Label label2;
69-
70- protected virtual void Build() {
71- Stetic.Gui.Initialize(this);
72- // Widget Do.FilesAndFolders.Configuration
73- Stetic.BinContainer.Attach(this);
74- this.Name = "Do.FilesAndFolders.Configuration";
75- // Container child Do.FilesAndFolders.Configuration.Gtk.Container+ContainerChild
76- this.alignment1 = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
77- this.alignment1.Name = "alignment1";
78- this.alignment1.BorderWidth = ((uint)(8));
79- // Container child alignment1.Gtk.Container+ContainerChild
80- this.vbox2 = new Gtk.VBox();
81- this.vbox2.Name = "vbox2";
82- this.vbox2.Spacing = 6;
83- // Container child vbox2.Gtk.Box+BoxChild
84- this.vbox1 = new Gtk.VBox();
85- this.vbox1.Name = "vbox1";
86- this.vbox1.Spacing = 6;
87- // Container child vbox1.Gtk.Box+BoxChild
88- this.notebook1 = new Gtk.Notebook();
89- this.notebook1.HeightRequest = 270;
90- this.notebook1.CanFocus = true;
91- this.notebook1.Name = "notebook1";
92- this.notebook1.CurrentPage = 0;
93- this.notebook1.ShowBorder = false;
94- // Container child notebook1.Gtk.Notebook+NotebookChild
95- this.vbox4 = new Gtk.VBox();
96- this.vbox4.Name = "vbox4";
97- this.vbox4.Spacing = 6;
98- // Container child vbox4.Gtk.Box+BoxChild
99- this.alignment3 = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
100- this.alignment3.Name = "alignment3";
101- this.alignment3.LeftPadding = ((uint)(8));
102- this.alignment3.TopPadding = ((uint)(8));
103- this.alignment3.RightPadding = ((uint)(8));
104- this.alignment3.BottomPadding = ((uint)(8));
105- // Container child alignment3.Gtk.Container+ContainerChild
106- this.vbox6 = new Gtk.VBox();
107- this.vbox6.Name = "vbox6";
108- this.vbox6.Spacing = 6;
109- // Container child vbox6.Gtk.Box+BoxChild
110- this.index_node_scroll = new Gtk.ScrolledWindow();
111- this.index_node_scroll.CanFocus = true;
112- this.index_node_scroll.Name = "index_node_scroll";
113- this.index_node_scroll.ShadowType = ((Gtk.ShadowType)(1));
114- this.vbox6.Add(this.index_node_scroll);
115- Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox6[this.index_node_scroll]));
116- w1.Position = 0;
117- // Container child vbox6.Gtk.Box+BoxChild
118- this.hbox1 = new Gtk.HBox();
119- this.hbox1.Name = "hbox1";
120- this.hbox1.Spacing = 6;
121- // Container child hbox1.Gtk.Box+BoxChild
122- this.IndexLabel = new Gtk.Label();
123- this.IndexLabel.Name = "IndexLabel";
124- this.hbox1.Add(this.IndexLabel);
125- Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.IndexLabel]));
126- w2.Position = 0;
127- // Container child hbox1.Gtk.Box+BoxChild
128- this.hbuttonbox2 = new Gtk.HButtonBox();
129- this.hbuttonbox2.Name = "hbuttonbox2";
130- // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
131- this.index_remove_btn = new Gtk.Button();
132- this.index_remove_btn.CanFocus = true;
133- this.index_remove_btn.Name = "index_remove_btn";
134- this.index_remove_btn.UseUnderline = true;
135- // Container child index_remove_btn.Gtk.Container+ContainerChild
136- Gtk.Alignment w3 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
137- // Container child GtkAlignment.Gtk.Container+ContainerChild
138- Gtk.HBox w4 = new Gtk.HBox();
139- w4.Spacing = 2;
140- // Container child GtkHBox.Gtk.Container+ContainerChild
141- Gtk.Image w5 = new Gtk.Image();
142- w5.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-remove", Gtk.IconSize.Button, 16);
143- w4.Add(w5);
144- // Container child GtkHBox.Gtk.Container+ContainerChild
145- Gtk.Label w7 = new Gtk.Label();
146- w4.Add(w7);
147- w3.Add(w4);
148- this.index_remove_btn.Add(w3);
149- this.hbuttonbox2.Add(this.index_remove_btn);
150- Gtk.ButtonBox.ButtonBoxChild w11 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.index_remove_btn]));
151- w11.Expand = false;
152- w11.Fill = false;
153- // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
154- this.index_add_btn = new Gtk.Button();
155- this.index_add_btn.CanFocus = true;
156- this.index_add_btn.Name = "index_add_btn";
157- this.index_add_btn.UseUnderline = true;
158- // Container child index_add_btn.Gtk.Container+ContainerChild
159- Gtk.Alignment w12 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
160- // Container child GtkAlignment.Gtk.Container+ContainerChild
161- Gtk.HBox w13 = new Gtk.HBox();
162- w13.Spacing = 2;
163- // Container child GtkHBox.Gtk.Container+ContainerChild
164- Gtk.Image w14 = new Gtk.Image();
165- w14.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Menu, 16);
166- w13.Add(w14);
167- // Container child GtkHBox.Gtk.Container+ContainerChild
168- Gtk.Label w16 = new Gtk.Label();
169- w13.Add(w16);
170- w12.Add(w13);
171- this.index_add_btn.Add(w12);
172- this.hbuttonbox2.Add(this.index_add_btn);
173- Gtk.ButtonBox.ButtonBoxChild w20 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.index_add_btn]));
174- w20.Position = 1;
175- w20.Expand = false;
176- w20.Fill = false;
177- this.hbox1.Add(this.hbuttonbox2);
178- Gtk.Box.BoxChild w21 = ((Gtk.Box.BoxChild)(this.hbox1[this.hbuttonbox2]));
179- w21.Position = 1;
180- w21.Expand = false;
181- this.vbox6.Add(this.hbox1);
182- Gtk.Box.BoxChild w22 = ((Gtk.Box.BoxChild)(this.vbox6[this.hbox1]));
183- w22.Position = 1;
184- w22.Expand = false;
185- w22.Fill = false;
186- // Container child vbox6.Gtk.Box+BoxChild
187- this.show_hidden_chk = new Gtk.CheckButton();
188- this.show_hidden_chk.CanFocus = true;
189- this.show_hidden_chk.Name = "show_hidden_chk";
190- this.show_hidden_chk.Label = Mono.Addins.AddinManager.CurrentLocalizer.GetString("Show hidden files");
191- this.show_hidden_chk.DrawIndicator = true;
192- this.show_hidden_chk.UseUnderline = true;
193- this.show_hidden_chk.BorderWidth = ((uint)(5));
194- this.vbox6.Add(this.show_hidden_chk);
195- Gtk.Box.BoxChild w23 = ((Gtk.Box.BoxChild)(this.vbox6[this.show_hidden_chk]));
196- w23.Position = 2;
197- w23.Expand = false;
198- w23.Fill = false;
199- this.alignment3.Add(this.vbox6);
200- this.vbox4.Add(this.alignment3);
201- Gtk.Box.BoxChild w25 = ((Gtk.Box.BoxChild)(this.vbox4[this.alignment3]));
202- w25.Position = 0;
203- this.notebook1.Add(this.vbox4);
204- // Notebook tab
205- this.label1 = new Gtk.Label();
206- this.label1.Name = "label1";
207- this.label1.LabelProp = Mono.Addins.AddinManager.CurrentLocalizer.GetString("Indexed Folders");
208- this.notebook1.SetTabLabel(this.vbox4, this.label1);
209- this.label1.ShowAll();
210- // Container child notebook1.Gtk.Notebook+NotebookChild
211- this.vbox5 = new Gtk.VBox();
212- this.vbox5.Name = "vbox5";
213- this.vbox5.Spacing = 6;
214- // Container child vbox5.Gtk.Box+BoxChild
215- this.alignment2 = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
216- this.alignment2.Name = "alignment2";
217- this.alignment2.LeftPadding = ((uint)(8));
218- this.alignment2.TopPadding = ((uint)(8));
219- this.alignment2.RightPadding = ((uint)(8));
220- this.alignment2.BottomPadding = ((uint)(8));
221- // Container child alignment2.Gtk.Container+ContainerChild
222- this.vbox3 = new Gtk.VBox();
223- this.vbox3.Name = "vbox3";
224- this.vbox3.Spacing = 6;
225- // Container child vbox3.Gtk.Box+BoxChild
226- this.ignore_node_scroll = new Gtk.ScrolledWindow();
227- this.ignore_node_scroll.CanFocus = true;
228- this.ignore_node_scroll.Name = "ignore_node_scroll";
229- this.ignore_node_scroll.ShadowType = ((Gtk.ShadowType)(1));
230- this.vbox3.Add(this.ignore_node_scroll);
231- Gtk.Box.BoxChild w27 = ((Gtk.Box.BoxChild)(this.vbox3[this.ignore_node_scroll]));
232- w27.Position = 0;
233- // Container child vbox3.Gtk.Box+BoxChild
234- this.hbox3 = new Gtk.HBox();
235- this.hbox3.Name = "hbox3";
236- this.hbox3.Spacing = 6;
237- // Container child hbox3.Gtk.Box+BoxChild
238- this.IgnoreLabel = new Gtk.Label();
239- this.IgnoreLabel.Name = "IgnoreLabel";
240- this.hbox3.Add(this.IgnoreLabel);
241- Gtk.Box.BoxChild w28 = ((Gtk.Box.BoxChild)(this.hbox3[this.IgnoreLabel]));
242- w28.Position = 0;
243- w28.Fill = false;
244- // Container child hbox3.Gtk.Box+BoxChild
245- this.hbuttonbox3 = new Gtk.HButtonBox();
246- this.hbuttonbox3.Name = "hbuttonbox3";
247- // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild
248- this.ignore_remove_btn = new Gtk.Button();
249- this.ignore_remove_btn.CanFocus = true;
250- this.ignore_remove_btn.Name = "ignore_remove_btn";
251- this.ignore_remove_btn.UseUnderline = true;
252- // Container child ignore_remove_btn.Gtk.Container+ContainerChild
253- Gtk.Alignment w29 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
254- // Container child GtkAlignment.Gtk.Container+ContainerChild
255- Gtk.HBox w30 = new Gtk.HBox();
256- w30.Spacing = 2;
257- // Container child GtkHBox.Gtk.Container+ContainerChild
258- Gtk.Image w31 = new Gtk.Image();
259- w31.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-remove", Gtk.IconSize.Button, 16);
260- w30.Add(w31);
261- // Container child GtkHBox.Gtk.Container+ContainerChild
262- Gtk.Label w33 = new Gtk.Label();
263- w30.Add(w33);
264- w29.Add(w30);
265- this.ignore_remove_btn.Add(w29);
266- this.hbuttonbox3.Add(this.ignore_remove_btn);
267- Gtk.ButtonBox.ButtonBoxChild w37 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3[this.ignore_remove_btn]));
268- w37.Expand = false;
269- w37.Fill = false;
270- w37.Padding = ((uint)(5));
271- // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild
272- this.ignore_add_btn = new Gtk.Button();
273- this.ignore_add_btn.CanFocus = true;
274- this.ignore_add_btn.Name = "ignore_add_btn";
275- this.ignore_add_btn.UseUnderline = true;
276- // Container child ignore_add_btn.Gtk.Container+ContainerChild
277- Gtk.Alignment w38 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
278- // Container child GtkAlignment.Gtk.Container+ContainerChild
279- Gtk.HBox w39 = new Gtk.HBox();
280- w39.Spacing = 2;
281- // Container child GtkHBox.Gtk.Container+ContainerChild
282- Gtk.Image w40 = new Gtk.Image();
283- w40.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Menu, 16);
284- w39.Add(w40);
285- // Container child GtkHBox.Gtk.Container+ContainerChild
286- Gtk.Label w42 = new Gtk.Label();
287- w39.Add(w42);
288- w38.Add(w39);
289- this.ignore_add_btn.Add(w38);
290- this.hbuttonbox3.Add(this.ignore_add_btn);
291- Gtk.ButtonBox.ButtonBoxChild w46 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3[this.ignore_add_btn]));
292- w46.Position = 1;
293- w46.Expand = false;
294- w46.Fill = false;
295- w46.Padding = ((uint)(5));
296- this.hbox3.Add(this.hbuttonbox3);
297- Gtk.Box.BoxChild w47 = ((Gtk.Box.BoxChild)(this.hbox3[this.hbuttonbox3]));
298- w47.Position = 1;
299- w47.Expand = false;
300- this.vbox3.Add(this.hbox3);
301- Gtk.Box.BoxChild w48 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox3]));
302- w48.Position = 1;
303- w48.Expand = false;
304- w48.Fill = false;
305- this.alignment2.Add(this.vbox3);
306- this.vbox5.Add(this.alignment2);
307- Gtk.Box.BoxChild w50 = ((Gtk.Box.BoxChild)(this.vbox5[this.alignment2]));
308- w50.Position = 0;
309- this.notebook1.Add(this.vbox5);
310- Gtk.Notebook.NotebookChild w51 = ((Gtk.Notebook.NotebookChild)(this.notebook1[this.vbox5]));
311- w51.Position = 1;
312- // Notebook tab
313- this.label2 = new Gtk.Label();
314- this.label2.Name = "label2";
315- this.label2.LabelProp = Mono.Addins.AddinManager.CurrentLocalizer.GetString("Ignored Folders");
316- this.notebook1.SetTabLabel(this.vbox5, this.label2);
317- this.label2.ShowAll();
318- this.vbox1.Add(this.notebook1);
319- Gtk.Box.BoxChild w52 = ((Gtk.Box.BoxChild)(this.vbox1[this.notebook1]));
320- w52.Position = 0;
321- this.vbox2.Add(this.vbox1);
322- Gtk.Box.BoxChild w53 = ((Gtk.Box.BoxChild)(this.vbox2[this.vbox1]));
323- w53.Position = 0;
324- this.alignment1.Add(this.vbox2);
325- this.Add(this.alignment1);
326- if ((this.Child != null)) {
327- this.Child.ShowAll();
328- }
329- this.Show();
330- this.index_remove_btn.Clicked += new System.EventHandler(this.OnRemoveBtnClicked);
331- this.index_add_btn.Clicked += new System.EventHandler(this.OnAddBtnClicked);
332- this.show_hidden_chk.Clicked += new System.EventHandler(this.OnShowHiddenChkClicked);
333- this.ignore_remove_btn.Clicked += new System.EventHandler(this.OnRemoveBtnClicked);
334- this.ignore_add_btn.Clicked += new System.EventHandler(this.OnAddBtnClicked);
335- }
336- }
337+// This file has been generated by the GUI designer. Do not modify.
338+namespace Do.FilesAndFolders
339+{
340+ public partial class Configuration
341+ {
342+ private global::Gtk.Alignment alignment1;
343+ private global::Gtk.VBox vbox2;
344+ private global::Gtk.VBox vbox1;
345+ private global::Gtk.Notebook notebook1;
346+ private global::Gtk.VBox vbox4;
347+ private global::Gtk.Alignment alignment3;
348+ private global::Gtk.VBox vbox6;
349+ private global::Gtk.ScrolledWindow index_node_scroll;
350+ private global::Gtk.HBox hbox1;
351+ private global::Gtk.Label ExtensionsHelp;
352+ private global::Gtk.HButtonBox hbuttonbox2;
353+ private global::Gtk.Button index_remove_btn;
354+ private global::Gtk.Button index_add_btn;
355+ private global::Gtk.CheckButton show_hidden_chk;
356+ private global::Gtk.Label label1;
357+ private global::Gtk.VBox vbox5;
358+ private global::Gtk.Alignment alignment2;
359+ private global::Gtk.VBox vbox3;
360+ private global::Gtk.ScrolledWindow ignore_node_scroll;
361+ private global::Gtk.HBox hbox3;
362+ private global::Gtk.Label IgnoreLabel;
363+ private global::Gtk.HButtonBox hbuttonbox3;
364+ private global::Gtk.Button ignore_remove_btn;
365+ private global::Gtk.Button ignore_add_btn;
366+ private global::Gtk.Label label2;
367+
368+ protected virtual void Build ()
369+ {
370+ global::Stetic.Gui.Initialize (this);
371+ // Widget Do.FilesAndFolders.Configuration
372+ global::Stetic.BinContainer.Attach (this);
373+ this.WidthRequest = 630;
374+ this.Name = "Do.FilesAndFolders.Configuration";
375+ // Container child Do.FilesAndFolders.Configuration.Gtk.Container+ContainerChild
376+ this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
377+ this.alignment1.Name = "alignment1";
378+ this.alignment1.BorderWidth = ((uint)(8));
379+ // Container child alignment1.Gtk.Container+ContainerChild
380+ this.vbox2 = new global::Gtk.VBox ();
381+ this.vbox2.Name = "vbox2";
382+ this.vbox2.Spacing = 6;
383+ // Container child vbox2.Gtk.Box+BoxChild
384+ this.vbox1 = new global::Gtk.VBox ();
385+ this.vbox1.Name = "vbox1";
386+ this.vbox1.Spacing = 6;
387+ // Container child vbox1.Gtk.Box+BoxChild
388+ this.notebook1 = new global::Gtk.Notebook ();
389+ this.notebook1.HeightRequest = 270;
390+ this.notebook1.CanFocus = true;
391+ this.notebook1.Name = "notebook1";
392+ this.notebook1.CurrentPage = 0;
393+ this.notebook1.ShowBorder = false;
394+ // Container child notebook1.Gtk.Notebook+NotebookChild
395+ this.vbox4 = new global::Gtk.VBox ();
396+ this.vbox4.Name = "vbox4";
397+ this.vbox4.Spacing = 6;
398+ // Container child vbox4.Gtk.Box+BoxChild
399+ this.alignment3 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
400+ this.alignment3.Name = "alignment3";
401+ this.alignment3.LeftPadding = ((uint)(8));
402+ this.alignment3.TopPadding = ((uint)(8));
403+ this.alignment3.RightPadding = ((uint)(8));
404+ this.alignment3.BottomPadding = ((uint)(8));
405+ // Container child alignment3.Gtk.Container+ContainerChild
406+ this.vbox6 = new global::Gtk.VBox ();
407+ this.vbox6.Name = "vbox6";
408+ this.vbox6.Spacing = 6;
409+ // Container child vbox6.Gtk.Box+BoxChild
410+ this.index_node_scroll = new global::Gtk.ScrolledWindow ();
411+ this.index_node_scroll.CanFocus = true;
412+ this.index_node_scroll.Name = "index_node_scroll";
413+ this.index_node_scroll.ShadowType = ((global::Gtk.ShadowType)(1));
414+ this.vbox6.Add (this.index_node_scroll);
415+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.index_node_scroll]));
416+ w1.Position = 0;
417+ // Container child vbox6.Gtk.Box+BoxChild
418+ this.hbox1 = new global::Gtk.HBox ();
419+ this.hbox1.Name = "hbox1";
420+ this.hbox1.Spacing = 6;
421+ // Container child hbox1.Gtk.Box+BoxChild
422+ this.ExtensionsHelp = new global::Gtk.Label ();
423+ this.ExtensionsHelp.WidthRequest = 410;
424+ this.ExtensionsHelp.HeightRequest = 30;
425+ this.ExtensionsHelp.Name = "ExtensionsHelp";
426+ this.ExtensionsHelp.Xpad = 8;
427+ this.ExtensionsHelp.Xalign = 0F;
428+ this.ExtensionsHelp.LabelProp = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Leave extensions blank to index all files. Use a comma seperated\nlist to index only those items. Example: gif,jpg,png\n\n");
429+ this.ExtensionsHelp.UseMarkup = true;
430+ this.ExtensionsHelp.Wrap = true;
431+ this.ExtensionsHelp.Justify = ((global::Gtk.Justification)(3));
432+ this.hbox1.Add (this.ExtensionsHelp);
433+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.ExtensionsHelp]));
434+ w2.Position = 0;
435+ w2.Expand = false;
436+ w2.Fill = false;
437+ // Container child hbox1.Gtk.Box+BoxChild
438+ this.hbuttonbox2 = new global::Gtk.HButtonBox ();
439+ this.hbuttonbox2.Name = "hbuttonbox2";
440+ // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
441+ this.index_remove_btn = new global::Gtk.Button ();
442+ this.index_remove_btn.CanFocus = true;
443+ this.index_remove_btn.Name = "index_remove_btn";
444+ this.index_remove_btn.UseUnderline = true;
445+ // Container child index_remove_btn.Gtk.Container+ContainerChild
446+ global::Gtk.Alignment w3 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
447+ // Container child GtkAlignment.Gtk.Container+ContainerChild
448+ global::Gtk.HBox w4 = new global::Gtk.HBox ();
449+ w4.Spacing = 2;
450+ // Container child GtkHBox.Gtk.Container+ContainerChild
451+ global::Gtk.Image w5 = new global::Gtk.Image ();
452+ w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Button);
453+ w4.Add (w5);
454+ // Container child GtkHBox.Gtk.Container+ContainerChild
455+ global::Gtk.Label w7 = new global::Gtk.Label ();
456+ w4.Add (w7);
457+ w3.Add (w4);
458+ this.index_remove_btn.Add (w3);
459+ this.hbuttonbox2.Add (this.index_remove_btn);
460+ global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.index_remove_btn]));
461+ w11.Expand = false;
462+ w11.Fill = false;
463+ // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
464+ this.index_add_btn = new global::Gtk.Button ();
465+ this.index_add_btn.CanFocus = true;
466+ this.index_add_btn.Name = "index_add_btn";
467+ this.index_add_btn.UseUnderline = true;
468+ // Container child index_add_btn.Gtk.Container+ContainerChild
469+ global::Gtk.Alignment w12 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
470+ // Container child GtkAlignment.Gtk.Container+ContainerChild
471+ global::Gtk.HBox w13 = new global::Gtk.HBox ();
472+ w13.Spacing = 2;
473+ // Container child GtkHBox.Gtk.Container+ContainerChild
474+ global::Gtk.Image w14 = new global::Gtk.Image ();
475+ w14.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu);
476+ w13.Add (w14);
477+ // Container child GtkHBox.Gtk.Container+ContainerChild
478+ global::Gtk.Label w16 = new global::Gtk.Label ();
479+ w13.Add (w16);
480+ w12.Add (w13);
481+ this.index_add_btn.Add (w12);
482+ this.hbuttonbox2.Add (this.index_add_btn);
483+ global::Gtk.ButtonBox.ButtonBoxChild w20 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.index_add_btn]));
484+ w20.Position = 1;
485+ w20.Expand = false;
486+ w20.Fill = false;
487+ this.hbox1.Add (this.hbuttonbox2);
488+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hbuttonbox2]));
489+ w21.Position = 1;
490+ w21.Expand = false;
491+ this.vbox6.Add (this.hbox1);
492+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.hbox1]));
493+ w22.Position = 1;
494+ w22.Expand = false;
495+ w22.Fill = false;
496+ // Container child vbox6.Gtk.Box+BoxChild
497+ this.show_hidden_chk = new global::Gtk.CheckButton ();
498+ this.show_hidden_chk.CanFocus = true;
499+ this.show_hidden_chk.Name = "show_hidden_chk";
500+ this.show_hidden_chk.Label = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Show hidden files");
501+ this.show_hidden_chk.DrawIndicator = true;
502+ this.show_hidden_chk.UseUnderline = true;
503+ this.show_hidden_chk.BorderWidth = ((uint)(5));
504+ this.vbox6.Add (this.show_hidden_chk);
505+ global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.show_hidden_chk]));
506+ w23.Position = 2;
507+ w23.Expand = false;
508+ w23.Fill = false;
509+ this.alignment3.Add (this.vbox6);
510+ this.vbox4.Add (this.alignment3);
511+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.alignment3]));
512+ w25.Position = 0;
513+ this.notebook1.Add (this.vbox4);
514+ // Notebook tab
515+ this.label1 = new global::Gtk.Label ();
516+ this.label1.Name = "label1";
517+ this.label1.LabelProp = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Indexed Folders");
518+ this.notebook1.SetTabLabel (this.vbox4, this.label1);
519+ this.label1.ShowAll ();
520+ // Container child notebook1.Gtk.Notebook+NotebookChild
521+ this.vbox5 = new global::Gtk.VBox ();
522+ this.vbox5.Name = "vbox5";
523+ this.vbox5.Spacing = 6;
524+ // Container child vbox5.Gtk.Box+BoxChild
525+ this.alignment2 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
526+ this.alignment2.Name = "alignment2";
527+ this.alignment2.LeftPadding = ((uint)(8));
528+ this.alignment2.TopPadding = ((uint)(8));
529+ this.alignment2.RightPadding = ((uint)(8));
530+ this.alignment2.BottomPadding = ((uint)(8));
531+ // Container child alignment2.Gtk.Container+ContainerChild
532+ this.vbox3 = new global::Gtk.VBox ();
533+ this.vbox3.Name = "vbox3";
534+ this.vbox3.Spacing = 6;
535+ // Container child vbox3.Gtk.Box+BoxChild
536+ this.ignore_node_scroll = new global::Gtk.ScrolledWindow ();
537+ this.ignore_node_scroll.CanFocus = true;
538+ this.ignore_node_scroll.Name = "ignore_node_scroll";
539+ this.ignore_node_scroll.ShadowType = ((global::Gtk.ShadowType)(1));
540+ this.vbox3.Add (this.ignore_node_scroll);
541+ global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.ignore_node_scroll]));
542+ w27.Position = 0;
543+ // Container child vbox3.Gtk.Box+BoxChild
544+ this.hbox3 = new global::Gtk.HBox ();
545+ this.hbox3.Name = "hbox3";
546+ this.hbox3.Spacing = 6;
547+ // Container child hbox3.Gtk.Box+BoxChild
548+ this.IgnoreLabel = new global::Gtk.Label ();
549+ this.IgnoreLabel.Name = "IgnoreLabel";
550+ this.hbox3.Add (this.IgnoreLabel);
551+ global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.IgnoreLabel]));
552+ w28.Position = 0;
553+ w28.Fill = false;
554+ // Container child hbox3.Gtk.Box+BoxChild
555+ this.hbuttonbox3 = new global::Gtk.HButtonBox ();
556+ this.hbuttonbox3.Name = "hbuttonbox3";
557+ // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild
558+ this.ignore_remove_btn = new global::Gtk.Button ();
559+ this.ignore_remove_btn.CanFocus = true;
560+ this.ignore_remove_btn.Name = "ignore_remove_btn";
561+ this.ignore_remove_btn.UseUnderline = true;
562+ // Container child ignore_remove_btn.Gtk.Container+ContainerChild
563+ global::Gtk.Alignment w29 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
564+ // Container child GtkAlignment.Gtk.Container+ContainerChild
565+ global::Gtk.HBox w30 = new global::Gtk.HBox ();
566+ w30.Spacing = 2;
567+ // Container child GtkHBox.Gtk.Container+ContainerChild
568+ global::Gtk.Image w31 = new global::Gtk.Image ();
569+ w31.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Button);
570+ w30.Add (w31);
571+ // Container child GtkHBox.Gtk.Container+ContainerChild
572+ global::Gtk.Label w33 = new global::Gtk.Label ();
573+ w30.Add (w33);
574+ w29.Add (w30);
575+ this.ignore_remove_btn.Add (w29);
576+ this.hbuttonbox3.Add (this.ignore_remove_btn);
577+ global::Gtk.ButtonBox.ButtonBoxChild w37 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3 [this.ignore_remove_btn]));
578+ w37.Expand = false;
579+ w37.Fill = false;
580+ w37.Padding = ((uint)(5));
581+ // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild
582+ this.ignore_add_btn = new global::Gtk.Button ();
583+ this.ignore_add_btn.CanFocus = true;
584+ this.ignore_add_btn.Name = "ignore_add_btn";
585+ this.ignore_add_btn.UseUnderline = true;
586+ // Container child ignore_add_btn.Gtk.Container+ContainerChild
587+ global::Gtk.Alignment w38 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
588+ // Container child GtkAlignment.Gtk.Container+ContainerChild
589+ global::Gtk.HBox w39 = new global::Gtk.HBox ();
590+ w39.Spacing = 2;
591+ // Container child GtkHBox.Gtk.Container+ContainerChild
592+ global::Gtk.Image w40 = new global::Gtk.Image ();
593+ w40.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu);
594+ w39.Add (w40);
595+ // Container child GtkHBox.Gtk.Container+ContainerChild
596+ global::Gtk.Label w42 = new global::Gtk.Label ();
597+ w39.Add (w42);
598+ w38.Add (w39);
599+ this.ignore_add_btn.Add (w38);
600+ this.hbuttonbox3.Add (this.ignore_add_btn);
601+ global::Gtk.ButtonBox.ButtonBoxChild w46 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3 [this.ignore_add_btn]));
602+ w46.Position = 1;
603+ w46.Expand = false;
604+ w46.Fill = false;
605+ w46.Padding = ((uint)(5));
606+ this.hbox3.Add (this.hbuttonbox3);
607+ global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.hbuttonbox3]));
608+ w47.Position = 1;
609+ w47.Expand = false;
610+ this.vbox3.Add (this.hbox3);
611+ global::Gtk.Box.BoxChild w48 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox3]));
612+ w48.Position = 1;
613+ w48.Expand = false;
614+ w48.Fill = false;
615+ this.alignment2.Add (this.vbox3);
616+ this.vbox5.Add (this.alignment2);
617+ global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.alignment2]));
618+ w50.Position = 0;
619+ this.notebook1.Add (this.vbox5);
620+ global::Gtk.Notebook.NotebookChild w51 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox5]));
621+ w51.Position = 1;
622+ // Notebook tab
623+ this.label2 = new global::Gtk.Label ();
624+ this.label2.Name = "label2";
625+ this.label2.LabelProp = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Ignored Folders");
626+ this.notebook1.SetTabLabel (this.vbox5, this.label2);
627+ this.label2.ShowAll ();
628+ this.vbox1.Add (this.notebook1);
629+ global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.notebook1]));
630+ w52.Position = 0;
631+ this.vbox2.Add (this.vbox1);
632+ global::Gtk.Box.BoxChild w53 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.vbox1]));
633+ w53.Position = 0;
634+ this.alignment1.Add (this.vbox2);
635+ this.Add (this.alignment1);
636+ if ((this.Child != null)) {
637+ this.Child.ShowAll ();
638+ }
639+ this.Show ();
640+ this.index_remove_btn.Clicked += new global::System.EventHandler (this.OnRemoveBtnClicked);
641+ this.index_add_btn.Clicked += new global::System.EventHandler (this.OnAddBtnClicked);
642+ this.show_hidden_chk.Clicked += new global::System.EventHandler (this.OnShowHiddenChkClicked);
643+ this.ignore_remove_btn.Clicked += new global::System.EventHandler (this.OnRemoveBtnClicked);
644+ this.ignore_add_btn.Clicked += new global::System.EventHandler (this.OnAddBtnClicked);
645+ }
646+ }
647 }
648
649=== modified file 'File/gtk-gui/generated.cs'
650--- File/gtk-gui/generated.cs 2009-03-05 01:12:21 +0000
651+++ File/gtk-gui/generated.cs 2012-02-20 22:25:22 +0000
652@@ -1,115 +1,115 @@
653-// ------------------------------------------------------------------------------
654-// <autogenerated>
655-// This code was generated by a tool.
656-//
657-//
658-// Changes to this file may cause incorrect behavior and will be lost if
659-// the code is regenerated.
660-// </autogenerated>
661-// ------------------------------------------------------------------------------
662
663-namespace Stetic {
664-
665-
666- internal class Gui {
667-
668- private static bool initialized;
669-
670- internal static void Initialize(Gtk.Widget iconRenderer) {
671- if ((Stetic.Gui.initialized == false)) {
672- Stetic.Gui.initialized = true;
673- }
674- }
675- }
676-
677- internal class BinContainer {
678-
679- private Gtk.Widget child;
680-
681- private Gtk.UIManager uimanager;
682-
683- public static BinContainer Attach(Gtk.Bin bin) {
684- BinContainer bc = new BinContainer();
685- bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
686- bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
687- bin.Added += new Gtk.AddedHandler(bc.OnAdded);
688- return bc;
689- }
690-
691- private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) {
692- if ((this.child != null)) {
693- args.Requisition = this.child.SizeRequest();
694- }
695- }
696-
697- private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) {
698- if ((this.child != null)) {
699- this.child.Allocation = args.Allocation;
700- }
701- }
702-
703- private void OnAdded(object sender, Gtk.AddedArgs args) {
704- this.child = args.Widget;
705- }
706-
707- public void SetUiManager(Gtk.UIManager uim) {
708- this.uimanager = uim;
709- this.child.Realized += new System.EventHandler(this.OnRealized);
710- }
711-
712- private void OnRealized(object sender, System.EventArgs args) {
713- if ((this.uimanager != null)) {
714- Gtk.Widget w;
715- w = this.child.Toplevel;
716- if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w))) {
717- ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
718- this.uimanager = null;
719- }
720- }
721- }
722- }
723-
724- internal class IconLoader {
725-
726- public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size, int sz) {
727- Gdk.Pixbuf res = widget.RenderIcon(name, size, null);
728- if ((res != null)) {
729- return res;
730- }
731- else {
732- try {
733- return Gtk.IconTheme.Default.LoadIcon(name, sz, 0);
734- }
735- catch (System.Exception ) {
736- if ((name != "gtk-missing-image")) {
737- return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size, sz);
738- }
739- else {
740- Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz);
741- Gdk.GC gc = new Gdk.GC(pmap);
742- gc.RgbFgColor = new Gdk.Color(255, 255, 255);
743- pmap.DrawRectangle(gc, true, 0, 0, sz, sz);
744- gc.RgbFgColor = new Gdk.Color(0, 0, 0);
745- pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1));
746- gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
747- gc.RgbFgColor = new Gdk.Color(255, 0, 0);
748- pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
749- pmap.DrawLine(gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
750- return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
751- }
752- }
753- }
754- }
755- }
756-
757- internal class ActionGroups {
758-
759- public static Gtk.ActionGroup GetActionGroup(System.Type type) {
760- return Stetic.ActionGroups.GetActionGroup(type.FullName);
761- }
762-
763- public static Gtk.ActionGroup GetActionGroup(string name) {
764- return null;
765- }
766- }
767+// This file has been generated by the GUI designer. Do not modify.
768+namespace Stetic
769+{
770+ internal class Gui
771+ {
772+ private static bool initialized;
773+
774+ internal static void Initialize (Gtk.Widget iconRenderer)
775+ {
776+ if ((Stetic.Gui.initialized == false)) {
777+ Stetic.Gui.initialized = true;
778+ }
779+ }
780+ }
781+
782+ internal class BinContainer
783+ {
784+ private Gtk.Widget child;
785+ private Gtk.UIManager uimanager;
786+
787+ public static BinContainer Attach (Gtk.Bin bin)
788+ {
789+ BinContainer bc = new BinContainer ();
790+ bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
791+ bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
792+ bin.Added += new Gtk.AddedHandler (bc.OnAdded);
793+ return bc;
794+ }
795+
796+ private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
797+ {
798+ if ((this.child != null)) {
799+ args.Requisition = this.child.SizeRequest ();
800+ }
801+ }
802+
803+ private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
804+ {
805+ if ((this.child != null)) {
806+ this.child.Allocation = args.Allocation;
807+ }
808+ }
809+
810+ private void OnAdded (object sender, Gtk.AddedArgs args)
811+ {
812+ this.child = args.Widget;
813+ }
814+
815+ public void SetUiManager (Gtk.UIManager uim)
816+ {
817+ this.uimanager = uim;
818+ this.child.Realized += new System.EventHandler (this.OnRealized);
819+ }
820+
821+ private void OnRealized (object sender, System.EventArgs args)
822+ {
823+ if ((this.uimanager != null)) {
824+ Gtk.Widget w;
825+ w = this.child.Toplevel;
826+ if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
827+ ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
828+ this.uimanager = null;
829+ }
830+ }
831+ }
832+ }
833+
834+ internal class IconLoader
835+ {
836+ public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
837+ {
838+ Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
839+ if ((res != null)) {
840+ return res;
841+ } else {
842+ int sz;
843+ int sy;
844+ global::Gtk.Icon.SizeLookup (size, out sz, out sy);
845+ try {
846+ return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
847+ } catch (System.Exception) {
848+ if ((name != "gtk-missing-image")) {
849+ return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
850+ } else {
851+ Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
852+ Gdk.GC gc = new Gdk.GC (pmap);
853+ gc.RgbFgColor = new Gdk.Color (255, 255, 255);
854+ pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
855+ gc.RgbFgColor = new Gdk.Color (0, 0, 0);
856+ pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
857+ gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
858+ gc.RgbFgColor = new Gdk.Color (255, 0, 0);
859+ pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
860+ pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
861+ return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
862+ }
863+ }
864+ }
865+ }
866+ }
867+
868+ internal class ActionGroups
869+ {
870+ public static Gtk.ActionGroup GetActionGroup (System.Type type)
871+ {
872+ return Stetic.ActionGroups.GetActionGroup (type.FullName);
873+ }
874+
875+ public static Gtk.ActionGroup GetActionGroup (string name)
876+ {
877+ return null;
878+ }
879+ }
880 }
881
882=== modified file 'File/gtk-gui/gui.stetic'
883--- File/gtk-gui/gui.stetic 2009-06-23 00:52:54 +0000
884+++ File/gtk-gui/gui.stetic 2012-02-20 22:25:22 +0000
885@@ -5,12 +5,11 @@
886 <target-gtk-version>2.12</target-gtk-version>
887 </configuration>
888 <import>
889- <widget-library name="Do.Interface.Linux, Version=0.9.0.0, Culture=neutral" />
890- <widget-library name="Do.Platform.Linux, Version=0.9.0.0, Culture=neutral" />
891 <widget-library name="../bin/Debug/File.dll" internal="true" />
892 </import>
893- <widget class="Gtk.Bin" id="Do.FilesAndFolders.Configuration" design-size="414 356">
894+ <widget class="Gtk.Bin" id="Do.FilesAndFolders.Configuration" design-size="630 356">
895 <property name="MemberName" />
896+ <property name="WidthRequest">630</property>
897 <child>
898 <widget class="Gtk.Alignment" id="alignment1">
899 <property name="MemberName" />
900@@ -70,12 +69,25 @@
901 <property name="MemberName" />
902 <property name="Spacing">6</property>
903 <child>
904- <widget class="Gtk.Label" id="IndexLabel">
905+ <widget class="Gtk.Label" id="ExtensionsHelp">
906 <property name="MemberName" />
907+ <property name="WidthRequest">410</property>
908+ <property name="HeightRequest">30</property>
909+ <property name="Xpad">8</property>
910+ <property name="Xalign">0</property>
911+ <property name="LabelProp" translatable="yes">Leave extensions blank to index all files. Use a comma seperated
912+list to index only those items. Example: gif,jpg,png
913+
914+</property>
915+ <property name="UseMarkup">True</property>
916+ <property name="Wrap">True</property>
917+ <property name="Justify">Fill</property>
918 </widget>
919 <packing>
920 <property name="Position">0</property>
921- <property name="AutoSize">False</property>
922+ <property name="AutoSize">True</property>
923+ <property name="Expand">False</property>
924+ <property name="Fill">False</property>
925 </packing>
926 </child>
927 <child>
928
929=== modified file 'File/src/Do/Do.FilesAndFolders/Configuration.cs'
930--- File/src/Do/Do.FilesAndFolders/Configuration.cs 2009-06-22 04:05:16 +0000
931+++ File/src/Do/Do.FilesAndFolders/Configuration.cs 2012-02-20 22:25:22 +0000
932@@ -98,7 +98,7 @@
933
934 if (chooser.Run () == (int) ResponseType.Accept) {
935 if (!Plugin.FolderIndex.ContainsFolder (chooser.Filename))
936- Plugin.FolderIndex.Add (new IndexedFolder (chooser.Filename, depth, status));
937+ Plugin.FolderIndex.Add (new IndexedFolder (chooser.Filename, depth, "", status));
938 RefreshCurrentView ();
939 }
940 chooser.Destroy ();
941
942=== modified file 'File/src/Do/Do.FilesAndFolders/FileItemSource.cs'
943--- File/src/Do/Do.FilesAndFolders/FileItemSource.cs 2009-06-24 14:35:46 +0000
944+++ File/src/Do/Do.FilesAndFolders/FileItemSource.cs 2012-02-20 22:25:22 +0000
945@@ -20,6 +20,7 @@
946 using System;
947 using System.IO;
948 using System.Linq;
949+using System.Collections;
950 using System.Collections.Generic;
951
952 using Mono.Addins;
953@@ -37,6 +38,7 @@
954
955 IEnumerable<Item> items;
956 bool maximum_files_warned;
957+ private static IList<string> NoExtensions = "".Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries);
958
959 string MaximumFilesIndexedWarning {
960 get {
961@@ -105,7 +107,7 @@
962 else
963 return Enumerable.Empty<Item> ();
964
965- return RecursiveGetItems (file.Path, 1, Plugin.Preferences.IncludeHiddenFilesWhenBrowsing);
966+ return RecursiveGetItems(file.Path, 1, NoExtensions, Plugin.Preferences.IncludeHiddenFilesWhenBrowsing);
967 }
968
969 public override void UpdateItems ()
970@@ -118,12 +120,12 @@
971
972 if (Plugin.Preferences.LimitMaxFilesIndexed)
973 items = Plugin.FolderIndex
974- .SelectMany (folder => RecursiveGetItems (folder.Path, folder.Level, Plugin.Preferences.IncludeHiddenFiles, ignored))
975+ .SelectMany (folder => RecursiveGetItems(folder.Path, folder.Level, folder.ExtensionList, Plugin.Preferences.IncludeHiddenFiles, ignored))
976 .Take (Plugin.Preferences.MaximumFilesIndexed)
977 .ToArray ();
978 else
979 items = Plugin.FolderIndex
980- .SelectMany (folder => RecursiveGetItems (folder.Path, folder.Level, Plugin.Preferences.IncludeHiddenFiles, ignored))
981+ .SelectMany (folder => RecursiveGetItems(folder.Path, folder.Level, folder.ExtensionList, Plugin.Preferences.IncludeHiddenFiles, ignored))
982 .ToArray ();
983
984 if (!maximum_files_warned && items.Count () == Plugin.Preferences.MaximumFilesIndexed) {
985@@ -157,17 +159,17 @@
986 /// A <see cref="IEnumerable"/>
987 /// </returns>
988
989- static IEnumerable<Item> RecursiveGetItems (string path, uint levels, bool includeHidden)
990+ static IEnumerable<Item> RecursiveGetItems (string path, uint levels, IList<string> extensions, bool includeHidden)
991 {
992- return RecursiveGetItems(path, levels, includeHidden, Enumerable.Empty<IndexedFolder> ());
993+ return RecursiveGetItems(path, levels, extensions, includeHidden, Enumerable.Empty<IndexedFolder> ());
994 }
995
996- static IEnumerable<Item> RecursiveGetItems (string path, uint levels, bool includeHidden, IEnumerable<IndexedFolder> ignored)
997+ static IEnumerable<Item> RecursiveGetItems (string path, uint levels, IList<string> extensions, bool includeHidden, IEnumerable<IndexedFolder> ignored)
998 {
999 IEnumerable<string> files;
1000 IEnumerable<Item> fileItems, applicationItems;
1001
1002- files = RecursiveListFiles (path, levels, includeHidden, ignored);
1003+ files = RecursiveListFiles (path, levels, extensions, includeHidden, ignored);
1004
1005 fileItems = files
1006 .Select (filepath => Plugin.NewFileItem (filepath))
1007@@ -181,7 +183,7 @@
1008 return applicationItems.Concat (fileItems);
1009 }
1010
1011- static IEnumerable<string> RecursiveListFiles (string path, uint levels, bool includeHidden, IEnumerable<IndexedFolder> ignored)
1012+ static IEnumerable<string> RecursiveListFiles (string path, uint levels, IList<string> extensions, bool includeHidden, IEnumerable<IndexedFolder> ignored)
1013 {
1014 IEnumerable<string> results = null;
1015
1016@@ -194,11 +196,11 @@
1017 IEnumerable<string> files, directories, recursiveFiles;
1018
1019 files = Directory.GetFiles (path)
1020- .Where (filepath => ShouldIndexPath (filepath, includeHidden, ignored));
1021+ .Where (filepath => ShouldIndexPath (filepath, includeHidden, extensions, ignored));
1022 directories = Directory.GetDirectories (path)
1023- .Where (filepath => ShouldIndexPath (filepath, includeHidden, ignored));
1024+ .Where (filepath => ShouldIndexPath (filepath, includeHidden, extensions, ignored));
1025 recursiveFiles = directories
1026- .SelectMany (dir => RecursiveListFiles (dir, levels - 1, includeHidden, ignored));
1027+ .SelectMany (dir => RecursiveListFiles (dir, levels - 1, extensions, includeHidden, ignored));
1028 results = files.Concat (directories).Concat (recursiveFiles);
1029
1030 } catch (Exception e) {
1031@@ -209,14 +211,21 @@
1032 return results;
1033 }
1034
1035- static bool ShouldIndexPath (string path, bool includeHidden, IEnumerable<IndexedFolder> ignored)
1036+ static bool ShouldIndexPath (string path, bool includeHidden, IList<string> extensions, IEnumerable<IndexedFolder> ignored)
1037 {
1038 string filename = Path.GetFileName (path);
1039 bool isForbidden = filename == "." || filename == ".." || filename.EndsWith ("~");
1040 bool isHidden = filename.StartsWith (".");
1041+ bool isIncluded = true;
1042+
1043+ if (File.Exists(path) && extensions.Count() > 0) {
1044+ string extension = Path.GetExtension(path).TrimStart(new char[] {'.'});
1045+ isIncluded = extensions.Contains(extension);
1046+ }
1047+
1048 if (ignored.Where (folder => path == folder.Path).Any ())
1049 isForbidden = true;
1050- return !isForbidden && (includeHidden || !isHidden);
1051+ return !isForbidden && isIncluded && (includeHidden || !isHidden);
1052 }
1053
1054 }
1055
1056=== modified file 'File/src/Do/Do.FilesAndFolders/IndexedFolder.cs'
1057--- File/src/Do/Do.FilesAndFolders/IndexedFolder.cs 2010-11-04 22:55:52 +0000
1058+++ File/src/Do/Do.FilesAndFolders/IndexedFolder.cs 2012-02-20 22:25:22 +0000
1059@@ -20,6 +20,7 @@
1060 using System;
1061 using System.Collections;
1062 using System.Collections.Generic;
1063+using System.Linq;
1064
1065 using Do.Platform;
1066
1067@@ -30,24 +31,36 @@
1068 {
1069 public string Path { get; private set; }
1070 public uint Level { get; private set; }
1071+ public string Extensions { get; private set; }
1072+ public IList<string> ExtensionList { get; private set; }
1073 public FolderStatus Status { get; private set; }
1074
1075- public IndexedFolder (string path, uint level, FolderStatus status) : this ()
1076+ public IndexedFolder (string path, uint level, string extensions, FolderStatus status) : this ()
1077 {
1078 if (path == null) throw new ArgumentNullException ("path");
1079+ if (extensions == null) extensions = "";
1080
1081 Path = Services.Environment.ExpandPath (path);
1082 Level = level;
1083+ Extensions = extensions;
1084+ ExtensionList = BuildExtensionList();
1085 Status = status;
1086 }
1087
1088- public IndexedFolder (string path, uint level) : this (path, level, FolderStatus.Indexed)
1089+ private IList<string> BuildExtensionList ()
1090+ {
1091+ IList<string> extensions = Extensions.Replace(" ", "").Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries);
1092+ extensions = (from item in extensions select(item = item.ToLower().TrimStart('.').Trim())).ToList();
1093+ return extensions;
1094+ }
1095+
1096+ public IndexedFolder (string path, uint level) : this (path, level, "", FolderStatus.Indexed)
1097 {
1098 }
1099
1100 public override string ToString ()
1101 {
1102- return string.Format ("{0} {2} {1} {3}", GetType ().Name, Path, Level, Status);
1103+ return string.Format ("{0} {2} {1} {3} {4}", GetType ().Name, Path, Level, Extensions, Status);
1104 }
1105
1106 public override bool Equals (object other)
1107@@ -57,12 +70,12 @@
1108
1109 public override int GetHashCode ()
1110 {
1111- return Path.GetHashCode () ^ Level.GetHashCode () ^ Status.GetHashCode ();
1112+ return Path.GetHashCode () ^ Level.GetHashCode () ^ Extensions.GetHashCode() ^ Status.GetHashCode ();
1113 }
1114
1115 public bool Equals (IndexedFolder other)
1116 {
1117- return other.Path == Path && other.Level == Level && other.Status == Status;
1118+ return other.Path == Path && other.Level == Level && other.Extensions == Extensions && other.Status == Status;
1119 }
1120
1121 public static bool operator== (IndexedFolder left, IndexedFolder right)
1122
1123=== modified file 'File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs'
1124--- File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs 2009-03-04 22:34:14 +0000
1125+++ File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs 2012-02-20 22:25:22 +0000
1126@@ -54,10 +54,10 @@
1127
1128 IEnumerable<IndexedFolder> GetDefaultFolders ()
1129 {
1130- yield return new IndexedFolder (Path.GetDirectoryName (Plugin.ImportantFolders.UserHome), 1, FolderStatus.Indexed);
1131- yield return new IndexedFolder (Plugin.ImportantFolders.UserHome, 1, FolderStatus.Indexed);
1132- yield return new IndexedFolder (Plugin.ImportantFolders.Desktop, 1, FolderStatus.Indexed);
1133- yield return new IndexedFolder (Plugin.ImportantFolders.Documents, 2, FolderStatus.Indexed);
1134+ yield return new IndexedFolder (Path.GetDirectoryName (Plugin.ImportantFolders.UserHome), 1, "", FolderStatus.Indexed);
1135+ yield return new IndexedFolder (Plugin.ImportantFolders.UserHome, 1, "", FolderStatus.Indexed);
1136+ yield return new IndexedFolder (Plugin.ImportantFolders.Desktop, 1, "", FolderStatus.Indexed);
1137+ yield return new IndexedFolder (Plugin.ImportantFolders.Documents, 2, "", FolderStatus.Indexed);
1138 }
1139
1140 public IndexedFolderCollection ()
1141@@ -74,11 +74,11 @@
1142 }
1143 }
1144
1145- public void UpdateIndexedFolder (string path, string newPath, uint newDepth, FolderStatus newStatus)
1146+ public void UpdateIndexedFolder (string path, string newPath, uint newDepth, string newExtensions, FolderStatus newStatus)
1147 {
1148 if (newDepth > LargeIndexLevel)
1149 Log<IndexedFolderCollection>.Warn (LargeIndexLevelWarning, newPath, newDepth);
1150- UpdateIndexedFolder (path, new IndexedFolder (newPath, newDepth, newStatus));
1151+ UpdateIndexedFolder (path, new IndexedFolder (newPath, newDepth, newExtensions, newStatus));
1152 }
1153
1154 public void UpdateIndexedFolder (string path, IndexedFolder folder)
1155@@ -163,7 +163,7 @@
1156 foreach (IndexedFolder folder in f) {
1157 if (folder.Level > 0 && folder.Status == FolderStatus.Ignored) {
1158 Log<IndexedFolderCollection>.Debug ("Old DB entry found for {0}, fixing.", folder.Path);
1159- UpdateIndexedFolder(folder.Path, folder.Path, folder.Level, FolderStatus.Indexed);
1160+ UpdateIndexedFolder(folder.Path, folder.Path, folder.Level, folder.Extensions, FolderStatus.Indexed);
1161 }
1162 }
1163 Log<IndexedFolderCollection>.Debug ("Loaded Files and Folders plugin state.");
1164
1165=== modified file 'File/src/IndexPathNodeView.cs'
1166--- File/src/IndexPathNodeView.cs 2010-04-11 17:45:19 +0000
1167+++ File/src/IndexPathNodeView.cs 2012-02-20 22:25:22 +0000
1168@@ -32,6 +32,7 @@
1169 public enum Column {
1170 Path = 0,
1171 Depth,
1172+ Extensions,
1173 NumColumns
1174 }
1175
1176@@ -41,7 +42,7 @@
1177 RulesHint = true;
1178 HeadersVisible = true;
1179
1180- Model = new ListStore (typeof (string), typeof (uint));
1181+ Model = new ListStore (typeof (string), typeof (uint), typeof(string));
1182
1183 cell = new CellRendererText ();
1184 (cell as CellRendererText).Width = 280;
1185@@ -53,7 +54,13 @@
1186 (cell as CellRendererText).Edited += OnDepthEdited;
1187 (cell as CellRendererText).Alignment = Pango.Alignment.Right;
1188 AppendColumn (AddinManager.CurrentLocalizer.GetString ("Depth"), cell, "text", Column.Depth);
1189-
1190+
1191+ cell = new CellRendererText();
1192+ (cell as CellRendererText).Editable = true;
1193+ (cell as CellRendererText).Edited += OnExtensionsEdited;
1194+ (cell as CellRendererText).Alignment = Pango.Alignment.Right;
1195+ AppendColumn(AddinManager.CurrentLocalizer.GetString("Extensions"), cell, "text", Column.Extensions);
1196+
1197 Refresh ();
1198 }
1199
1200@@ -66,6 +73,7 @@
1201 {
1202 uint depth;
1203 string path;
1204+ string extensions;
1205 TreeIter iter;
1206 ListStore store;
1207
1208@@ -73,14 +81,34 @@
1209 store.GetIter (out iter, new TreePath (e.Path));
1210
1211 path = store.GetValue (iter, (int) Column.Path) as string;
1212+ extensions = store.GetValue(iter, (int)Column.Extensions) as string;
1213 try {
1214 depth = uint.Parse (e.NewText);
1215 } catch {
1216 depth = 1;
1217 }
1218- Plugin.FolderIndex.UpdateIndexedFolder (path, path, depth, FolderStatus.Indexed);
1219+ Plugin.FolderIndex.UpdateIndexedFolder (path, path, depth, extensions, FolderStatus.Indexed);
1220
1221 Refresh ();
1222 }
1223+
1224+ public void OnExtensionsEdited (object o, EditedArgs e)
1225+ {
1226+ uint depth;
1227+ string path;
1228+ string extensions;
1229+ TreeIter iter;
1230+ ListStore store;
1231+
1232+ store = Model as ListStore;
1233+ store.GetIter(out iter, new TreePath(e.Path));
1234+
1235+ path = store.GetValue(iter, (int)Column.Path) as string;
1236+ depth = (uint)store.GetValue(iter, (int)Column.Depth);
1237+ extensions = e.NewText;
1238+ Plugin.FolderIndex.UpdateIndexedFolder(path, path, depth, extensions, FolderStatus.Indexed);
1239+
1240+ Refresh();
1241+ }
1242 }
1243 }
1244
1245=== modified file 'File/src/PathNodeView.cs'
1246--- File/src/PathNodeView.cs 2009-06-22 04:05:16 +0000
1247+++ File/src/PathNodeView.cs 2012-02-20 22:25:22 +0000
1248@@ -48,7 +48,7 @@
1249 store.Clear ();
1250 foreach (IndexedFolder pair in Plugin.FolderIndex) {
1251 if (indexed && pair.Status == FolderStatus.Indexed)
1252- store.AppendValues (pair.Path, pair.Level);
1253+ store.AppendValues (pair.Path, pair.Level, pair.Extensions);
1254 else if (!indexed && pair.Status == FolderStatus.Ignored)
1255 store.AppendValues (pair.Path);
1256 }

Subscribers

People subscribed via source and target branches