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
=== modified file 'File/File.mdp'
--- File/File.mdp 2009-02-28 16:16:48 +0000
+++ File/File.mdp 2009-03-01 00:06:44 +0000
@@ -41,6 +41,9 @@
41 <File name="src/Do/Do.FilesAndFolders/MoveToTrashAction.cs" subtype="Code" buildaction="Compile" />41 <File name="src/Do/Do.FilesAndFolders/MoveToTrashAction.cs" subtype="Code" buildaction="Compile" />
42 <File name="src/Do/Do.FilesAndFolders/AbstractFileAction.cs" subtype="Code" buildaction="Compile" />42 <File name="src/Do/Do.FilesAndFolders/AbstractFileAction.cs" subtype="Code" buildaction="Compile" />
43 <File name="src/Do/Do.FilesAndFolders/RenameAction.cs" subtype="Code" buildaction="Compile" />43 <File name="src/Do/Do.FilesAndFolders/RenameAction.cs" subtype="Code" buildaction="Compile" />
44 <File name="src/CellRendererTogglePixbuf.cs" subtype="Code" buildaction="Compile" />
45 <File name="src/IndexPathNodeView.cs" subtype="Code" buildaction="Compile" />
46 <File name="src/IgnorePathNodeView.cs" subtype="Code" buildaction="Compile" />
44 </Contents>47 </Contents>
45 <References>48 <References>
46 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />49 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
@@ -52,5 +55,6 @@
52 <ProjectReference type="Gac" localcopy="True" refto="Do.Universe, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />55 <ProjectReference type="Gac" localcopy="True" refto="Do.Universe, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />
53 <ProjectReference type="Gac" localcopy="True" refto="Do.Platform, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />56 <ProjectReference type="Gac" localcopy="True" refto="Do.Platform, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />
54 <ProjectReference type="Gac" localcopy="True" refto="Do.Platform.Linux, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />57 <ProjectReference type="Gac" localcopy="True" refto="Do.Platform.Linux, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null" />
58 <ProjectReference type="Gac" localcopy="True" refto="Do.Interface.Linux, Version=0.9.0.0, Culture=neutral, PublicKeyToken=null" />
55 </References>59 </References>
56</Project>60</Project>
57\ No newline at end of file61\ No newline at end of file
5862
=== modified file 'File/Makefile.am'
--- File/Makefile.am 2009-01-14 00:28:50 +0000
+++ File/Makefile.am 2009-02-16 01:11:46 +0000
@@ -6,6 +6,8 @@
6 gtk-gui/Do.FilesAndFolders.Configuration.cs \6 gtk-gui/Do.FilesAndFolders.Configuration.cs \
7 gtk-gui/generated.cs \7 gtk-gui/generated.cs \
8 src/PathNodeView.cs \8 src/PathNodeView.cs \
9 src/IndexPathNodeView.cs \
10 src/IgnorePathNodeView.cs \
9 src/Do/Do.FilesAndFolders/NewFolderAction.cs \11 src/Do/Do.FilesAndFolders/NewFolderAction.cs \
10 src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs \12 src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs \
11 src/Do/Do.FilesAndFolders/Preferences.cs \13 src/Do/Do.FilesAndFolders/Preferences.cs \
1214
=== modified file 'File/Resources/File.addin.xml'
--- File/Resources/File.addin.xml 2009-01-10 02:13:19 +0000
+++ File/Resources/File.addin.xml 2009-02-14 20:58:03 +0000
@@ -1,10 +1,10 @@
1<Addin 1<Addin
2 id="File"2 id="File"
3 namespace="Do"3 namespace="Do"
4 version="2.0"4 version="2.2"
5 name="Files and Folders"5 name="Files and Folders"
6 description="Search, browse, and perform other actions on files and folders."6 description="Search, browse, and perform other actions on files and folders."
7 author="David Siegel, Alex Launi, Ankit Solanki"7 author="David Siegel, Alex Launi, Ankit Solanki, Chris Szikszoy"
8 category="Official"8 category="Official"
9 >9 >
1010
1111
=== modified file 'File/gtk-gui/Do.FilesAndFolders.Configuration.cs'
--- File/gtk-gui/Do.FilesAndFolders.Configuration.cs 2009-02-13 21:34:02 +0000
+++ File/gtk-gui/Do.FilesAndFolders.Configuration.cs 2009-02-17 10:48:05 +0000
@@ -17,19 +17,23 @@
17 17
18 private Gtk.VBox vbox2;18 private Gtk.VBox vbox2;
19 19
20 private Gtk.ScrolledWindow node_scroll;
21
22 private Gtk.VBox vbox1;20 private Gtk.VBox vbox1;
23 21
24 private Gtk.HButtonBox hbuttonbox1;22 private Gtk.Notebook notebook1;
25 23
26 private Gtk.Button remove_btn;24 private Gtk.VBox vbox4;
27 25
28 private Gtk.Image image3;26 private Gtk.ScrolledWindow index_node_scroll;
29 27
30 private Gtk.Button add_btn;28 private Gtk.HBox hbox1;
31 29
32 private Gtk.Image image1;30 private Gtk.Label IndexLabel;
31
32 private Gtk.HButtonBox hbuttonbox2;
33
34 private Gtk.Button index_remove_btn;
35
36 private Gtk.Button index_add_btn;
33 37
34 private Gtk.HBox hbox2;38 private Gtk.HBox hbox2;
35 39
@@ -37,10 +41,26 @@
37 41
38 private Gtk.Entry numFiles;42 private Gtk.Entry numFiles;
39 43
40 private Gtk.VBox vbox3;
41
42 private Gtk.CheckButton show_hidden_chk;44 private Gtk.CheckButton show_hidden_chk;
43 45
46 private Gtk.Label label1;
47
48 private Gtk.VBox vbox5;
49
50 private Gtk.ScrolledWindow ignore_node_scroll;
51
52 private Gtk.HBox hbox3;
53
54 private Gtk.Label IgnoreLabel;
55
56 private Gtk.HButtonBox hbuttonbox3;
57
58 private Gtk.Button ignore_remove_btn;
59
60 private Gtk.Button ignore_add_btn;
61
62 private Gtk.Label label2;
63
44 protected virtual void Build() {64 protected virtual void Build() {
45 Stetic.Gui.Initialize(this);65 Stetic.Gui.Initialize(this);
46 // Widget Do.FilesAndFolders.Configuration66 // Widget Do.FilesAndFolders.Configuration
@@ -55,57 +75,98 @@
55 this.vbox2.Name = "vbox2";75 this.vbox2.Name = "vbox2";
56 this.vbox2.Spacing = 6;76 this.vbox2.Spacing = 6;
57 // Container child vbox2.Gtk.Box+BoxChild77 // Container child vbox2.Gtk.Box+BoxChild
58 this.node_scroll = new Gtk.ScrolledWindow();
59 this.node_scroll.CanFocus = true;
60 this.node_scroll.Name = "node_scroll";
61 this.node_scroll.ShadowType = ((Gtk.ShadowType)(1));
62 this.vbox2.Add(this.node_scroll);
63 Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox2[this.node_scroll]));
64 w1.Position = 0;
65 // Container child vbox2.Gtk.Box+BoxChild
66 this.vbox1 = new Gtk.VBox();78 this.vbox1 = new Gtk.VBox();
67 this.vbox1.Name = "vbox1";79 this.vbox1.Name = "vbox1";
68 this.vbox1.Spacing = 6;80 this.vbox1.Spacing = 6;
69 // Container child vbox1.Gtk.Box+BoxChild81 // Container child vbox1.Gtk.Box+BoxChild
70 this.hbuttonbox1 = new Gtk.HButtonBox();82 this.notebook1 = new Gtk.Notebook();
71 this.hbuttonbox1.Name = "hbuttonbox1";83 this.notebook1.HeightRequest = 270;
72 this.hbuttonbox1.Spacing = 4;84 this.notebook1.CanFocus = true;
73 this.hbuttonbox1.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));85 this.notebook1.Name = "notebook1";
74 // Container child hbuttonbox1.Gtk.ButtonBox+ButtonBoxChild86 this.notebook1.CurrentPage = 1;
75 this.remove_btn = new Gtk.Button();87 this.notebook1.ShowBorder = false;
76 this.remove_btn.CanFocus = true;88 // Container child notebook1.Gtk.Notebook+NotebookChild
77 this.remove_btn.Name = "remove_btn";89 this.vbox4 = new Gtk.VBox();
78 // Container child remove_btn.Gtk.Container+ContainerChild90 this.vbox4.Name = "vbox4";
79 this.image3 = new Gtk.Image();91 this.vbox4.Spacing = 6;
80 this.image3.Name = "image3";92 // Container child vbox4.Gtk.Box+BoxChild
81 this.image3.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-remove", Gtk.IconSize.Button, 20);93 this.index_node_scroll = new Gtk.ScrolledWindow();
82 this.remove_btn.Add(this.image3);94 this.index_node_scroll.CanFocus = true;
83 this.remove_btn.Label = null;95 this.index_node_scroll.Name = "index_node_scroll";
84 this.hbuttonbox1.Add(this.remove_btn);96 this.index_node_scroll.ShadowType = ((Gtk.ShadowType)(1));
85 Gtk.ButtonBox.ButtonBoxChild w3 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1[this.remove_btn]));97 this.vbox4.Add(this.index_node_scroll);
86 w3.Expand = false;98 Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox4[this.index_node_scroll]));
87 w3.Fill = false;99 w1.Position = 0;
88 // Container child hbuttonbox1.Gtk.ButtonBox+ButtonBoxChild100 // Container child vbox4.Gtk.Box+BoxChild
89 this.add_btn = new Gtk.Button();101 this.hbox1 = new Gtk.HBox();
90 this.add_btn.CanFocus = true;102 this.hbox1.Name = "hbox1";
91 this.add_btn.Name = "add_btn";103 this.hbox1.Spacing = 6;
92 // Container child add_btn.Gtk.Container+ContainerChild104 // Container child hbox1.Gtk.Box+BoxChild
93 this.image1 = new Gtk.Image();105 this.IndexLabel = new Gtk.Label();
94 this.image1.Name = "image1";106 this.IndexLabel.Name = "IndexLabel";
95 this.image1.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Button, 20);107 this.hbox1.Add(this.IndexLabel);
96 this.add_btn.Add(this.image1);108 Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.IndexLabel]));
97 this.add_btn.Label = null;109 w2.Position = 0;
98 this.hbuttonbox1.Add(this.add_btn);110 // Container child hbox1.Gtk.Box+BoxChild
99 Gtk.ButtonBox.ButtonBoxChild w5 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1[this.add_btn]));111 this.hbuttonbox2 = new Gtk.HButtonBox();
100 w5.Position = 1;112 this.hbuttonbox2.Name = "hbuttonbox2";
101 w5.Expand = false;113 // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
102 w5.Fill = false;114 this.index_remove_btn = new Gtk.Button();
103 this.vbox1.Add(this.hbuttonbox1);115 this.index_remove_btn.CanFocus = true;
104 Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbuttonbox1]));116 this.index_remove_btn.Name = "index_remove_btn";
105 w6.Position = 0;117 this.index_remove_btn.UseUnderline = true;
106 w6.Expand = false;118 // Container child index_remove_btn.Gtk.Container+ContainerChild
107 w6.Fill = false;119 Gtk.Alignment w3 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
108 // Container child vbox1.Gtk.Box+BoxChild120 // Container child GtkAlignment.Gtk.Container+ContainerChild
121 Gtk.HBox w4 = new Gtk.HBox();
122 w4.Spacing = 2;
123 // Container child GtkHBox.Gtk.Container+ContainerChild
124 Gtk.Image w5 = new Gtk.Image();
125 w5.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-remove", Gtk.IconSize.Button, 20);
126 w4.Add(w5);
127 // Container child GtkHBox.Gtk.Container+ContainerChild
128 Gtk.Label w7 = new Gtk.Label();
129 w4.Add(w7);
130 w3.Add(w4);
131 this.index_remove_btn.Add(w3);
132 this.hbuttonbox2.Add(this.index_remove_btn);
133 Gtk.ButtonBox.ButtonBoxChild w11 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.index_remove_btn]));
134 w11.Expand = false;
135 w11.Fill = false;
136 // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
137 this.index_add_btn = new Gtk.Button();
138 this.index_add_btn.CanFocus = true;
139 this.index_add_btn.Name = "index_add_btn";
140 this.index_add_btn.UseUnderline = true;
141 // Container child index_add_btn.Gtk.Container+ContainerChild
142 Gtk.Alignment w12 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
143 // Container child GtkAlignment.Gtk.Container+ContainerChild
144 Gtk.HBox w13 = new Gtk.HBox();
145 w13.Spacing = 2;
146 // Container child GtkHBox.Gtk.Container+ContainerChild
147 Gtk.Image w14 = new Gtk.Image();
148 w14.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Menu, 16);
149 w13.Add(w14);
150 // Container child GtkHBox.Gtk.Container+ContainerChild
151 Gtk.Label w16 = new Gtk.Label();
152 w13.Add(w16);
153 w12.Add(w13);
154 this.index_add_btn.Add(w12);
155 this.hbuttonbox2.Add(this.index_add_btn);
156 Gtk.ButtonBox.ButtonBoxChild w20 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.index_add_btn]));
157 w20.Position = 1;
158 w20.Expand = false;
159 w20.Fill = false;
160 this.hbox1.Add(this.hbuttonbox2);
161 Gtk.Box.BoxChild w21 = ((Gtk.Box.BoxChild)(this.hbox1[this.hbuttonbox2]));
162 w21.Position = 1;
163 w21.Expand = false;
164 this.vbox4.Add(this.hbox1);
165 Gtk.Box.BoxChild w22 = ((Gtk.Box.BoxChild)(this.vbox4[this.hbox1]));
166 w22.Position = 1;
167 w22.Expand = false;
168 w22.Fill = false;
169 // Container child vbox4.Gtk.Box+BoxChild
109 this.hbox2 = new Gtk.HBox();170 this.hbox2 = new Gtk.HBox();
110 this.hbox2.Name = "hbox2";171 this.hbox2.Name = "hbox2";
111 this.hbox2.Spacing = 6;172 this.hbox2.Spacing = 6;
@@ -114,10 +175,10 @@
114 this.maxFileslbl.Name = "maxFileslbl";175 this.maxFileslbl.Name = "maxFileslbl";
115 this.maxFileslbl.LabelProp = Mono.Unix.Catalog.GetString("Maximum number of items to index:");176 this.maxFileslbl.LabelProp = Mono.Unix.Catalog.GetString("Maximum number of items to index:");
116 this.hbox2.Add(this.maxFileslbl);177 this.hbox2.Add(this.maxFileslbl);
117 Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.hbox2[this.maxFileslbl]));178 Gtk.Box.BoxChild w23 = ((Gtk.Box.BoxChild)(this.hbox2[this.maxFileslbl]));
118 w7.Position = 0;179 w23.Position = 0;
119 w7.Expand = false;180 w23.Expand = false;
120 w7.Fill = false;181 w23.Fill = false;
121 // Container child hbox2.Gtk.Box+BoxChild182 // Container child hbox2.Gtk.Box+BoxChild
122 this.numFiles = new Gtk.Entry();183 this.numFiles = new Gtk.Entry();
123 this.numFiles.CanFocus = true;184 this.numFiles.CanFocus = true;
@@ -126,19 +187,15 @@
126 this.numFiles.WidthChars = 5;187 this.numFiles.WidthChars = 5;
127 this.numFiles.InvisibleChar = '●';188 this.numFiles.InvisibleChar = '●';
128 this.hbox2.Add(this.numFiles);189 this.hbox2.Add(this.numFiles);
129 Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.hbox2[this.numFiles]));190 Gtk.Box.BoxChild w24 = ((Gtk.Box.BoxChild)(this.hbox2[this.numFiles]));
130 w8.Position = 1;191 w24.Position = 1;
131 w8.Expand = false;192 w24.Expand = false;
132 this.vbox1.Add(this.hbox2);193 this.vbox4.Add(this.hbox2);
133 Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbox2]));194 Gtk.Box.BoxChild w25 = ((Gtk.Box.BoxChild)(this.vbox4[this.hbox2]));
134 w9.Position = 1;195 w25.Position = 2;
135 w9.Expand = false;196 w25.Expand = false;
136 w9.Fill = false;197 w25.Fill = false;
137 // Container child vbox1.Gtk.Box+BoxChild198 // Container child vbox4.Gtk.Box+BoxChild
138 this.vbox3 = new Gtk.VBox();
139 this.vbox3.Name = "vbox3";
140 this.vbox3.Spacing = 6;
141 // Container child vbox3.Gtk.Box+BoxChild
142 this.show_hidden_chk = new Gtk.CheckButton();199 this.show_hidden_chk = new Gtk.CheckButton();
143 this.show_hidden_chk.CanFocus = true;200 this.show_hidden_chk.CanFocus = true;
144 this.show_hidden_chk.Name = "show_hidden_chk";201 this.show_hidden_chk.Name = "show_hidden_chk";
@@ -147,31 +204,127 @@
147 this.show_hidden_chk.DrawIndicator = true;204 this.show_hidden_chk.DrawIndicator = true;
148 this.show_hidden_chk.UseUnderline = true;205 this.show_hidden_chk.UseUnderline = true;
149 this.show_hidden_chk.BorderWidth = ((uint)(5));206 this.show_hidden_chk.BorderWidth = ((uint)(5));
150 this.vbox3.Add(this.show_hidden_chk);207 this.vbox4.Add(this.show_hidden_chk);
151 Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox3[this.show_hidden_chk]));208 Gtk.Box.BoxChild w26 = ((Gtk.Box.BoxChild)(this.vbox4[this.show_hidden_chk]));
152 w10.Position = 0;209 w26.Position = 3;
153 w10.Expand = false;210 w26.Expand = false;
154 w10.Fill = false;211 w26.Fill = false;
155 this.vbox1.Add(this.vbox3);212 this.notebook1.Add(this.vbox4);
156 Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(this.vbox1[this.vbox3]));213 // Notebook tab
157 w11.Position = 2;214 this.label1 = new Gtk.Label();
158 w11.Expand = false;215 this.label1.Name = "label1";
159 w11.Fill = false;216 this.label1.LabelProp = Mono.Unix.Catalog.GetString("Indexed Folders");
217 this.notebook1.SetTabLabel(this.vbox4, this.label1);
218 this.label1.ShowAll();
219 // Container child notebook1.Gtk.Notebook+NotebookChild
220 this.vbox5 = new Gtk.VBox();
221 this.vbox5.Name = "vbox5";
222 this.vbox5.Spacing = 6;
223 // Container child vbox5.Gtk.Box+BoxChild
224 this.ignore_node_scroll = new Gtk.ScrolledWindow();
225 this.ignore_node_scroll.CanFocus = true;
226 this.ignore_node_scroll.Name = "ignore_node_scroll";
227 this.ignore_node_scroll.ShadowType = ((Gtk.ShadowType)(1));
228 this.vbox5.Add(this.ignore_node_scroll);
229 Gtk.Box.BoxChild w28 = ((Gtk.Box.BoxChild)(this.vbox5[this.ignore_node_scroll]));
230 w28.Position = 0;
231 // Container child vbox5.Gtk.Box+BoxChild
232 this.hbox3 = new Gtk.HBox();
233 this.hbox3.Name = "hbox3";
234 this.hbox3.Spacing = 6;
235 // Container child hbox3.Gtk.Box+BoxChild
236 this.IgnoreLabel = new Gtk.Label();
237 this.IgnoreLabel.Name = "IgnoreLabel";
238 this.hbox3.Add(this.IgnoreLabel);
239 Gtk.Box.BoxChild w29 = ((Gtk.Box.BoxChild)(this.hbox3[this.IgnoreLabel]));
240 w29.Position = 0;
241 w29.Fill = false;
242 // Container child hbox3.Gtk.Box+BoxChild
243 this.hbuttonbox3 = new Gtk.HButtonBox();
244 this.hbuttonbox3.Name = "hbuttonbox3";
245 // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild
246 this.ignore_remove_btn = new Gtk.Button();
247 this.ignore_remove_btn.CanFocus = true;
248 this.ignore_remove_btn.Name = "ignore_remove_btn";
249 this.ignore_remove_btn.UseUnderline = true;
250 // Container child ignore_remove_btn.Gtk.Container+ContainerChild
251 Gtk.Alignment w30 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
252 // Container child GtkAlignment.Gtk.Container+ContainerChild
253 Gtk.HBox w31 = new Gtk.HBox();
254 w31.Spacing = 2;
255 // Container child GtkHBox.Gtk.Container+ContainerChild
256 Gtk.Image w32 = new Gtk.Image();
257 w32.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-remove", Gtk.IconSize.Button, 20);
258 w31.Add(w32);
259 // Container child GtkHBox.Gtk.Container+ContainerChild
260 Gtk.Label w34 = new Gtk.Label();
261 w31.Add(w34);
262 w30.Add(w31);
263 this.ignore_remove_btn.Add(w30);
264 this.hbuttonbox3.Add(this.ignore_remove_btn);
265 Gtk.ButtonBox.ButtonBoxChild w38 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3[this.ignore_remove_btn]));
266 w38.Expand = false;
267 w38.Fill = false;
268 // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild
269 this.ignore_add_btn = new Gtk.Button();
270 this.ignore_add_btn.CanFocus = true;
271 this.ignore_add_btn.Name = "ignore_add_btn";
272 this.ignore_add_btn.UseUnderline = true;
273 // Container child ignore_add_btn.Gtk.Container+ContainerChild
274 Gtk.Alignment w39 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
275 // Container child GtkAlignment.Gtk.Container+ContainerChild
276 Gtk.HBox w40 = new Gtk.HBox();
277 w40.Spacing = 2;
278 // Container child GtkHBox.Gtk.Container+ContainerChild
279 Gtk.Image w41 = new Gtk.Image();
280 w41.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Menu, 16);
281 w40.Add(w41);
282 // Container child GtkHBox.Gtk.Container+ContainerChild
283 Gtk.Label w43 = new Gtk.Label();
284 w40.Add(w43);
285 w39.Add(w40);
286 this.ignore_add_btn.Add(w39);
287 this.hbuttonbox3.Add(this.ignore_add_btn);
288 Gtk.ButtonBox.ButtonBoxChild w47 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3[this.ignore_add_btn]));
289 w47.Position = 1;
290 w47.Expand = false;
291 w47.Fill = false;
292 this.hbox3.Add(this.hbuttonbox3);
293 Gtk.Box.BoxChild w48 = ((Gtk.Box.BoxChild)(this.hbox3[this.hbuttonbox3]));
294 w48.Position = 1;
295 w48.Expand = false;
296 this.vbox5.Add(this.hbox3);
297 Gtk.Box.BoxChild w49 = ((Gtk.Box.BoxChild)(this.vbox5[this.hbox3]));
298 w49.Position = 1;
299 w49.Expand = false;
300 w49.Fill = false;
301 this.notebook1.Add(this.vbox5);
302 Gtk.Notebook.NotebookChild w50 = ((Gtk.Notebook.NotebookChild)(this.notebook1[this.vbox5]));
303 w50.Position = 1;
304 // Notebook tab
305 this.label2 = new Gtk.Label();
306 this.label2.Name = "label2";
307 this.label2.LabelProp = Mono.Unix.Catalog.GetString("Ignored Folders");
308 this.notebook1.SetTabLabel(this.vbox5, this.label2);
309 this.label2.ShowAll();
310 this.vbox1.Add(this.notebook1);
311 Gtk.Box.BoxChild w51 = ((Gtk.Box.BoxChild)(this.vbox1[this.notebook1]));
312 w51.Position = 0;
160 this.vbox2.Add(this.vbox1);313 this.vbox2.Add(this.vbox1);
161 Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(this.vbox2[this.vbox1]));314 Gtk.Box.BoxChild w52 = ((Gtk.Box.BoxChild)(this.vbox2[this.vbox1]));
162 w12.Position = 1;315 w52.Position = 0;
163 w12.Expand = false;
164 w12.Fill = false;
165 this.alignment1.Add(this.vbox2);316 this.alignment1.Add(this.vbox2);
166 this.Add(this.alignment1);317 this.Add(this.alignment1);
167 if ((this.Child != null)) {318 if ((this.Child != null)) {
168 this.Child.ShowAll();319 this.Child.ShowAll();
169 }320 }
170 this.Show();321 this.Show();
171 this.remove_btn.Clicked += new System.EventHandler(this.OnRemoveBtnClicked);322 this.index_remove_btn.Clicked += new System.EventHandler(this.OnRemoveBtnClicked);
172 this.add_btn.Clicked += new System.EventHandler(this.OnAddBtnClicked);323 this.index_add_btn.Clicked += new System.EventHandler(this.OnAddBtnClicked);
173 this.numFiles.Changed += new System.EventHandler(this.OnNumFilesEdited);324 this.numFiles.Changed += new System.EventHandler(this.OnNumFilesEdited);
174 this.show_hidden_chk.Clicked += new System.EventHandler(this.OnShowHiddenChkClicked);325 this.show_hidden_chk.Clicked += new System.EventHandler(this.OnShowHiddenChkClicked);
326 this.ignore_remove_btn.Clicked += new System.EventHandler(this.OnRemoveBtnClicked);
327 this.ignore_add_btn.Clicked += new System.EventHandler(this.OnAddBtnClicked);
175 }328 }
176 }329 }
177}330}
178331
=== modified file 'File/gtk-gui/gui.stetic'
--- File/gtk-gui/gui.stetic 2009-02-13 21:34:02 +0000
+++ File/gtk-gui/gui.stetic 2009-03-02 03:08:02 +0000
@@ -2,9 +2,12 @@
2<stetic-interface>2<stetic-interface>
3 <configuration>3 <configuration>
4 <images-root-path>..</images-root-path>4 <images-root-path>..</images-root-path>
5 <target-gtk-version>2.12.1</target-gtk-version>5 <target-gtk-version>2.12</target-gtk-version>
6 </configuration>6 </configuration>
7 <widget class="Gtk.Bin" id="Do.FilesAndFolders.Configuration" design-size="328 354">7 <import>
8 <widget-library name="../bin/Debug/File.dll" internal="true" />
9 </import>
10 <widget class="Gtk.Bin" id="Do.FilesAndFolders.Configuration" design-size="414 356">
8 <property name="MemberName" />11 <property name="MemberName" />
9 <child>12 <child>
10 <widget class="Gtk.Alignment" id="alignment1">13 <widget class="Gtk.Alignment" id="alignment1">
@@ -15,156 +18,284 @@
15 <property name="MemberName" />18 <property name="MemberName" />
16 <property name="Spacing">6</property>19 <property name="Spacing">6</property>
17 <child>20 <child>
18 <widget class="Gtk.ScrolledWindow" id="node_scroll">
19 <property name="MemberName" />
20 <property name="CanFocus">True</property>
21 <property name="ShadowType">In</property>
22 <child>
23 <widget class="Gtk.Viewport" id="GtkViewport">
24 <property name="MemberName" />
25 <property name="ShadowType">None</property>
26 <child>
27 <placeholder />
28 </child>
29 </widget>
30 </child>
31 </widget>
32 <packing>
33 <property name="Position">0</property>
34 <property name="AutoSize">True</property>
35 </packing>
36 </child>
37 <child>
38 <widget class="Gtk.VBox" id="vbox1">21 <widget class="Gtk.VBox" id="vbox1">
39 <property name="MemberName" />22 <property name="MemberName" />
40 <property name="Spacing">6</property>23 <property name="Spacing">6</property>
41 <child>24 <child>
42 <widget class="Gtk.HButtonBox" id="hbuttonbox1">25 <widget class="Gtk.Notebook" id="notebook1">
43 <property name="MemberName" />26 <property name="MemberName" />
44 <property name="Spacing">4</property>27 <property name="HeightRequest">270</property>
45 <property name="Size">2</property>28 <property name="CanFocus">True</property>
46 <property name="LayoutStyle">End</property>29 <property name="CurrentPage">1</property>
47 <child>30 <property name="ShowBorder">False</property>
48 <widget class="Gtk.Button" id="remove_btn">31 <child>
49 <property name="MemberName" />32 <widget class="Gtk.VBox" id="vbox4">
50 <property name="CanFocus">True</property>33 <property name="MemberName" />
51 <property name="Type">Custom</property>34 <property name="Spacing">6</property>
52 <signal name="Clicked" handler="OnRemoveBtnClicked" />35 <child>
53 <child>36 <widget class="Gtk.ScrolledWindow" id="index_node_scroll">
54 <widget class="Gtk.Image" id="image3">37 <property name="MemberName" />
55 <property name="MemberName" />38 <property name="CanFocus">True</property>
56 <property name="Pixbuf">stock:gtk-remove Button</property>39 <property name="ShadowType">In</property>
57 </widget>40 <child>
58 </child>41 <widget class="Gtk.Viewport" id="GtkViewport">
42 <property name="MemberName" />
43 <property name="ShadowType">None</property>
44 <child>
45 <placeholder />
46 </child>
47 </widget>
48 </child>
49 </widget>
50 <packing>
51 <property name="Position">0</property>
52 <property name="AutoSize">True</property>
53 </packing>
54 </child>
55 <child>
56 <widget class="Gtk.HBox" id="hbox1">
57 <property name="MemberName" />
58 <property name="Spacing">6</property>
59 <child>
60 <widget class="Gtk.Label" id="IndexLabel">
61 <property name="MemberName" />
62 </widget>
63 <packing>
64 <property name="Position">0</property>
65 <property name="AutoSize">False</property>
66 </packing>
67 </child>
68 <child>
69 <widget class="Gtk.HButtonBox" id="hbuttonbox2">
70 <property name="MemberName" />
71 <property name="Size">2</property>
72 <child>
73 <widget class="Gtk.Button" id="index_remove_btn">
74 <property name="MemberName" />
75 <property name="CanFocus">True</property>
76 <property name="Type">TextAndIcon</property>
77 <property name="Icon">stock:gtk-remove Button</property>
78 <property name="Label" translatable="yes" />
79 <property name="UseUnderline">True</property>
80 <signal name="Clicked" handler="OnRemoveBtnClicked" />
81 </widget>
82 <packing>
83 <property name="Expand">False</property>
84 <property name="Fill">False</property>
85 </packing>
86 </child>
87 <child>
88 <widget class="Gtk.Button" id="index_add_btn">
89 <property name="MemberName" />
90 <property name="CanFocus">True</property>
91 <property name="Type">TextAndIcon</property>
92 <property name="Icon">stock:gtk-add Menu</property>
93 <property name="Label" translatable="yes" />
94 <property name="UseUnderline">True</property>
95 <signal name="Clicked" handler="OnAddBtnClicked" />
96 </widget>
97 <packing>
98 <property name="Position">1</property>
99 <property name="Expand">False</property>
100 <property name="Fill">False</property>
101 </packing>
102 </child>
103 </widget>
104 <packing>
105 <property name="Position">1</property>
106 <property name="AutoSize">False</property>
107 <property name="Expand">False</property>
108 </packing>
109 </child>
110 </widget>
111 <packing>
112 <property name="Position">1</property>
113 <property name="AutoSize">True</property>
114 <property name="Expand">False</property>
115 <property name="Fill">False</property>
116 </packing>
117 </child>
118 <child>
119 <widget class="Gtk.HBox" id="hbox2">
120 <property name="MemberName" />
121 <property name="Spacing">6</property>
122 <child>
123 <widget class="Gtk.Label" id="maxFileslbl">
124 <property name="MemberName" />
125 <property name="LabelProp" translatable="yes">Maximum number of items to index:</property>
126 </widget>
127 <packing>
128 <property name="Position">0</property>
129 <property name="AutoSize">False</property>
130 <property name="Expand">False</property>
131 <property name="Fill">False</property>
132 </packing>
133 </child>
134 <child>
135 <widget class="Gtk.Entry" id="numFiles">
136 <property name="MemberName">numFiles</property>
137 <property name="CanFocus">True</property>
138 <property name="IsEditable">True</property>
139 <property name="WidthChars">5</property>
140 <property name="InvisibleChar">●</property>
141 <signal name="Changed" handler="OnNumFilesEdited" />
142 </widget>
143 <packing>
144 <property name="Position">1</property>
145 <property name="AutoSize">False</property>
146 <property name="Expand">False</property>
147 </packing>
148 </child>
149 </widget>
150 <packing>
151 <property name="Position">2</property>
152 <property name="AutoSize">True</property>
153 <property name="Expand">False</property>
154 <property name="Fill">False</property>
155 </packing>
156 </child>
157 <child>
158 <widget class="Gtk.CheckButton" id="show_hidden_chk">
159 <property name="MemberName" />
160 <property name="CanFocus">True</property>
161 <property name="Label" translatable="yes">Show hidden files</property>
162 <property name="Active">True</property>
163 <property name="DrawIndicator">True</property>
164 <property name="HasLabel">True</property>
165 <property name="UseUnderline">True</property>
166 <property name="BorderWidth">5</property>
167 <signal name="Clicked" handler="OnShowHiddenChkClicked" />
168 </widget>
169 <packing>
170 <property name="Position">3</property>
171 <property name="AutoSize">True</property>
172 <property name="Expand">False</property>
173 <property name="Fill">False</property>
174 </packing>
175 </child>
176 </widget>
177 </child>
178 <child>
179 <widget class="Gtk.Label" id="label1">
180 <property name="MemberName" />
181 <property name="LabelProp" translatable="yes">Indexed Folders</property>
59 </widget>182 </widget>
60 <packing>183 <packing>
61 <property name="Expand">False</property>184 <property name="type">tab</property>
62 <property name="Fill">False</property>
63 </packing>185 </packing>
64 </child>186 </child>
65 <child>187 <child>
66 <widget class="Gtk.Button" id="add_btn">188 <widget class="Gtk.VBox" id="vbox5">
67 <property name="MemberName" />189 <property name="MemberName" />
68 <property name="CanFocus">True</property>190 <property name="Spacing">6</property>
69 <property name="Type">Custom</property>191 <child>
70 <signal name="Clicked" handler="OnAddBtnClicked" />192 <widget class="Gtk.ScrolledWindow" id="ignore_node_scroll">
71 <child>193 <property name="MemberName" />
72 <widget class="Gtk.Image" id="image1">194 <property name="CanFocus">True</property>
73 <property name="MemberName" />195 <property name="ShadowType">In</property>
74 <property name="Pixbuf">stock:gtk-add Button</property>196 <child>
75 </widget>197 <widget class="Gtk.Viewport" id="GtkViewport1">
198 <property name="MemberName" />
199 <property name="ShadowType">None</property>
200 <child>
201 <placeholder />
202 </child>
203 </widget>
204 </child>
205 </widget>
206 <packing>
207 <property name="Position">0</property>
208 <property name="AutoSize">True</property>
209 </packing>
210 </child>
211 <child>
212 <widget class="Gtk.HBox" id="hbox3">
213 <property name="MemberName" />
214 <property name="Spacing">6</property>
215 <child>
216 <widget class="Gtk.Label" id="IgnoreLabel">
217 <property name="MemberName" />
218 </widget>
219 <packing>
220 <property name="Position">0</property>
221 <property name="AutoSize">False</property>
222 <property name="Fill">False</property>
223 </packing>
224 </child>
225 <child>
226 <widget class="Gtk.HButtonBox" id="hbuttonbox3">
227 <property name="MemberName" />
228 <property name="Size">2</property>
229 <child>
230 <widget class="Gtk.Button" id="ignore_remove_btn">
231 <property name="MemberName" />
232 <property name="CanFocus">True</property>
233 <property name="Type">TextAndIcon</property>
234 <property name="Icon">stock:gtk-remove Button</property>
235 <property name="Label" translatable="yes" />
236 <property name="UseUnderline">True</property>
237 <signal name="Clicked" handler="OnRemoveBtnClicked" />
238 </widget>
239 <packing>
240 <property name="Expand">False</property>
241 <property name="Fill">False</property>
242 </packing>
243 </child>
244 <child>
245 <widget class="Gtk.Button" id="ignore_add_btn">
246 <property name="MemberName" />
247 <property name="CanFocus">True</property>
248 <property name="Type">TextAndIcon</property>
249 <property name="Icon">stock:gtk-add Menu</property>
250 <property name="Label" translatable="yes" />
251 <property name="UseUnderline">True</property>
252 <signal name="Clicked" handler="OnAddBtnClicked" />
253 </widget>
254 <packing>
255 <property name="Position">1</property>
256 <property name="Expand">False</property>
257 <property name="Fill">False</property>
258 </packing>
259 </child>
260 </widget>
261 <packing>
262 <property name="Position">1</property>
263 <property name="AutoSize">False</property>
264 <property name="Expand">False</property>
265 </packing>
266 </child>
267 </widget>
268 <packing>
269 <property name="Position">1</property>
270 <property name="AutoSize">True</property>
271 <property name="Expand">False</property>
272 <property name="Fill">False</property>
273 </packing>
76 </child>274 </child>
77 </widget>275 </widget>
78 <packing>276 <packing>
79 <property name="Position">1</property>277 <property name="Position">1</property>
80 <property name="Expand">False</property>278 </packing>
81 <property name="Fill">False</property>279 </child>
280 <child>
281 <widget class="Gtk.Label" id="label2">
282 <property name="MemberName" />
283 <property name="LabelProp" translatable="yes">Ignored Folders</property>
284 </widget>
285 <packing>
286 <property name="type">tab</property>
82 </packing>287 </packing>
83 </child>288 </child>
84 </widget>289 </widget>
85 <packing>290 <packing>
86 <property name="Position">0</property>291 <property name="Position">0</property>
87 <property name="AutoSize">True</property>292 <property name="AutoSize">True</property>
88 <property name="Expand">False</property>
89 <property name="Fill">False</property>
90 </packing>
91 </child>
92 <child>
93 <widget class="Gtk.HBox" id="hbox2">
94 <property name="MemberName" />
95 <property name="Spacing">6</property>
96 <child>
97 <widget class="Gtk.Label" id="maxFileslbl">
98 <property name="MemberName" />
99 <property name="LabelProp" translatable="yes">Maximum number of items to index:</property>
100 </widget>
101 <packing>
102 <property name="Position">0</property>
103 <property name="AutoSize">False</property>
104 <property name="Expand">False</property>
105 <property name="Fill">False</property>
106 </packing>
107 </child>
108 <child>
109 <widget class="Gtk.Entry" id="numFiles">
110 <property name="MemberName">numFiles</property>
111 <property name="CanFocus">True</property>
112 <property name="IsEditable">True</property>
113 <property name="WidthChars">5</property>
114 <property name="InvisibleChar">●</property>
115 <signal name="Changed" handler="OnNumFilesEdited" />
116 </widget>
117 <packing>
118 <property name="Position">1</property>
119 <property name="AutoSize">False</property>
120 <property name="Expand">False</property>
121 </packing>
122 </child>
123 </widget>
124 <packing>
125 <property name="Position">1</property>
126 <property name="AutoSize">True</property>
127 <property name="Expand">False</property>
128 <property name="Fill">False</property>
129 </packing>
130 </child>
131 <child>
132 <widget class="Gtk.VBox" id="vbox3">
133 <property name="MemberName" />
134 <property name="Spacing">6</property>
135 <child>
136 <widget class="Gtk.CheckButton" id="show_hidden_chk">
137 <property name="MemberName" />
138 <property name="CanFocus">True</property>
139 <property name="Label" translatable="yes">Show hidden files</property>
140 <property name="Active">True</property>
141 <property name="DrawIndicator">True</property>
142 <property name="HasLabel">True</property>
143 <property name="UseUnderline">True</property>
144 <property name="BorderWidth">5</property>
145 <signal name="Clicked" handler="OnShowHiddenChkClicked" />
146 </widget>
147 <packing>
148 <property name="Position">0</property>
149 <property name="AutoSize">True</property>
150 <property name="Expand">False</property>
151 <property name="Fill">False</property>
152 </packing>
153 </child>
154 </widget>
155 <packing>
156 <property name="Position">2</property>
157 <property name="AutoSize">True</property>
158 <property name="Expand">False</property>
159 <property name="Fill">False</property>
160 </packing>293 </packing>
161 </child>294 </child>
162 </widget>295 </widget>
163 <packing>296 <packing>
164 <property name="Position">1</property>297 <property name="Position">0</property>
165 <property name="AutoSize">True</property>298 <property name="AutoSize">True</property>
166 <property name="Expand">False</property>
167 <property name="Fill">False</property>
168 </packing>299 </packing>
169 </child>300 </child>
170 </widget>301 </widget>
171302
=== modified file 'File/src/Do/Do.FilesAndFolders/Configuration.cs'
--- File/src/Do/Do.FilesAndFolders/Configuration.cs 2009-02-13 21:34:02 +0000
+++ File/src/Do/Do.FilesAndFolders/Configuration.cs 2009-02-17 10:48:05 +0000
@@ -30,49 +30,86 @@
30 [System.ComponentModel.ToolboxItem(true)]30 [System.ComponentModel.ToolboxItem(true)]
31 public partial class Configuration : Gtk.Bin31 public partial class Configuration : Gtk.Bin
32 {32 {
33 PathNodeView nview;33 IndexPathNodeView indexNview;
34 IgnorePathNodeView ignoreNview;
34 35
36 string indexDialog = Catalog.GetString ("Choose a folder to index");
37 string ignoreDialog = Catalog.GetString ("Choose a folder to ignore");
38
35 public Configuration ()39 public Configuration ()
36 {40 {
37 Build ();41 Build ();
38 42
39 nview = new PathNodeView ();43 indexNview = new IndexPathNodeView ();
40 nview.Selection.Changed += OnPathNodeViewSelectionChange;44 ignoreNview = new IgnorePathNodeView ();
45 indexNview.Selection.Changed += OnPathNodeViewSelectionChange;
46 ignoreNview.Selection.Changed += OnPathNodeViewSelectionChange;
41 numFiles.Changed += OnNumFilesEdited;47 numFiles.Changed += OnNumFilesEdited;
42 node_scroll.Add (nview);48
49 index_node_scroll.Add (indexNview);
50 ignore_node_scroll.Add (ignoreNview);
43 51
44 show_hidden_chk.Active = Plugin.Preferences.IncludeHiddenFiles;52 show_hidden_chk.Active = Plugin.Preferences.IncludeHiddenFiles;
45 numFiles.Text = Plugin.Preferences.MaximumFilesIndexed.ToString ();53 numFiles.Text = Plugin.Preferences.MaximumFilesIndexed.ToString ();
46 remove_btn.Sensitive = false;54 index_remove_btn.Sensitive = false;
47 55 ignore_remove_btn.Sensitive = false;
48 }56
4957 notebook1.Page = 0;
58
59 }
60
61 private PathNodeView GetCurrentView ()
62 {
63 PathNodeView currentNview;
64 if (this.notebook1.CurrentPage == 0)
65 currentNview = indexNview;
66 else
67 currentNview = ignoreNview;
68
69 return currentNview;
70 }
71
50 protected virtual void OnAddBtnClicked (object sender, System.EventArgs e)72 protected virtual void OnAddBtnClicked (object sender, System.EventArgs e)
51 {73 {
52 FileChooserDialog chooser;74 FileChooserDialog chooser;
5375 string dialogTitle;
76 bool index;
77 uint depth;
78
79 if (GetCurrentView () == indexNview) {
80 dialogTitle = indexDialog;
81 index = true;
82 depth = 1;
83 }
84 else {
85 index = false;
86 depth = 0;
87 dialogTitle = ignoreDialog;
88 }
89
54 chooser = new FileChooserDialog (90 chooser = new FileChooserDialog (
55 Catalog.GetString ("Choose a folder to index"),91 dialogTitle,
56 new Dialog (), FileChooserAction.SelectFolder,92 new Dialog (), FileChooserAction.SelectFolder,
57 Catalog.GetString ("Cancel"), ResponseType.Cancel,93 Catalog.GetString ("Cancel"), ResponseType.Cancel,
58 Catalog.GetString ("Choose folder"), ResponseType.Accept);94 Catalog.GetString ("Choose folder"), ResponseType.Accept);
59 95
60
61 if (chooser.Run () == (int) ResponseType.Accept) {96 if (chooser.Run () == (int) ResponseType.Accept) {
62 Plugin.FolderIndex.Add (new IndexedFolder (chooser.Filename, 1));97 if (!Plugin.FolderIndex.ContainsFolder (chooser.Filename))
63 nview.Refresh ();98 Plugin.FolderIndex.Add (new IndexedFolder (chooser.Filename, depth, index));
99 GetCurrentView ().Refresh ();
64 }100 }
65 chooser.Destroy ();101 chooser.Destroy ();
66 }102 }
67103
68 protected virtual void OnRemoveBtnClicked (object sender, EventArgs e)104 protected virtual void OnRemoveBtnClicked (object sender, EventArgs e)
69 {105 {
70 nview.OnRemoveSelected (sender, e);106 GetCurrentView ().OnRemoveSelected (sender, e);
71 }107 }
72 108
73 protected void OnPathNodeViewSelectionChange (object sender, EventArgs e)109 protected void OnPathNodeViewSelectionChange (object sender, EventArgs e)
74 {110 {
75 remove_btn.Sensitive = nview.Selection.GetSelectedRows ().Any ();111 index_remove_btn.Sensitive = indexNview.Selection.GetSelectedRows ().Any ();
112 ignore_remove_btn.Sensitive = ignoreNview.Selection.GetSelectedRows ().Any ();
76 }113 }
77114
78 protected virtual void OnShowHiddenChkClicked (object sender, EventArgs e)115 protected virtual void OnShowHiddenChkClicked (object sender, EventArgs e)
@@ -85,7 +122,7 @@
85 try {122 try {
86 Plugin.Preferences.MaximumFilesIndexed = int.Parse (numFiles.Text);123 Plugin.Preferences.MaximumFilesIndexed = int.Parse (numFiles.Text);
87 }124 }
88 catch (Exception ex) {125 catch {
89 numFiles.Text = "";126 numFiles.Text = "";
90 Plugin.Preferences.MaximumFilesIndexed = 0;127 Plugin.Preferences.MaximumFilesIndexed = 0;
91 }128 }
92129
=== modified file 'File/src/Do/Do.FilesAndFolders/FileItemSource.cs'
--- File/src/Do/Do.FilesAndFolders/FileItemSource.cs 2009-01-18 06:04:49 +0000
+++ File/src/Do/Do.FilesAndFolders/FileItemSource.cs 2009-02-14 20:52:23 +0000
@@ -36,6 +36,7 @@
36 public class FileItemSource : ItemSource, IConfigurable {36 public class FileItemSource : ItemSource, IConfigurable {
3737
38 IEnumerable<Item> items;38 IEnumerable<Item> items;
39 static IEnumerable<IndexedFolder> ignored;
39 bool maximum_files_warned;40 bool maximum_files_warned;
4041
41 string MaximumFilesIndexedWarning {42 string MaximumFilesIndexedWarning {
@@ -55,6 +56,7 @@
55 public FileItemSource ()56 public FileItemSource ()
56 {57 {
57 items = Enumerable.Empty<Item> ();58 items = Enumerable.Empty<Item> ();
59 ignored = Enumerable.Empty<IndexedFolder> ();
58 }60 }
5961
60 public override IEnumerable<Item> Items {62 public override IEnumerable<Item> Items {
@@ -104,11 +106,15 @@
104 106
105 public override void UpdateItems ()107 public override void UpdateItems ()
106 {108 {
109 ignored = Plugin.FolderIndex
110 .Where (folder => !folder.Index)
111 .ToArray ();
112
107 items = Plugin.FolderIndex113 items = Plugin.FolderIndex
108 .SelectMany (folder => RecursiveGetItems (folder.Path, folder.Level, Plugin.Preferences.IncludeHiddenFiles))114 .SelectMany (folder => RecursiveGetItems (folder.Path, folder.Level, Plugin.Preferences.IncludeHiddenFiles))
109 .Take (Plugin.Preferences.MaximumFilesIndexed)115 .Take (Plugin.Preferences.MaximumFilesIndexed)
110 .ToArray ();116 .ToArray ();
111117
112 if (!maximum_files_warned && items.Count () == Plugin.Preferences.MaximumFilesIndexed) {118 if (!maximum_files_warned && items.Count () == Plugin.Preferences.MaximumFilesIndexed) {
113 Log.Warn (MaximumFilesIndexedWarning);119 Log.Warn (MaximumFilesIndexedWarning);
114 Services.Notifications.Notify ("Do is indexing too many files.", MaximumFilesIndexedWarning);120 Services.Notifications.Notify ("Do is indexing too many files.", MaximumFilesIndexedWarning);
@@ -167,9 +173,9 @@
167 IEnumerable<string> files, directories, recursiveFiles;173 IEnumerable<string> files, directories, recursiveFiles;
168 174
169 files = Directory.GetFiles (path)175 files = Directory.GetFiles (path)
170 .Where (filepath => ShouldIndexPath (filepath, includeHidden));176 .Where (filepath => ShouldIndexPath (filepath, includeHidden, false));
171 directories = Directory.GetDirectories (path)177 directories = Directory.GetDirectories (path)
172 .Where (filepath => ShouldIndexPath (filepath, includeHidden));178 .Where (filepath => ShouldIndexPath (filepath, includeHidden, true));
173 recursiveFiles = directories179 recursiveFiles = directories
174 .SelectMany (dir => RecursiveListFiles (dir, levels - 1, includeHidden));180 .SelectMany (dir => RecursiveListFiles (dir, levels - 1, includeHidden));
175 181
@@ -182,11 +188,13 @@
182 return results;188 return results;
183 }189 }
184190
185 static bool ShouldIndexPath (string path, bool includeHidden)191 static bool ShouldIndexPath (string path, bool includeHidden, bool isDirectory)
186 {192 {
187 string filename = Path.GetFileName (path);193 string filename = Path.GetFileName (path);
188 bool isForbidden = filename == "." || filename == ".." || filename.EndsWith ("~");194 bool isForbidden = filename == "." || filename == ".." || filename.EndsWith ("~");
189 bool isHidden = filename.StartsWith (".");195 bool isHidden = filename.StartsWith (".");
196 if (isDirectory && ignored.Where (folder => path == folder.Path).Any ())
197 isForbidden = true;
190 return !isForbidden && (includeHidden || !isHidden);198 return !isForbidden && (includeHidden || !isHidden);
191 }199 }
192 200
193201
=== modified file 'File/src/Do/Do.FilesAndFolders/IndexedFolder.cs'
--- File/src/Do/Do.FilesAndFolders/IndexedFolder.cs 2009-01-14 18:43:13 +0000
+++ File/src/Do/Do.FilesAndFolders/IndexedFolder.cs 2009-02-14 20:52:23 +0000
@@ -31,18 +31,20 @@
31 {31 {
32 public string Path { get; private set; }32 public string Path { get; private set; }
33 public uint Level { get; private set; }33 public uint Level { get; private set; }
34 public bool Index { get; private set; }
34 35
35 public IndexedFolder (string path, uint level)36 public IndexedFolder (string path, uint level, bool index)
36 {37 {
37 if (path == null) throw new ArgumentNullException ("path");38 if (path == null) throw new ArgumentNullException ("path");
38 39
39 Path = path.Replace ("~", Plugin.ImportantFolders.UserHome);40 Path = path.Replace ("~", Plugin.ImportantFolders.UserHome);
40 Level = level;41 Level = level;
42 Index = index;
41 }43 }
4244
43 public override string ToString ()45 public override string ToString ()
44 {46 {
45 return string.Format ("{0} {2} {1}", GetType ().Name, Path, Level);47 return string.Format ("{0} {2} {1} {3}", GetType ().Name, Path, Level, Index);
46 }48 }
4749
48 public override bool Equals (object other)50 public override bool Equals (object other)
@@ -52,12 +54,12 @@
5254
53 public override int GetHashCode ()55 public override int GetHashCode ()
54 {56 {
55 return Path.GetHashCode () ^ Level.GetHashCode ();57 return Path.GetHashCode () ^ Level.GetHashCode () ^ Index.GetHashCode ();
56 }58 }
5759
58 public bool Equals (IndexedFolder other)60 public bool Equals (IndexedFolder other)
59 {61 {
60 return other.Path == Path && other.Level == Level;62 return other.Path == Path && other.Level == Level && other.Index == Index;
61 }63 }
6264
63 public static bool operator== (IndexedFolder left, IndexedFolder right)65 public static bool operator== (IndexedFolder left, IndexedFolder right)
6466
=== modified file 'File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs'
--- File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs 2009-01-18 20:29:57 +0000
+++ File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs 2009-02-16 01:11:46 +0000
@@ -49,10 +49,10 @@
4949
50 IEnumerable<IndexedFolder> GetDefaultFolders ()50 IEnumerable<IndexedFolder> GetDefaultFolders ()
51 {51 {
52 yield return new IndexedFolder (Path.GetDirectoryName (Plugin.ImportantFolders.UserHome), 1);52 yield return new IndexedFolder (Path.GetDirectoryName (Plugin.ImportantFolders.UserHome), 1, true);
53 yield return new IndexedFolder (Plugin.ImportantFolders.UserHome, 1);53 yield return new IndexedFolder (Plugin.ImportantFolders.UserHome, 1, true);
54 yield return new IndexedFolder (Plugin.ImportantFolders.Desktop, 1);54 yield return new IndexedFolder (Plugin.ImportantFolders.Desktop, 1, true);
55 yield return new IndexedFolder (Plugin.ImportantFolders.Documents, 2);55 yield return new IndexedFolder (Plugin.ImportantFolders.Documents, 2, true);
56 }56 }
5757
58 public IndexedFolderCollection ()58 public IndexedFolderCollection ()
@@ -64,14 +64,16 @@
64 Deserialize ();64 Deserialize ();
6565
66 foreach (IndexedFolder folder in Folders.Values) {66 foreach (IndexedFolder folder in Folders.Values) {
67 if (folder.Level < LargeIndexLevel) continue;67 if (folder.Level > LargeIndexLevel)
68 Log.Warn (LargeIndexLevelWarning, folder.Path, folder.Level);68 Log.Warn (LargeIndexLevelWarning, folder.Path, folder.Level);
69 }69 }
70 }70 }
7171
72 public void UpdateIndexedFolder (string path, string newPath, uint newDepth)72 public void UpdateIndexedFolder (string path, string newPath, uint newDepth, bool newIndex)
73 {73 {
74 UpdateIndexedFolder (path, new IndexedFolder (newPath, newDepth));74 if (newDepth > LargeIndexLevel)
75 Log.Warn (LargeIndexLevelWarning, newPath, newDepth);
76 UpdateIndexedFolder (path, new IndexedFolder (newPath, newDepth, newIndex));
75 }77 }
7678
77 public void UpdateIndexedFolder (string path, IndexedFolder folder)79 public void UpdateIndexedFolder (string path, IndexedFolder folder)
@@ -87,6 +89,11 @@
87 if (!Folders.ContainsKey (path)) return;89 if (!Folders.ContainsKey (path)) return;
88 Remove (Folders [path]);90 Remove (Folders [path]);
89 }91 }
92
93 public bool ContainsFolder (string path)
94 {
95 return Folders.ContainsKey (path);
96 }
9097
91 #region ICollection<IndexedFolder>98 #region ICollection<IndexedFolder>
9299
93100
=== modified file 'File/src/Do/Do.FilesAndFolders/RecentFileItemSource.cs'
--- File/src/Do/Do.FilesAndFolders/RecentFileItemSource.cs 2008-12-23 23:42:53 +0000
+++ File/src/Do/Do.FilesAndFolders/RecentFileItemSource.cs 2009-02-14 20:52:23 +0000
@@ -53,10 +53,14 @@
5353
54 IEnumerable<IFileItem> GetRecentFiles ()54 IEnumerable<IFileItem> GetRecentFiles ()
55 {55 {
56 // These lines always cause mono to blow up:56 /*
57 //foreach (RecentInfo info in RecentManager.Default.Items) {57 These lines always cause mono to blow up:
58 // yield return UniverseFactory.NewFileItem (info.Uri);58
59 //}59 foreach (Gtk.RecentInfo info in Gtk.RecentManager.Default.Items) {
60 Console.WriteLine(info);
61 yield return Services.UniverseFactory.NewFileItem (info.Uri);
62 }
63 */
60 return Enumerable.Empty<IFileItem> ();64 return Enumerable.Empty<IFileItem> ();
61 }65 }
62 66
6367
=== added file 'File/src/IgnorePathNodeView.cs'
--- File/src/IgnorePathNodeView.cs 1970-01-01 00:00:00 +0000
+++ File/src/IgnorePathNodeView.cs 2009-02-17 10:48:05 +0000
@@ -0,0 +1,74 @@
1/* IgnorePathNodeView.cs
2 *
3 * GNOME Do is the legal property of its developers. Please refer to the
4 * COPYRIGHT file distributed with this
5 * source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21using System;
22using Mono.Unix;
23
24using Gtk;
25
26namespace Do.FilesAndFolders
27{
28
29 // TODO: update this class to use spin buttons,
30 public class IgnorePathNodeView : PathNodeView
31 {
32 public enum Column {
33 Path = 0,
34 Index,
35 NumColumns
36 }
37
38 public IgnorePathNodeView () : base ()
39 {
40 CellRenderer cell;
41 RulesHint = true;
42 HeadersVisible = true;
43
44 Model = new ListStore (typeof (string), typeof (bool));
45
46 cell = new CellRendererText ();
47 (cell as CellRendererText).Width = 310;
48 (cell as CellRendererText).Ellipsize = Pango.EllipsizeMode.Middle;
49 AppendColumn (Catalog.GetString ("Folder"), cell, "text", Column.Path);
50
51 Refresh ();
52 }
53
54 public override void Refresh ()
55 {
56 ListStore store = Model as ListStore;
57 //try to keep the currently selected row across refreshes
58 Gtk.TreePath selected = null;
59 try {
60 selected = this.Selection.GetSelectedRows ()[0];
61 }
62 catch { }
63 finally {
64 store.Clear ();
65 foreach (IndexedFolder pair in Plugin.FolderIndex) {
66 if (!pair.Index)
67 store.AppendValues (pair.Path, pair.Index);
68 }
69 if (selected != null)
70 this.Selection.SelectPath (selected);
71 }
72 }
73 }
74}
0\ No newline at end of file75\ No newline at end of file
176
=== added file 'File/src/IndexPathNodeView.cs'
--- File/src/IndexPathNodeView.cs 1970-01-01 00:00:00 +0000
+++ File/src/IndexPathNodeView.cs 2009-02-17 10:48:05 +0000
@@ -0,0 +1,97 @@
1/* IndexPathNodeView.cs
2 *
3 * GNOME Do is the legal property of its developers. Please refer to the
4 * COPYRIGHT file distributed with this
5 * source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21using System;
22using Mono.Unix;
23
24using Gtk;
25
26namespace Do.FilesAndFolders
27{
28
29 // TODO: update this class to use spin buttons,
30 public class IndexPathNodeView : PathNodeView
31 {
32 public enum Column {
33 Path = 0,
34 Depth,
35 NumColumns
36 }
37
38 public IndexPathNodeView () : base ()
39 {
40 CellRenderer cell;
41 RulesHint = true;
42 HeadersVisible = true;
43
44 Model = new ListStore (typeof (string), typeof (uint));
45
46 cell = new CellRendererText ();
47 (cell as CellRendererText).Width = 310;
48 (cell as CellRendererText).Ellipsize = Pango.EllipsizeMode.Middle;
49 AppendColumn (Catalog.GetString ("Folder"), cell, "text", Column.Path);
50
51 cell = new CellRendererText ();
52 (cell as CellRendererText).Editable = true;
53 (cell as CellRendererText).Edited += OnDepthEdited;
54 (cell as CellRendererText).Alignment = Pango.Alignment.Right;
55 AppendColumn (Catalog.GetString ("Depth"), cell, "text", Column.Depth);
56
57 Refresh ();
58 }
59
60 public override void Refresh ()
61 {
62 ListStore store = Model as ListStore;
63 //try to keep the currently selected row across refreshes
64 Gtk.TreePath selected = null;
65 try {
66 selected = this.Selection.GetSelectedRows ()[0];
67 }
68 catch { }
69 finally {
70 store.Clear ();
71 foreach (IndexedFolder pair in Plugin.FolderIndex) {
72 if (pair.Index)
73 store.AppendValues ( pair.Path, pair.Level);
74 }
75 if (selected != null)
76 this.Selection.SelectPath (selected);
77 }
78 }
79
80 public void OnDepthEdited (object o, EditedArgs e)
81 {
82 uint depth;
83 string path;
84 TreeIter iter;
85 ListStore store;
86
87 store = Model as ListStore;
88 store.GetIter (out iter, new TreePath (e.Path));
89
90 path = store.GetValue (iter, (int) Column.Path) as string;
91 depth = uint.Parse (e.NewText);
92 Plugin.FolderIndex.UpdateIndexedFolder (path, path, depth, true);
93
94 Refresh ();
95 }
96 }
97}
0\ No newline at end of file98\ No newline at end of file
199
=== modified file 'File/src/PathNodeView.cs'
--- File/src/PathNodeView.cs 2009-01-14 19:27:04 +0000
+++ File/src/PathNodeView.cs 2009-02-16 01:11:46 +0000
@@ -19,8 +19,6 @@
19 */19 */
2020
21using System;21using System;
22using System.IO;
23
24using Mono.Unix;22using Mono.Unix;
2523
26using Gtk;24using Gtk;
@@ -29,61 +27,17 @@
29{27{
30 28
31 // TODO: update this class to use spin buttons,29 // TODO: update this class to use spin buttons,
32 public class PathNodeView : NodeView30 public abstract class PathNodeView : NodeView
33 {31 {
34 enum Column {32
35 Path = 0,
36 Depth,
37 NumColumns
38 }
39 33
40 public PathNodeView () : base ()34 public PathNodeView () : base ()
41 {35 {
42 CellRenderer cell;36 }
43 RulesHint = true;37
44 HeadersVisible = true;38 public abstract void Refresh ();
45 39
46 Model = new ListStore (typeof (string), typeof (uint));40 public virtual void OnRemoveSelected (object sender, EventArgs e)
47
48 cell = new CellRendererText ();
49 (cell as CellRendererText).Width = 310;
50 (cell as CellRendererText).Ellipsize = Pango.EllipsizeMode.Middle;
51 AppendColumn (Catalog.GetString ("Folder"), cell, "text", Column.Path);
52
53 cell = new CellRendererText ();
54 (cell as CellRendererText).Editable = true;
55 (cell as CellRendererText).Edited += OnDepthEdited;
56 (cell as CellRendererText).Alignment = Pango.Alignment.Right;
57 AppendColumn (Catalog.GetString ("Depth"), cell, "text", Column.Depth);
58
59 Refresh ();
60 }
61
62 public void Refresh ()
63 {
64 ListStore store = Model as ListStore;
65 store.Clear ();
66 foreach (IndexedFolder pair in Plugin.FolderIndex)
67 store.AppendValues (pair.Path, pair.Level);
68 }
69
70 void OnDepthEdited (object o, EditedArgs e)
71 {
72 uint depth;
73 string path;
74 TreeIter iter;
75 ListStore store;
76
77 store = Model as ListStore;
78 store.GetIter (out iter, new TreePath (e.Path));
79 path = store.GetValue (iter, (int)Column.Path) as string;
80 depth = uint.Parse (e.NewText);
81 Plugin.FolderIndex.UpdateIndexedFolder (path, path, depth);
82
83 Refresh ();
84 }
85
86 public void OnRemoveSelected (object sender, EventArgs e)
87 {41 {
88 string path;42 string path;
89 TreeIter iter;43 TreeIter iter;
@@ -91,7 +45,7 @@
9145
92 store = Model as ListStore;46 store = Model as ListStore;
93 Selection.GetSelected (out iter);47 Selection.GetSelected (out iter);
94 path = store.GetValue (iter, (int)Column.Path) as string;48 path = store.GetValue (iter, 0) as string;
95 Plugin.FolderIndex.RemoveIndexedFolder (path);49 Plugin.FolderIndex.RemoveIndexedFolder (path);
96 store.Remove (ref iter);50 store.Remove (ref iter);
97 51

Subscribers

People subscribed via source and target branches