Merge lp:~cszikszoy/do-plugins/fandfignore into lp:do-plugins

Proposed by Chris S.
Status: Merged
Merged at revision: not available
Proposed branch: lp:~cszikszoy/do-plugins/fandfignore
Merge into: lp:do-plugins
Diff against target: None lines
To merge this branch: bzr merge lp:~cszikszoy/do-plugins/fandfignore
Reviewer Review Type Date Requested Status
Alex Launi (community) Needs Fixing
Review via email: mp+4053@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alex Launi (alexlauni) :
Revision history for this message
Alex Launi (alexlauni) wrote :

The nodeview can be abstracted further, the Refresh methods are almost identical, that should be a red flag for you to get rid of that duplicated code. Should be easy to do.

I think you should make RecursiveListFiles take a new IEnumerable parameter of files to ignore instead of keeping a heap variable of ignored paths, just keep it on the stack. Load it in UpdateItems, and then pass it in. The way you're doing it now requires you to keep a static variable on the heap, and also it looks like it will prevent files marked as ignored from showing up when exploring child items via the arrow keys.

review: Needs Fixing
lp:~cszikszoy/do-plugins/fandfignore updated
558. By Chris S.

further clean up

Revision history for this message
Alex Launi (alexlauni) wrote :

Here's a pretty bad bug, when installing this plugin for the first time, all of my indexed folders are listed as ignored.

lp:~cszikszoy/do-plugins/fandfignore updated
559. By Chris S.

try to fix old db versions

560. By Chris S.

detect old serialization database and fix

561. By Chris S.

use enum instead of bool

562. By Chris S.

added another constructor for IndexedFolder

563. By Chris S.

GUI fixes, button fixes

564. By Chris S.

update ver number

565. By Chris S.

merge trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'File/File.mdp'
2--- File/File.mdp 2009-02-28 16:16:48 +0000
3+++ File/File.mdp 2009-03-01 00:06:44 +0000
4@@ -41,6 +41,9 @@
5 <File name="src/Do/Do.FilesAndFolders/MoveToTrashAction.cs" subtype="Code" buildaction="Compile" />
6 <File name="src/Do/Do.FilesAndFolders/AbstractFileAction.cs" subtype="Code" buildaction="Compile" />
7 <File name="src/Do/Do.FilesAndFolders/RenameAction.cs" subtype="Code" buildaction="Compile" />
8+ <File name="src/CellRendererTogglePixbuf.cs" subtype="Code" buildaction="Compile" />
9+ <File name="src/IndexPathNodeView.cs" subtype="Code" buildaction="Compile" />
10+ <File name="src/IgnorePathNodeView.cs" subtype="Code" buildaction="Compile" />
11 </Contents>
12 <References>
13 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
14@@ -52,5 +55,6 @@
15 <ProjectReference type="Gac" localcopy="True" refto="Do.Universe, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />
16 <ProjectReference type="Gac" localcopy="True" refto="Do.Platform, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />
17 <ProjectReference type="Gac" localcopy="True" refto="Do.Platform.Linux, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />
18+ <ProjectReference type="Gac" localcopy="True" refto="Do.Interface.Linux, Version=0.9.0.0, Culture=neutral, PublicKeyToken=null" />
19 </References>
20 </Project>
21\ No newline at end of file
22
23=== modified file 'File/Makefile.am'
24--- File/Makefile.am 2009-01-14 00:28:50 +0000
25+++ File/Makefile.am 2009-02-16 01:11:46 +0000
26@@ -6,6 +6,8 @@
27 gtk-gui/Do.FilesAndFolders.Configuration.cs \
28 gtk-gui/generated.cs \
29 src/PathNodeView.cs \
30+ src/IndexPathNodeView.cs \
31+ src/IgnorePathNodeView.cs \
32 src/Do/Do.FilesAndFolders/NewFolderAction.cs \
33 src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs \
34 src/Do/Do.FilesAndFolders/Preferences.cs \
35
36=== modified file 'File/Resources/File.addin.xml'
37--- File/Resources/File.addin.xml 2009-01-10 02:13:19 +0000
38+++ File/Resources/File.addin.xml 2009-02-14 20:58:03 +0000
39@@ -1,10 +1,10 @@
40 <Addin
41 id="File"
42 namespace="Do"
43- version="2.0"
44+ version="2.2"
45 name="Files and Folders"
46 description="Search, browse, and perform other actions on files and folders."
47- author="David Siegel, Alex Launi, Ankit Solanki"
48+ author="David Siegel, Alex Launi, Ankit Solanki, Chris Szikszoy"
49 category="Official"
50 >
51
52
53=== modified file 'File/gtk-gui/Do.FilesAndFolders.Configuration.cs'
54--- File/gtk-gui/Do.FilesAndFolders.Configuration.cs 2009-02-13 21:34:02 +0000
55+++ File/gtk-gui/Do.FilesAndFolders.Configuration.cs 2009-02-17 10:48:05 +0000
56@@ -17,19 +17,23 @@
57
58 private Gtk.VBox vbox2;
59
60- private Gtk.ScrolledWindow node_scroll;
61-
62 private Gtk.VBox vbox1;
63
64- private Gtk.HButtonBox hbuttonbox1;
65-
66- private Gtk.Button remove_btn;
67-
68- private Gtk.Image image3;
69-
70- private Gtk.Button add_btn;
71-
72- private Gtk.Image image1;
73+ private Gtk.Notebook notebook1;
74+
75+ private Gtk.VBox vbox4;
76+
77+ private Gtk.ScrolledWindow index_node_scroll;
78+
79+ private Gtk.HBox hbox1;
80+
81+ private Gtk.Label IndexLabel;
82+
83+ private Gtk.HButtonBox hbuttonbox2;
84+
85+ private Gtk.Button index_remove_btn;
86+
87+ private Gtk.Button index_add_btn;
88
89 private Gtk.HBox hbox2;
90
91@@ -37,10 +41,26 @@
92
93 private Gtk.Entry numFiles;
94
95- private Gtk.VBox vbox3;
96-
97 private Gtk.CheckButton show_hidden_chk;
98
99+ private Gtk.Label label1;
100+
101+ private Gtk.VBox vbox5;
102+
103+ private Gtk.ScrolledWindow ignore_node_scroll;
104+
105+ private Gtk.HBox hbox3;
106+
107+ private Gtk.Label IgnoreLabel;
108+
109+ private Gtk.HButtonBox hbuttonbox3;
110+
111+ private Gtk.Button ignore_remove_btn;
112+
113+ private Gtk.Button ignore_add_btn;
114+
115+ private Gtk.Label label2;
116+
117 protected virtual void Build() {
118 Stetic.Gui.Initialize(this);
119 // Widget Do.FilesAndFolders.Configuration
120@@ -55,57 +75,98 @@
121 this.vbox2.Name = "vbox2";
122 this.vbox2.Spacing = 6;
123 // Container child vbox2.Gtk.Box+BoxChild
124- this.node_scroll = new Gtk.ScrolledWindow();
125- this.node_scroll.CanFocus = true;
126- this.node_scroll.Name = "node_scroll";
127- this.node_scroll.ShadowType = ((Gtk.ShadowType)(1));
128- this.vbox2.Add(this.node_scroll);
129- Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox2[this.node_scroll]));
130- w1.Position = 0;
131- // Container child vbox2.Gtk.Box+BoxChild
132 this.vbox1 = new Gtk.VBox();
133 this.vbox1.Name = "vbox1";
134 this.vbox1.Spacing = 6;
135 // Container child vbox1.Gtk.Box+BoxChild
136- this.hbuttonbox1 = new Gtk.HButtonBox();
137- this.hbuttonbox1.Name = "hbuttonbox1";
138- this.hbuttonbox1.Spacing = 4;
139- this.hbuttonbox1.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
140- // Container child hbuttonbox1.Gtk.ButtonBox+ButtonBoxChild
141- this.remove_btn = new Gtk.Button();
142- this.remove_btn.CanFocus = true;
143- this.remove_btn.Name = "remove_btn";
144- // Container child remove_btn.Gtk.Container+ContainerChild
145- this.image3 = new Gtk.Image();
146- this.image3.Name = "image3";
147- this.image3.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-remove", Gtk.IconSize.Button, 20);
148- this.remove_btn.Add(this.image3);
149- this.remove_btn.Label = null;
150- this.hbuttonbox1.Add(this.remove_btn);
151- Gtk.ButtonBox.ButtonBoxChild w3 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1[this.remove_btn]));
152- w3.Expand = false;
153- w3.Fill = false;
154- // Container child hbuttonbox1.Gtk.ButtonBox+ButtonBoxChild
155- this.add_btn = new Gtk.Button();
156- this.add_btn.CanFocus = true;
157- this.add_btn.Name = "add_btn";
158- // Container child add_btn.Gtk.Container+ContainerChild
159- this.image1 = new Gtk.Image();
160- this.image1.Name = "image1";
161- this.image1.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Button, 20);
162- this.add_btn.Add(this.image1);
163- this.add_btn.Label = null;
164- this.hbuttonbox1.Add(this.add_btn);
165- Gtk.ButtonBox.ButtonBoxChild w5 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1[this.add_btn]));
166- w5.Position = 1;
167- w5.Expand = false;
168- w5.Fill = false;
169- this.vbox1.Add(this.hbuttonbox1);
170- Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbuttonbox1]));
171- w6.Position = 0;
172- w6.Expand = false;
173- w6.Fill = false;
174- // Container child vbox1.Gtk.Box+BoxChild
175+ this.notebook1 = new Gtk.Notebook();
176+ this.notebook1.HeightRequest = 270;
177+ this.notebook1.CanFocus = true;
178+ this.notebook1.Name = "notebook1";
179+ this.notebook1.CurrentPage = 1;
180+ this.notebook1.ShowBorder = false;
181+ // Container child notebook1.Gtk.Notebook+NotebookChild
182+ this.vbox4 = new Gtk.VBox();
183+ this.vbox4.Name = "vbox4";
184+ this.vbox4.Spacing = 6;
185+ // Container child vbox4.Gtk.Box+BoxChild
186+ this.index_node_scroll = new Gtk.ScrolledWindow();
187+ this.index_node_scroll.CanFocus = true;
188+ this.index_node_scroll.Name = "index_node_scroll";
189+ this.index_node_scroll.ShadowType = ((Gtk.ShadowType)(1));
190+ this.vbox4.Add(this.index_node_scroll);
191+ Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox4[this.index_node_scroll]));
192+ w1.Position = 0;
193+ // Container child vbox4.Gtk.Box+BoxChild
194+ this.hbox1 = new Gtk.HBox();
195+ this.hbox1.Name = "hbox1";
196+ this.hbox1.Spacing = 6;
197+ // Container child hbox1.Gtk.Box+BoxChild
198+ this.IndexLabel = new Gtk.Label();
199+ this.IndexLabel.Name = "IndexLabel";
200+ this.hbox1.Add(this.IndexLabel);
201+ Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.IndexLabel]));
202+ w2.Position = 0;
203+ // Container child hbox1.Gtk.Box+BoxChild
204+ this.hbuttonbox2 = new Gtk.HButtonBox();
205+ this.hbuttonbox2.Name = "hbuttonbox2";
206+ // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
207+ this.index_remove_btn = new Gtk.Button();
208+ this.index_remove_btn.CanFocus = true;
209+ this.index_remove_btn.Name = "index_remove_btn";
210+ this.index_remove_btn.UseUnderline = true;
211+ // Container child index_remove_btn.Gtk.Container+ContainerChild
212+ Gtk.Alignment w3 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
213+ // Container child GtkAlignment.Gtk.Container+ContainerChild
214+ Gtk.HBox w4 = new Gtk.HBox();
215+ w4.Spacing = 2;
216+ // Container child GtkHBox.Gtk.Container+ContainerChild
217+ Gtk.Image w5 = new Gtk.Image();
218+ w5.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-remove", Gtk.IconSize.Button, 20);
219+ w4.Add(w5);
220+ // Container child GtkHBox.Gtk.Container+ContainerChild
221+ Gtk.Label w7 = new Gtk.Label();
222+ w4.Add(w7);
223+ w3.Add(w4);
224+ this.index_remove_btn.Add(w3);
225+ this.hbuttonbox2.Add(this.index_remove_btn);
226+ Gtk.ButtonBox.ButtonBoxChild w11 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.index_remove_btn]));
227+ w11.Expand = false;
228+ w11.Fill = false;
229+ // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
230+ this.index_add_btn = new Gtk.Button();
231+ this.index_add_btn.CanFocus = true;
232+ this.index_add_btn.Name = "index_add_btn";
233+ this.index_add_btn.UseUnderline = true;
234+ // Container child index_add_btn.Gtk.Container+ContainerChild
235+ Gtk.Alignment w12 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
236+ // Container child GtkAlignment.Gtk.Container+ContainerChild
237+ Gtk.HBox w13 = new Gtk.HBox();
238+ w13.Spacing = 2;
239+ // Container child GtkHBox.Gtk.Container+ContainerChild
240+ Gtk.Image w14 = new Gtk.Image();
241+ w14.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Menu, 16);
242+ w13.Add(w14);
243+ // Container child GtkHBox.Gtk.Container+ContainerChild
244+ Gtk.Label w16 = new Gtk.Label();
245+ w13.Add(w16);
246+ w12.Add(w13);
247+ this.index_add_btn.Add(w12);
248+ this.hbuttonbox2.Add(this.index_add_btn);
249+ Gtk.ButtonBox.ButtonBoxChild w20 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.index_add_btn]));
250+ w20.Position = 1;
251+ w20.Expand = false;
252+ w20.Fill = false;
253+ this.hbox1.Add(this.hbuttonbox2);
254+ Gtk.Box.BoxChild w21 = ((Gtk.Box.BoxChild)(this.hbox1[this.hbuttonbox2]));
255+ w21.Position = 1;
256+ w21.Expand = false;
257+ this.vbox4.Add(this.hbox1);
258+ Gtk.Box.BoxChild w22 = ((Gtk.Box.BoxChild)(this.vbox4[this.hbox1]));
259+ w22.Position = 1;
260+ w22.Expand = false;
261+ w22.Fill = false;
262+ // Container child vbox4.Gtk.Box+BoxChild
263 this.hbox2 = new Gtk.HBox();
264 this.hbox2.Name = "hbox2";
265 this.hbox2.Spacing = 6;
266@@ -114,10 +175,10 @@
267 this.maxFileslbl.Name = "maxFileslbl";
268 this.maxFileslbl.LabelProp = Mono.Unix.Catalog.GetString("Maximum number of items to index:");
269 this.hbox2.Add(this.maxFileslbl);
270- Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.hbox2[this.maxFileslbl]));
271- w7.Position = 0;
272- w7.Expand = false;
273- w7.Fill = false;
274+ Gtk.Box.BoxChild w23 = ((Gtk.Box.BoxChild)(this.hbox2[this.maxFileslbl]));
275+ w23.Position = 0;
276+ w23.Expand = false;
277+ w23.Fill = false;
278 // Container child hbox2.Gtk.Box+BoxChild
279 this.numFiles = new Gtk.Entry();
280 this.numFiles.CanFocus = true;
281@@ -126,19 +187,15 @@
282 this.numFiles.WidthChars = 5;
283 this.numFiles.InvisibleChar = '●';
284 this.hbox2.Add(this.numFiles);
285- Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.hbox2[this.numFiles]));
286- w8.Position = 1;
287- w8.Expand = false;
288- this.vbox1.Add(this.hbox2);
289- Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbox2]));
290- w9.Position = 1;
291- w9.Expand = false;
292- w9.Fill = false;
293- // Container child vbox1.Gtk.Box+BoxChild
294- this.vbox3 = new Gtk.VBox();
295- this.vbox3.Name = "vbox3";
296- this.vbox3.Spacing = 6;
297- // Container child vbox3.Gtk.Box+BoxChild
298+ Gtk.Box.BoxChild w24 = ((Gtk.Box.BoxChild)(this.hbox2[this.numFiles]));
299+ w24.Position = 1;
300+ w24.Expand = false;
301+ this.vbox4.Add(this.hbox2);
302+ Gtk.Box.BoxChild w25 = ((Gtk.Box.BoxChild)(this.vbox4[this.hbox2]));
303+ w25.Position = 2;
304+ w25.Expand = false;
305+ w25.Fill = false;
306+ // Container child vbox4.Gtk.Box+BoxChild
307 this.show_hidden_chk = new Gtk.CheckButton();
308 this.show_hidden_chk.CanFocus = true;
309 this.show_hidden_chk.Name = "show_hidden_chk";
310@@ -147,31 +204,127 @@
311 this.show_hidden_chk.DrawIndicator = true;
312 this.show_hidden_chk.UseUnderline = true;
313 this.show_hidden_chk.BorderWidth = ((uint)(5));
314- this.vbox3.Add(this.show_hidden_chk);
315- Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox3[this.show_hidden_chk]));
316- w10.Position = 0;
317- w10.Expand = false;
318- w10.Fill = false;
319- this.vbox1.Add(this.vbox3);
320- Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(this.vbox1[this.vbox3]));
321- w11.Position = 2;
322- w11.Expand = false;
323- w11.Fill = false;
324+ this.vbox4.Add(this.show_hidden_chk);
325+ Gtk.Box.BoxChild w26 = ((Gtk.Box.BoxChild)(this.vbox4[this.show_hidden_chk]));
326+ w26.Position = 3;
327+ w26.Expand = false;
328+ w26.Fill = false;
329+ this.notebook1.Add(this.vbox4);
330+ // Notebook tab
331+ this.label1 = new Gtk.Label();
332+ this.label1.Name = "label1";
333+ this.label1.LabelProp = Mono.Unix.Catalog.GetString("Indexed Folders");
334+ this.notebook1.SetTabLabel(this.vbox4, this.label1);
335+ this.label1.ShowAll();
336+ // Container child notebook1.Gtk.Notebook+NotebookChild
337+ this.vbox5 = new Gtk.VBox();
338+ this.vbox5.Name = "vbox5";
339+ this.vbox5.Spacing = 6;
340+ // Container child vbox5.Gtk.Box+BoxChild
341+ this.ignore_node_scroll = new Gtk.ScrolledWindow();
342+ this.ignore_node_scroll.CanFocus = true;
343+ this.ignore_node_scroll.Name = "ignore_node_scroll";
344+ this.ignore_node_scroll.ShadowType = ((Gtk.ShadowType)(1));
345+ this.vbox5.Add(this.ignore_node_scroll);
346+ Gtk.Box.BoxChild w28 = ((Gtk.Box.BoxChild)(this.vbox5[this.ignore_node_scroll]));
347+ w28.Position = 0;
348+ // Container child vbox5.Gtk.Box+BoxChild
349+ this.hbox3 = new Gtk.HBox();
350+ this.hbox3.Name = "hbox3";
351+ this.hbox3.Spacing = 6;
352+ // Container child hbox3.Gtk.Box+BoxChild
353+ this.IgnoreLabel = new Gtk.Label();
354+ this.IgnoreLabel.Name = "IgnoreLabel";
355+ this.hbox3.Add(this.IgnoreLabel);
356+ Gtk.Box.BoxChild w29 = ((Gtk.Box.BoxChild)(this.hbox3[this.IgnoreLabel]));
357+ w29.Position = 0;
358+ w29.Fill = false;
359+ // Container child hbox3.Gtk.Box+BoxChild
360+ this.hbuttonbox3 = new Gtk.HButtonBox();
361+ this.hbuttonbox3.Name = "hbuttonbox3";
362+ // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild
363+ this.ignore_remove_btn = new Gtk.Button();
364+ this.ignore_remove_btn.CanFocus = true;
365+ this.ignore_remove_btn.Name = "ignore_remove_btn";
366+ this.ignore_remove_btn.UseUnderline = true;
367+ // Container child ignore_remove_btn.Gtk.Container+ContainerChild
368+ Gtk.Alignment w30 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
369+ // Container child GtkAlignment.Gtk.Container+ContainerChild
370+ Gtk.HBox w31 = new Gtk.HBox();
371+ w31.Spacing = 2;
372+ // Container child GtkHBox.Gtk.Container+ContainerChild
373+ Gtk.Image w32 = new Gtk.Image();
374+ w32.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-remove", Gtk.IconSize.Button, 20);
375+ w31.Add(w32);
376+ // Container child GtkHBox.Gtk.Container+ContainerChild
377+ Gtk.Label w34 = new Gtk.Label();
378+ w31.Add(w34);
379+ w30.Add(w31);
380+ this.ignore_remove_btn.Add(w30);
381+ this.hbuttonbox3.Add(this.ignore_remove_btn);
382+ Gtk.ButtonBox.ButtonBoxChild w38 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3[this.ignore_remove_btn]));
383+ w38.Expand = false;
384+ w38.Fill = false;
385+ // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild
386+ this.ignore_add_btn = new Gtk.Button();
387+ this.ignore_add_btn.CanFocus = true;
388+ this.ignore_add_btn.Name = "ignore_add_btn";
389+ this.ignore_add_btn.UseUnderline = true;
390+ // Container child ignore_add_btn.Gtk.Container+ContainerChild
391+ Gtk.Alignment w39 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
392+ // Container child GtkAlignment.Gtk.Container+ContainerChild
393+ Gtk.HBox w40 = new Gtk.HBox();
394+ w40.Spacing = 2;
395+ // Container child GtkHBox.Gtk.Container+ContainerChild
396+ Gtk.Image w41 = new Gtk.Image();
397+ w41.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Menu, 16);
398+ w40.Add(w41);
399+ // Container child GtkHBox.Gtk.Container+ContainerChild
400+ Gtk.Label w43 = new Gtk.Label();
401+ w40.Add(w43);
402+ w39.Add(w40);
403+ this.ignore_add_btn.Add(w39);
404+ this.hbuttonbox3.Add(this.ignore_add_btn);
405+ Gtk.ButtonBox.ButtonBoxChild w47 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3[this.ignore_add_btn]));
406+ w47.Position = 1;
407+ w47.Expand = false;
408+ w47.Fill = false;
409+ this.hbox3.Add(this.hbuttonbox3);
410+ Gtk.Box.BoxChild w48 = ((Gtk.Box.BoxChild)(this.hbox3[this.hbuttonbox3]));
411+ w48.Position = 1;
412+ w48.Expand = false;
413+ this.vbox5.Add(this.hbox3);
414+ Gtk.Box.BoxChild w49 = ((Gtk.Box.BoxChild)(this.vbox5[this.hbox3]));
415+ w49.Position = 1;
416+ w49.Expand = false;
417+ w49.Fill = false;
418+ this.notebook1.Add(this.vbox5);
419+ Gtk.Notebook.NotebookChild w50 = ((Gtk.Notebook.NotebookChild)(this.notebook1[this.vbox5]));
420+ w50.Position = 1;
421+ // Notebook tab
422+ this.label2 = new Gtk.Label();
423+ this.label2.Name = "label2";
424+ this.label2.LabelProp = Mono.Unix.Catalog.GetString("Ignored Folders");
425+ this.notebook1.SetTabLabel(this.vbox5, this.label2);
426+ this.label2.ShowAll();
427+ this.vbox1.Add(this.notebook1);
428+ Gtk.Box.BoxChild w51 = ((Gtk.Box.BoxChild)(this.vbox1[this.notebook1]));
429+ w51.Position = 0;
430 this.vbox2.Add(this.vbox1);
431- Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(this.vbox2[this.vbox1]));
432- w12.Position = 1;
433- w12.Expand = false;
434- w12.Fill = false;
435+ Gtk.Box.BoxChild w52 = ((Gtk.Box.BoxChild)(this.vbox2[this.vbox1]));
436+ w52.Position = 0;
437 this.alignment1.Add(this.vbox2);
438 this.Add(this.alignment1);
439 if ((this.Child != null)) {
440 this.Child.ShowAll();
441 }
442 this.Show();
443- this.remove_btn.Clicked += new System.EventHandler(this.OnRemoveBtnClicked);
444- this.add_btn.Clicked += new System.EventHandler(this.OnAddBtnClicked);
445+ this.index_remove_btn.Clicked += new System.EventHandler(this.OnRemoveBtnClicked);
446+ this.index_add_btn.Clicked += new System.EventHandler(this.OnAddBtnClicked);
447 this.numFiles.Changed += new System.EventHandler(this.OnNumFilesEdited);
448 this.show_hidden_chk.Clicked += new System.EventHandler(this.OnShowHiddenChkClicked);
449+ this.ignore_remove_btn.Clicked += new System.EventHandler(this.OnRemoveBtnClicked);
450+ this.ignore_add_btn.Clicked += new System.EventHandler(this.OnAddBtnClicked);
451 }
452 }
453 }
454
455=== modified file 'File/gtk-gui/gui.stetic'
456--- File/gtk-gui/gui.stetic 2009-02-13 21:34:02 +0000
457+++ File/gtk-gui/gui.stetic 2009-03-02 03:08:02 +0000
458@@ -2,9 +2,12 @@
459 <stetic-interface>
460 <configuration>
461 <images-root-path>..</images-root-path>
462- <target-gtk-version>2.12.1</target-gtk-version>
463+ <target-gtk-version>2.12</target-gtk-version>
464 </configuration>
465- <widget class="Gtk.Bin" id="Do.FilesAndFolders.Configuration" design-size="328 354">
466+ <import>
467+ <widget-library name="../bin/Debug/File.dll" internal="true" />
468+ </import>
469+ <widget class="Gtk.Bin" id="Do.FilesAndFolders.Configuration" design-size="414 356">
470 <property name="MemberName" />
471 <child>
472 <widget class="Gtk.Alignment" id="alignment1">
473@@ -15,156 +18,284 @@
474 <property name="MemberName" />
475 <property name="Spacing">6</property>
476 <child>
477- <widget class="Gtk.ScrolledWindow" id="node_scroll">
478- <property name="MemberName" />
479- <property name="CanFocus">True</property>
480- <property name="ShadowType">In</property>
481- <child>
482- <widget class="Gtk.Viewport" id="GtkViewport">
483- <property name="MemberName" />
484- <property name="ShadowType">None</property>
485- <child>
486- <placeholder />
487- </child>
488- </widget>
489- </child>
490- </widget>
491- <packing>
492- <property name="Position">0</property>
493- <property name="AutoSize">True</property>
494- </packing>
495- </child>
496- <child>
497 <widget class="Gtk.VBox" id="vbox1">
498 <property name="MemberName" />
499 <property name="Spacing">6</property>
500 <child>
501- <widget class="Gtk.HButtonBox" id="hbuttonbox1">
502+ <widget class="Gtk.Notebook" id="notebook1">
503 <property name="MemberName" />
504- <property name="Spacing">4</property>
505- <property name="Size">2</property>
506- <property name="LayoutStyle">End</property>
507- <child>
508- <widget class="Gtk.Button" id="remove_btn">
509- <property name="MemberName" />
510- <property name="CanFocus">True</property>
511- <property name="Type">Custom</property>
512- <signal name="Clicked" handler="OnRemoveBtnClicked" />
513- <child>
514- <widget class="Gtk.Image" id="image3">
515- <property name="MemberName" />
516- <property name="Pixbuf">stock:gtk-remove Button</property>
517- </widget>
518- </child>
519+ <property name="HeightRequest">270</property>
520+ <property name="CanFocus">True</property>
521+ <property name="CurrentPage">1</property>
522+ <property name="ShowBorder">False</property>
523+ <child>
524+ <widget class="Gtk.VBox" id="vbox4">
525+ <property name="MemberName" />
526+ <property name="Spacing">6</property>
527+ <child>
528+ <widget class="Gtk.ScrolledWindow" id="index_node_scroll">
529+ <property name="MemberName" />
530+ <property name="CanFocus">True</property>
531+ <property name="ShadowType">In</property>
532+ <child>
533+ <widget class="Gtk.Viewport" id="GtkViewport">
534+ <property name="MemberName" />
535+ <property name="ShadowType">None</property>
536+ <child>
537+ <placeholder />
538+ </child>
539+ </widget>
540+ </child>
541+ </widget>
542+ <packing>
543+ <property name="Position">0</property>
544+ <property name="AutoSize">True</property>
545+ </packing>
546+ </child>
547+ <child>
548+ <widget class="Gtk.HBox" id="hbox1">
549+ <property name="MemberName" />
550+ <property name="Spacing">6</property>
551+ <child>
552+ <widget class="Gtk.Label" id="IndexLabel">
553+ <property name="MemberName" />
554+ </widget>
555+ <packing>
556+ <property name="Position">0</property>
557+ <property name="AutoSize">False</property>
558+ </packing>
559+ </child>
560+ <child>
561+ <widget class="Gtk.HButtonBox" id="hbuttonbox2">
562+ <property name="MemberName" />
563+ <property name="Size">2</property>
564+ <child>
565+ <widget class="Gtk.Button" id="index_remove_btn">
566+ <property name="MemberName" />
567+ <property name="CanFocus">True</property>
568+ <property name="Type">TextAndIcon</property>
569+ <property name="Icon">stock:gtk-remove Button</property>
570+ <property name="Label" translatable="yes" />
571+ <property name="UseUnderline">True</property>
572+ <signal name="Clicked" handler="OnRemoveBtnClicked" />
573+ </widget>
574+ <packing>
575+ <property name="Expand">False</property>
576+ <property name="Fill">False</property>
577+ </packing>
578+ </child>
579+ <child>
580+ <widget class="Gtk.Button" id="index_add_btn">
581+ <property name="MemberName" />
582+ <property name="CanFocus">True</property>
583+ <property name="Type">TextAndIcon</property>
584+ <property name="Icon">stock:gtk-add Menu</property>
585+ <property name="Label" translatable="yes" />
586+ <property name="UseUnderline">True</property>
587+ <signal name="Clicked" handler="OnAddBtnClicked" />
588+ </widget>
589+ <packing>
590+ <property name="Position">1</property>
591+ <property name="Expand">False</property>
592+ <property name="Fill">False</property>
593+ </packing>
594+ </child>
595+ </widget>
596+ <packing>
597+ <property name="Position">1</property>
598+ <property name="AutoSize">False</property>
599+ <property name="Expand">False</property>
600+ </packing>
601+ </child>
602+ </widget>
603+ <packing>
604+ <property name="Position">1</property>
605+ <property name="AutoSize">True</property>
606+ <property name="Expand">False</property>
607+ <property name="Fill">False</property>
608+ </packing>
609+ </child>
610+ <child>
611+ <widget class="Gtk.HBox" id="hbox2">
612+ <property name="MemberName" />
613+ <property name="Spacing">6</property>
614+ <child>
615+ <widget class="Gtk.Label" id="maxFileslbl">
616+ <property name="MemberName" />
617+ <property name="LabelProp" translatable="yes">Maximum number of items to index:</property>
618+ </widget>
619+ <packing>
620+ <property name="Position">0</property>
621+ <property name="AutoSize">False</property>
622+ <property name="Expand">False</property>
623+ <property name="Fill">False</property>
624+ </packing>
625+ </child>
626+ <child>
627+ <widget class="Gtk.Entry" id="numFiles">
628+ <property name="MemberName">numFiles</property>
629+ <property name="CanFocus">True</property>
630+ <property name="IsEditable">True</property>
631+ <property name="WidthChars">5</property>
632+ <property name="InvisibleChar">●</property>
633+ <signal name="Changed" handler="OnNumFilesEdited" />
634+ </widget>
635+ <packing>
636+ <property name="Position">1</property>
637+ <property name="AutoSize">False</property>
638+ <property name="Expand">False</property>
639+ </packing>
640+ </child>
641+ </widget>
642+ <packing>
643+ <property name="Position">2</property>
644+ <property name="AutoSize">True</property>
645+ <property name="Expand">False</property>
646+ <property name="Fill">False</property>
647+ </packing>
648+ </child>
649+ <child>
650+ <widget class="Gtk.CheckButton" id="show_hidden_chk">
651+ <property name="MemberName" />
652+ <property name="CanFocus">True</property>
653+ <property name="Label" translatable="yes">Show hidden files</property>
654+ <property name="Active">True</property>
655+ <property name="DrawIndicator">True</property>
656+ <property name="HasLabel">True</property>
657+ <property name="UseUnderline">True</property>
658+ <property name="BorderWidth">5</property>
659+ <signal name="Clicked" handler="OnShowHiddenChkClicked" />
660+ </widget>
661+ <packing>
662+ <property name="Position">3</property>
663+ <property name="AutoSize">True</property>
664+ <property name="Expand">False</property>
665+ <property name="Fill">False</property>
666+ </packing>
667+ </child>
668+ </widget>
669+ </child>
670+ <child>
671+ <widget class="Gtk.Label" id="label1">
672+ <property name="MemberName" />
673+ <property name="LabelProp" translatable="yes">Indexed Folders</property>
674 </widget>
675 <packing>
676- <property name="Expand">False</property>
677- <property name="Fill">False</property>
678+ <property name="type">tab</property>
679 </packing>
680 </child>
681 <child>
682- <widget class="Gtk.Button" id="add_btn">
683+ <widget class="Gtk.VBox" id="vbox5">
684 <property name="MemberName" />
685- <property name="CanFocus">True</property>
686- <property name="Type">Custom</property>
687- <signal name="Clicked" handler="OnAddBtnClicked" />
688- <child>
689- <widget class="Gtk.Image" id="image1">
690- <property name="MemberName" />
691- <property name="Pixbuf">stock:gtk-add Button</property>
692- </widget>
693+ <property name="Spacing">6</property>
694+ <child>
695+ <widget class="Gtk.ScrolledWindow" id="ignore_node_scroll">
696+ <property name="MemberName" />
697+ <property name="CanFocus">True</property>
698+ <property name="ShadowType">In</property>
699+ <child>
700+ <widget class="Gtk.Viewport" id="GtkViewport1">
701+ <property name="MemberName" />
702+ <property name="ShadowType">None</property>
703+ <child>
704+ <placeholder />
705+ </child>
706+ </widget>
707+ </child>
708+ </widget>
709+ <packing>
710+ <property name="Position">0</property>
711+ <property name="AutoSize">True</property>
712+ </packing>
713+ </child>
714+ <child>
715+ <widget class="Gtk.HBox" id="hbox3">
716+ <property name="MemberName" />
717+ <property name="Spacing">6</property>
718+ <child>
719+ <widget class="Gtk.Label" id="IgnoreLabel">
720+ <property name="MemberName" />
721+ </widget>
722+ <packing>
723+ <property name="Position">0</property>
724+ <property name="AutoSize">False</property>
725+ <property name="Fill">False</property>
726+ </packing>
727+ </child>
728+ <child>
729+ <widget class="Gtk.HButtonBox" id="hbuttonbox3">
730+ <property name="MemberName" />
731+ <property name="Size">2</property>
732+ <child>
733+ <widget class="Gtk.Button" id="ignore_remove_btn">
734+ <property name="MemberName" />
735+ <property name="CanFocus">True</property>
736+ <property name="Type">TextAndIcon</property>
737+ <property name="Icon">stock:gtk-remove Button</property>
738+ <property name="Label" translatable="yes" />
739+ <property name="UseUnderline">True</property>
740+ <signal name="Clicked" handler="OnRemoveBtnClicked" />
741+ </widget>
742+ <packing>
743+ <property name="Expand">False</property>
744+ <property name="Fill">False</property>
745+ </packing>
746+ </child>
747+ <child>
748+ <widget class="Gtk.Button" id="ignore_add_btn">
749+ <property name="MemberName" />
750+ <property name="CanFocus">True</property>
751+ <property name="Type">TextAndIcon</property>
752+ <property name="Icon">stock:gtk-add Menu</property>
753+ <property name="Label" translatable="yes" />
754+ <property name="UseUnderline">True</property>
755+ <signal name="Clicked" handler="OnAddBtnClicked" />
756+ </widget>
757+ <packing>
758+ <property name="Position">1</property>
759+ <property name="Expand">False</property>
760+ <property name="Fill">False</property>
761+ </packing>
762+ </child>
763+ </widget>
764+ <packing>
765+ <property name="Position">1</property>
766+ <property name="AutoSize">False</property>
767+ <property name="Expand">False</property>
768+ </packing>
769+ </child>
770+ </widget>
771+ <packing>
772+ <property name="Position">1</property>
773+ <property name="AutoSize">True</property>
774+ <property name="Expand">False</property>
775+ <property name="Fill">False</property>
776+ </packing>
777 </child>
778 </widget>
779 <packing>
780 <property name="Position">1</property>
781- <property name="Expand">False</property>
782- <property name="Fill">False</property>
783+ </packing>
784+ </child>
785+ <child>
786+ <widget class="Gtk.Label" id="label2">
787+ <property name="MemberName" />
788+ <property name="LabelProp" translatable="yes">Ignored Folders</property>
789+ </widget>
790+ <packing>
791+ <property name="type">tab</property>
792 </packing>
793 </child>
794 </widget>
795 <packing>
796 <property name="Position">0</property>
797 <property name="AutoSize">True</property>
798- <property name="Expand">False</property>
799- <property name="Fill">False</property>
800- </packing>
801- </child>
802- <child>
803- <widget class="Gtk.HBox" id="hbox2">
804- <property name="MemberName" />
805- <property name="Spacing">6</property>
806- <child>
807- <widget class="Gtk.Label" id="maxFileslbl">
808- <property name="MemberName" />
809- <property name="LabelProp" translatable="yes">Maximum number of items to index:</property>
810- </widget>
811- <packing>
812- <property name="Position">0</property>
813- <property name="AutoSize">False</property>
814- <property name="Expand">False</property>
815- <property name="Fill">False</property>
816- </packing>
817- </child>
818- <child>
819- <widget class="Gtk.Entry" id="numFiles">
820- <property name="MemberName">numFiles</property>
821- <property name="CanFocus">True</property>
822- <property name="IsEditable">True</property>
823- <property name="WidthChars">5</property>
824- <property name="InvisibleChar">●</property>
825- <signal name="Changed" handler="OnNumFilesEdited" />
826- </widget>
827- <packing>
828- <property name="Position">1</property>
829- <property name="AutoSize">False</property>
830- <property name="Expand">False</property>
831- </packing>
832- </child>
833- </widget>
834- <packing>
835- <property name="Position">1</property>
836- <property name="AutoSize">True</property>
837- <property name="Expand">False</property>
838- <property name="Fill">False</property>
839- </packing>
840- </child>
841- <child>
842- <widget class="Gtk.VBox" id="vbox3">
843- <property name="MemberName" />
844- <property name="Spacing">6</property>
845- <child>
846- <widget class="Gtk.CheckButton" id="show_hidden_chk">
847- <property name="MemberName" />
848- <property name="CanFocus">True</property>
849- <property name="Label" translatable="yes">Show hidden files</property>
850- <property name="Active">True</property>
851- <property name="DrawIndicator">True</property>
852- <property name="HasLabel">True</property>
853- <property name="UseUnderline">True</property>
854- <property name="BorderWidth">5</property>
855- <signal name="Clicked" handler="OnShowHiddenChkClicked" />
856- </widget>
857- <packing>
858- <property name="Position">0</property>
859- <property name="AutoSize">True</property>
860- <property name="Expand">False</property>
861- <property name="Fill">False</property>
862- </packing>
863- </child>
864- </widget>
865- <packing>
866- <property name="Position">2</property>
867- <property name="AutoSize">True</property>
868- <property name="Expand">False</property>
869- <property name="Fill">False</property>
870 </packing>
871 </child>
872 </widget>
873 <packing>
874- <property name="Position">1</property>
875+ <property name="Position">0</property>
876 <property name="AutoSize">True</property>
877- <property name="Expand">False</property>
878- <property name="Fill">False</property>
879 </packing>
880 </child>
881 </widget>
882
883=== modified file 'File/src/Do/Do.FilesAndFolders/Configuration.cs'
884--- File/src/Do/Do.FilesAndFolders/Configuration.cs 2009-02-13 21:34:02 +0000
885+++ File/src/Do/Do.FilesAndFolders/Configuration.cs 2009-02-17 10:48:05 +0000
886@@ -30,49 +30,86 @@
887 [System.ComponentModel.ToolboxItem(true)]
888 public partial class Configuration : Gtk.Bin
889 {
890- PathNodeView nview;
891+ IndexPathNodeView indexNview;
892+ IgnorePathNodeView ignoreNview;
893
894+ string indexDialog = Catalog.GetString ("Choose a folder to index");
895+ string ignoreDialog = Catalog.GetString ("Choose a folder to ignore");
896+
897 public Configuration ()
898- {
899+ {
900 Build ();
901
902- nview = new PathNodeView ();
903- nview.Selection.Changed += OnPathNodeViewSelectionChange;
904+ indexNview = new IndexPathNodeView ();
905+ ignoreNview = new IgnorePathNodeView ();
906+ indexNview.Selection.Changed += OnPathNodeViewSelectionChange;
907+ ignoreNview.Selection.Changed += OnPathNodeViewSelectionChange;
908 numFiles.Changed += OnNumFilesEdited;
909- node_scroll.Add (nview);
910+
911+ index_node_scroll.Add (indexNview);
912+ ignore_node_scroll.Add (ignoreNview);
913
914 show_hidden_chk.Active = Plugin.Preferences.IncludeHiddenFiles;
915 numFiles.Text = Plugin.Preferences.MaximumFilesIndexed.ToString ();
916- remove_btn.Sensitive = false;
917-
918- }
919-
920+ index_remove_btn.Sensitive = false;
921+ ignore_remove_btn.Sensitive = false;
922+
923+ notebook1.Page = 0;
924+
925+ }
926+
927+ private PathNodeView GetCurrentView ()
928+ {
929+ PathNodeView currentNview;
930+ if (this.notebook1.CurrentPage == 0)
931+ currentNview = indexNview;
932+ else
933+ currentNview = ignoreNview;
934+
935+ return currentNview;
936+ }
937+
938 protected virtual void OnAddBtnClicked (object sender, System.EventArgs e)
939 {
940 FileChooserDialog chooser;
941-
942+ string dialogTitle;
943+ bool index;
944+ uint depth;
945+
946+ if (GetCurrentView () == indexNview) {
947+ dialogTitle = indexDialog;
948+ index = true;
949+ depth = 1;
950+ }
951+ else {
952+ index = false;
953+ depth = 0;
954+ dialogTitle = ignoreDialog;
955+ }
956+
957 chooser = new FileChooserDialog (
958- Catalog.GetString ("Choose a folder to index"),
959+ dialogTitle,
960 new Dialog (), FileChooserAction.SelectFolder,
961 Catalog.GetString ("Cancel"), ResponseType.Cancel,
962 Catalog.GetString ("Choose folder"), ResponseType.Accept);
963-
964-
965+
966 if (chooser.Run () == (int) ResponseType.Accept) {
967- Plugin.FolderIndex.Add (new IndexedFolder (chooser.Filename, 1));
968- nview.Refresh ();
969+ if (!Plugin.FolderIndex.ContainsFolder (chooser.Filename))
970+ Plugin.FolderIndex.Add (new IndexedFolder (chooser.Filename, depth, index));
971+ GetCurrentView ().Refresh ();
972 }
973 chooser.Destroy ();
974 }
975
976 protected virtual void OnRemoveBtnClicked (object sender, EventArgs e)
977 {
978- nview.OnRemoveSelected (sender, e);
979+ GetCurrentView ().OnRemoveSelected (sender, e);
980 }
981
982 protected void OnPathNodeViewSelectionChange (object sender, EventArgs e)
983 {
984- remove_btn.Sensitive = nview.Selection.GetSelectedRows ().Any ();
985+ index_remove_btn.Sensitive = indexNview.Selection.GetSelectedRows ().Any ();
986+ ignore_remove_btn.Sensitive = ignoreNview.Selection.GetSelectedRows ().Any ();
987 }
988
989 protected virtual void OnShowHiddenChkClicked (object sender, EventArgs e)
990@@ -85,7 +122,7 @@
991 try {
992 Plugin.Preferences.MaximumFilesIndexed = int.Parse (numFiles.Text);
993 }
994- catch (Exception ex) {
995+ catch {
996 numFiles.Text = "";
997 Plugin.Preferences.MaximumFilesIndexed = 0;
998 }
999
1000=== modified file 'File/src/Do/Do.FilesAndFolders/FileItemSource.cs'
1001--- File/src/Do/Do.FilesAndFolders/FileItemSource.cs 2009-01-18 06:04:49 +0000
1002+++ File/src/Do/Do.FilesAndFolders/FileItemSource.cs 2009-02-14 20:52:23 +0000
1003@@ -36,6 +36,7 @@
1004 public class FileItemSource : ItemSource, IConfigurable {
1005
1006 IEnumerable<Item> items;
1007+ static IEnumerable<IndexedFolder> ignored;
1008 bool maximum_files_warned;
1009
1010 string MaximumFilesIndexedWarning {
1011@@ -55,6 +56,7 @@
1012 public FileItemSource ()
1013 {
1014 items = Enumerable.Empty<Item> ();
1015+ ignored = Enumerable.Empty<IndexedFolder> ();
1016 }
1017
1018 public override IEnumerable<Item> Items {
1019@@ -104,11 +106,15 @@
1020
1021 public override void UpdateItems ()
1022 {
1023+ ignored = Plugin.FolderIndex
1024+ .Where (folder => !folder.Index)
1025+ .ToArray ();
1026+
1027 items = Plugin.FolderIndex
1028 .SelectMany (folder => RecursiveGetItems (folder.Path, folder.Level, Plugin.Preferences.IncludeHiddenFiles))
1029 .Take (Plugin.Preferences.MaximumFilesIndexed)
1030 .ToArray ();
1031-
1032+
1033 if (!maximum_files_warned && items.Count () == Plugin.Preferences.MaximumFilesIndexed) {
1034 Log.Warn (MaximumFilesIndexedWarning);
1035 Services.Notifications.Notify ("Do is indexing too many files.", MaximumFilesIndexedWarning);
1036@@ -167,9 +173,9 @@
1037 IEnumerable<string> files, directories, recursiveFiles;
1038
1039 files = Directory.GetFiles (path)
1040- .Where (filepath => ShouldIndexPath (filepath, includeHidden));
1041+ .Where (filepath => ShouldIndexPath (filepath, includeHidden, false));
1042 directories = Directory.GetDirectories (path)
1043- .Where (filepath => ShouldIndexPath (filepath, includeHidden));
1044+ .Where (filepath => ShouldIndexPath (filepath, includeHidden, true));
1045 recursiveFiles = directories
1046 .SelectMany (dir => RecursiveListFiles (dir, levels - 1, includeHidden));
1047
1048@@ -182,11 +188,13 @@
1049 return results;
1050 }
1051
1052- static bool ShouldIndexPath (string path, bool includeHidden)
1053+ static bool ShouldIndexPath (string path, bool includeHidden, bool isDirectory)
1054 {
1055 string filename = Path.GetFileName (path);
1056 bool isForbidden = filename == "." || filename == ".." || filename.EndsWith ("~");
1057 bool isHidden = filename.StartsWith (".");
1058+ if (isDirectory && ignored.Where (folder => path == folder.Path).Any ())
1059+ isForbidden = true;
1060 return !isForbidden && (includeHidden || !isHidden);
1061 }
1062
1063
1064=== modified file 'File/src/Do/Do.FilesAndFolders/IndexedFolder.cs'
1065--- File/src/Do/Do.FilesAndFolders/IndexedFolder.cs 2009-01-14 18:43:13 +0000
1066+++ File/src/Do/Do.FilesAndFolders/IndexedFolder.cs 2009-02-14 20:52:23 +0000
1067@@ -31,18 +31,20 @@
1068 {
1069 public string Path { get; private set; }
1070 public uint Level { get; private set; }
1071+ public bool Index { get; private set; }
1072
1073- public IndexedFolder (string path, uint level)
1074+ public IndexedFolder (string path, uint level, bool index)
1075 {
1076 if (path == null) throw new ArgumentNullException ("path");
1077
1078 Path = path.Replace ("~", Plugin.ImportantFolders.UserHome);
1079 Level = level;
1080+ Index = index;
1081 }
1082
1083 public override string ToString ()
1084 {
1085- return string.Format ("{0} {2} {1}", GetType ().Name, Path, Level);
1086+ return string.Format ("{0} {2} {1} {3}", GetType ().Name, Path, Level, Index);
1087 }
1088
1089 public override bool Equals (object other)
1090@@ -52,12 +54,12 @@
1091
1092 public override int GetHashCode ()
1093 {
1094- return Path.GetHashCode () ^ Level.GetHashCode ();
1095+ return Path.GetHashCode () ^ Level.GetHashCode () ^ Index.GetHashCode ();
1096 }
1097
1098 public bool Equals (IndexedFolder other)
1099 {
1100- return other.Path == Path && other.Level == Level;
1101+ return other.Path == Path && other.Level == Level && other.Index == Index;
1102 }
1103
1104 public static bool operator== (IndexedFolder left, IndexedFolder right)
1105
1106=== modified file 'File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs'
1107--- File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs 2009-01-18 20:29:57 +0000
1108+++ File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs 2009-02-16 01:11:46 +0000
1109@@ -49,10 +49,10 @@
1110
1111 IEnumerable<IndexedFolder> GetDefaultFolders ()
1112 {
1113- yield return new IndexedFolder (Path.GetDirectoryName (Plugin.ImportantFolders.UserHome), 1);
1114- yield return new IndexedFolder (Plugin.ImportantFolders.UserHome, 1);
1115- yield return new IndexedFolder (Plugin.ImportantFolders.Desktop, 1);
1116- yield return new IndexedFolder (Plugin.ImportantFolders.Documents, 2);
1117+ yield return new IndexedFolder (Path.GetDirectoryName (Plugin.ImportantFolders.UserHome), 1, true);
1118+ yield return new IndexedFolder (Plugin.ImportantFolders.UserHome, 1, true);
1119+ yield return new IndexedFolder (Plugin.ImportantFolders.Desktop, 1, true);
1120+ yield return new IndexedFolder (Plugin.ImportantFolders.Documents, 2, true);
1121 }
1122
1123 public IndexedFolderCollection ()
1124@@ -64,14 +64,16 @@
1125 Deserialize ();
1126
1127 foreach (IndexedFolder folder in Folders.Values) {
1128- if (folder.Level < LargeIndexLevel) continue;
1129- Log.Warn (LargeIndexLevelWarning, folder.Path, folder.Level);
1130+ if (folder.Level > LargeIndexLevel)
1131+ Log.Warn (LargeIndexLevelWarning, folder.Path, folder.Level);
1132 }
1133 }
1134
1135- public void UpdateIndexedFolder (string path, string newPath, uint newDepth)
1136+ public void UpdateIndexedFolder (string path, string newPath, uint newDepth, bool newIndex)
1137 {
1138- UpdateIndexedFolder (path, new IndexedFolder (newPath, newDepth));
1139+ if (newDepth > LargeIndexLevel)
1140+ Log.Warn (LargeIndexLevelWarning, newPath, newDepth);
1141+ UpdateIndexedFolder (path, new IndexedFolder (newPath, newDepth, newIndex));
1142 }
1143
1144 public void UpdateIndexedFolder (string path, IndexedFolder folder)
1145@@ -87,6 +89,11 @@
1146 if (!Folders.ContainsKey (path)) return;
1147 Remove (Folders [path]);
1148 }
1149+
1150+ public bool ContainsFolder (string path)
1151+ {
1152+ return Folders.ContainsKey (path);
1153+ }
1154
1155 #region ICollection<IndexedFolder>
1156
1157
1158=== modified file 'File/src/Do/Do.FilesAndFolders/RecentFileItemSource.cs'
1159--- File/src/Do/Do.FilesAndFolders/RecentFileItemSource.cs 2008-12-23 23:42:53 +0000
1160+++ File/src/Do/Do.FilesAndFolders/RecentFileItemSource.cs 2009-02-14 20:52:23 +0000
1161@@ -53,10 +53,14 @@
1162
1163 IEnumerable<IFileItem> GetRecentFiles ()
1164 {
1165- // These lines always cause mono to blow up:
1166- //foreach (RecentInfo info in RecentManager.Default.Items) {
1167- // yield return UniverseFactory.NewFileItem (info.Uri);
1168- //}
1169+ /*
1170+ These lines always cause mono to blow up:
1171+
1172+ foreach (Gtk.RecentInfo info in Gtk.RecentManager.Default.Items) {
1173+ Console.WriteLine(info);
1174+ yield return Services.UniverseFactory.NewFileItem (info.Uri);
1175+ }
1176+ */
1177 return Enumerable.Empty<IFileItem> ();
1178 }
1179
1180
1181=== added file 'File/src/IgnorePathNodeView.cs'
1182--- File/src/IgnorePathNodeView.cs 1970-01-01 00:00:00 +0000
1183+++ File/src/IgnorePathNodeView.cs 2009-02-17 10:48:05 +0000
1184@@ -0,0 +1,74 @@
1185+/* IgnorePathNodeView.cs
1186+ *
1187+ * GNOME Do is the legal property of its developers. Please refer to the
1188+ * COPYRIGHT file distributed with this
1189+ * source distribution.
1190+ *
1191+ * This program is free software: you can redistribute it and/or modify
1192+ * it under the terms of the GNU General Public License as published by
1193+ * the Free Software Foundation, either version 3 of the License, or
1194+ * (at your option) any later version.
1195+ *
1196+ * This program is distributed in the hope that it will be useful,
1197+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1198+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1199+ * GNU General Public License for more details.
1200+ *
1201+ * You should have received a copy of the GNU General Public License
1202+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1203+ */
1204+
1205+using System;
1206+using Mono.Unix;
1207+
1208+using Gtk;
1209+
1210+namespace Do.FilesAndFolders
1211+{
1212+
1213+ // TODO: update this class to use spin buttons,
1214+ public class IgnorePathNodeView : PathNodeView
1215+ {
1216+ public enum Column {
1217+ Path = 0,
1218+ Index,
1219+ NumColumns
1220+ }
1221+
1222+ public IgnorePathNodeView () : base ()
1223+ {
1224+ CellRenderer cell;
1225+ RulesHint = true;
1226+ HeadersVisible = true;
1227+
1228+ Model = new ListStore (typeof (string), typeof (bool));
1229+
1230+ cell = new CellRendererText ();
1231+ (cell as CellRendererText).Width = 310;
1232+ (cell as CellRendererText).Ellipsize = Pango.EllipsizeMode.Middle;
1233+ AppendColumn (Catalog.GetString ("Folder"), cell, "text", Column.Path);
1234+
1235+ Refresh ();
1236+ }
1237+
1238+ public override void Refresh ()
1239+ {
1240+ ListStore store = Model as ListStore;
1241+ //try to keep the currently selected row across refreshes
1242+ Gtk.TreePath selected = null;
1243+ try {
1244+ selected = this.Selection.GetSelectedRows ()[0];
1245+ }
1246+ catch { }
1247+ finally {
1248+ store.Clear ();
1249+ foreach (IndexedFolder pair in Plugin.FolderIndex) {
1250+ if (!pair.Index)
1251+ store.AppendValues (pair.Path, pair.Index);
1252+ }
1253+ if (selected != null)
1254+ this.Selection.SelectPath (selected);
1255+ }
1256+ }
1257+ }
1258+}
1259\ No newline at end of file
1260
1261=== added file 'File/src/IndexPathNodeView.cs'
1262--- File/src/IndexPathNodeView.cs 1970-01-01 00:00:00 +0000
1263+++ File/src/IndexPathNodeView.cs 2009-02-17 10:48:05 +0000
1264@@ -0,0 +1,97 @@
1265+/* IndexPathNodeView.cs
1266+ *
1267+ * GNOME Do is the legal property of its developers. Please refer to the
1268+ * COPYRIGHT file distributed with this
1269+ * source distribution.
1270+ *
1271+ * This program is free software: you can redistribute it and/or modify
1272+ * it under the terms of the GNU General Public License as published by
1273+ * the Free Software Foundation, either version 3 of the License, or
1274+ * (at your option) any later version.
1275+ *
1276+ * This program is distributed in the hope that it will be useful,
1277+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1278+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1279+ * GNU General Public License for more details.
1280+ *
1281+ * You should have received a copy of the GNU General Public License
1282+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1283+ */
1284+
1285+using System;
1286+using Mono.Unix;
1287+
1288+using Gtk;
1289+
1290+namespace Do.FilesAndFolders
1291+{
1292+
1293+ // TODO: update this class to use spin buttons,
1294+ public class IndexPathNodeView : PathNodeView
1295+ {
1296+ public enum Column {
1297+ Path = 0,
1298+ Depth,
1299+ NumColumns
1300+ }
1301+
1302+ public IndexPathNodeView () : base ()
1303+ {
1304+ CellRenderer cell;
1305+ RulesHint = true;
1306+ HeadersVisible = true;
1307+
1308+ Model = new ListStore (typeof (string), typeof (uint));
1309+
1310+ cell = new CellRendererText ();
1311+ (cell as CellRendererText).Width = 310;
1312+ (cell as CellRendererText).Ellipsize = Pango.EllipsizeMode.Middle;
1313+ AppendColumn (Catalog.GetString ("Folder"), cell, "text", Column.Path);
1314+
1315+ cell = new CellRendererText ();
1316+ (cell as CellRendererText).Editable = true;
1317+ (cell as CellRendererText).Edited += OnDepthEdited;
1318+ (cell as CellRendererText).Alignment = Pango.Alignment.Right;
1319+ AppendColumn (Catalog.GetString ("Depth"), cell, "text", Column.Depth);
1320+
1321+ Refresh ();
1322+ }
1323+
1324+ public override void Refresh ()
1325+ {
1326+ ListStore store = Model as ListStore;
1327+ //try to keep the currently selected row across refreshes
1328+ Gtk.TreePath selected = null;
1329+ try {
1330+ selected = this.Selection.GetSelectedRows ()[0];
1331+ }
1332+ catch { }
1333+ finally {
1334+ store.Clear ();
1335+ foreach (IndexedFolder pair in Plugin.FolderIndex) {
1336+ if (pair.Index)
1337+ store.AppendValues ( pair.Path, pair.Level);
1338+ }
1339+ if (selected != null)
1340+ this.Selection.SelectPath (selected);
1341+ }
1342+ }
1343+
1344+ public void OnDepthEdited (object o, EditedArgs e)
1345+ {
1346+ uint depth;
1347+ string path;
1348+ TreeIter iter;
1349+ ListStore store;
1350+
1351+ store = Model as ListStore;
1352+ store.GetIter (out iter, new TreePath (e.Path));
1353+
1354+ path = store.GetValue (iter, (int) Column.Path) as string;
1355+ depth = uint.Parse (e.NewText);
1356+ Plugin.FolderIndex.UpdateIndexedFolder (path, path, depth, true);
1357+
1358+ Refresh ();
1359+ }
1360+ }
1361+}
1362\ No newline at end of file
1363
1364=== modified file 'File/src/PathNodeView.cs'
1365--- File/src/PathNodeView.cs 2009-01-14 19:27:04 +0000
1366+++ File/src/PathNodeView.cs 2009-02-16 01:11:46 +0000
1367@@ -19,8 +19,6 @@
1368 */
1369
1370 using System;
1371-using System.IO;
1372-
1373 using Mono.Unix;
1374
1375 using Gtk;
1376@@ -29,61 +27,17 @@
1377 {
1378
1379 // TODO: update this class to use spin buttons,
1380- public class PathNodeView : NodeView
1381+ public abstract class PathNodeView : NodeView
1382 {
1383- enum Column {
1384- Path = 0,
1385- Depth,
1386- NumColumns
1387- }
1388+
1389
1390 public PathNodeView () : base ()
1391 {
1392- CellRenderer cell;
1393- RulesHint = true;
1394- HeadersVisible = true;
1395-
1396- Model = new ListStore (typeof (string), typeof (uint));
1397-
1398- cell = new CellRendererText ();
1399- (cell as CellRendererText).Width = 310;
1400- (cell as CellRendererText).Ellipsize = Pango.EllipsizeMode.Middle;
1401- AppendColumn (Catalog.GetString ("Folder"), cell, "text", Column.Path);
1402-
1403- cell = new CellRendererText ();
1404- (cell as CellRendererText).Editable = true;
1405- (cell as CellRendererText).Edited += OnDepthEdited;
1406- (cell as CellRendererText).Alignment = Pango.Alignment.Right;
1407- AppendColumn (Catalog.GetString ("Depth"), cell, "text", Column.Depth);
1408-
1409- Refresh ();
1410- }
1411-
1412- public void Refresh ()
1413- {
1414- ListStore store = Model as ListStore;
1415- store.Clear ();
1416- foreach (IndexedFolder pair in Plugin.FolderIndex)
1417- store.AppendValues (pair.Path, pair.Level);
1418- }
1419-
1420- void OnDepthEdited (object o, EditedArgs e)
1421- {
1422- uint depth;
1423- string path;
1424- TreeIter iter;
1425- ListStore store;
1426-
1427- store = Model as ListStore;
1428- store.GetIter (out iter, new TreePath (e.Path));
1429- path = store.GetValue (iter, (int)Column.Path) as string;
1430- depth = uint.Parse (e.NewText);
1431- Plugin.FolderIndex.UpdateIndexedFolder (path, path, depth);
1432-
1433- Refresh ();
1434- }
1435-
1436- public void OnRemoveSelected (object sender, EventArgs e)
1437+ }
1438+
1439+ public abstract void Refresh ();
1440+
1441+ public virtual void OnRemoveSelected (object sender, EventArgs e)
1442 {
1443 string path;
1444 TreeIter iter;
1445@@ -91,7 +45,7 @@
1446
1447 store = Model as ListStore;
1448 Selection.GetSelected (out iter);
1449- path = store.GetValue (iter, (int)Column.Path) as string;
1450+ path = store.GetValue (iter, 0) as string;
1451 Plugin.FolderIndex.RemoveIndexedFolder (path);
1452 store.Remove (ref iter);
1453

Subscribers

People subscribed via source and target branches