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

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

Description of the change

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

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

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

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

Unmerged revisions

754. By MShepanski

Add option to filter files by an extensions list

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'File/gtk-gui/Do.FilesAndFolders.Configuration.cs'
--- File/gtk-gui/Do.FilesAndFolders.Configuration.cs 2009-06-23 00:52:54 +0000
+++ File/gtk-gui/Do.FilesAndFolders.Configuration.cs 2012-02-20 22:25:22 +0000
@@ -1,333 +1,312 @@
1// ------------------------------------------------------------------------------
2// <autogenerated>
3// This code was generated by a tool.
4//
5//
6// Changes to this file may cause incorrect behavior and will be lost if
7// the code is regenerated.
8// </autogenerated>
9// ------------------------------------------------------------------------------
101
11namespace Do.FilesAndFolders {2// This file has been generated by the GUI designer. Do not modify.
12 3namespace Do.FilesAndFolders
13 4{
14 public partial class Configuration {5 public partial class Configuration
15 6 {
16 private Gtk.Alignment alignment1;7 private global::Gtk.Alignment alignment1;
17 8 private global::Gtk.VBox vbox2;
18 private Gtk.VBox vbox2;9 private global::Gtk.VBox vbox1;
19 10 private global::Gtk.Notebook notebook1;
20 private Gtk.VBox vbox1;11 private global::Gtk.VBox vbox4;
21 12 private global::Gtk.Alignment alignment3;
22 private Gtk.Notebook notebook1;13 private global::Gtk.VBox vbox6;
23 14 private global::Gtk.ScrolledWindow index_node_scroll;
24 private Gtk.VBox vbox4;15 private global::Gtk.HBox hbox1;
25 16 private global::Gtk.Label ExtensionsHelp;
26 private Gtk.Alignment alignment3;17 private global::Gtk.HButtonBox hbuttonbox2;
27 18 private global::Gtk.Button index_remove_btn;
28 private Gtk.VBox vbox6;19 private global::Gtk.Button index_add_btn;
29 20 private global::Gtk.CheckButton show_hidden_chk;
30 private Gtk.ScrolledWindow index_node_scroll;21 private global::Gtk.Label label1;
31 22 private global::Gtk.VBox vbox5;
32 private Gtk.HBox hbox1;23 private global::Gtk.Alignment alignment2;
33 24 private global::Gtk.VBox vbox3;
34 private Gtk.Label IndexLabel;25 private global::Gtk.ScrolledWindow ignore_node_scroll;
35 26 private global::Gtk.HBox hbox3;
36 private Gtk.HButtonBox hbuttonbox2;27 private global::Gtk.Label IgnoreLabel;
37 28 private global::Gtk.HButtonBox hbuttonbox3;
38 private Gtk.Button index_remove_btn;29 private global::Gtk.Button ignore_remove_btn;
39 30 private global::Gtk.Button ignore_add_btn;
40 private Gtk.Button index_add_btn;31 private global::Gtk.Label label2;
41 32
42 private Gtk.CheckButton show_hidden_chk;33 protected virtual void Build ()
43 34 {
44 private Gtk.Label label1;35 global::Stetic.Gui.Initialize (this);
45 36 // Widget Do.FilesAndFolders.Configuration
46 private Gtk.VBox vbox5;37 global::Stetic.BinContainer.Attach (this);
47 38 this.WidthRequest = 630;
48 private Gtk.Alignment alignment2;39 this.Name = "Do.FilesAndFolders.Configuration";
49 40 // Container child Do.FilesAndFolders.Configuration.Gtk.Container+ContainerChild
50 private Gtk.VBox vbox3;41 this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
51 42 this.alignment1.Name = "alignment1";
52 private Gtk.ScrolledWindow ignore_node_scroll;43 this.alignment1.BorderWidth = ((uint)(8));
53 44 // Container child alignment1.Gtk.Container+ContainerChild
54 private Gtk.HBox hbox3;45 this.vbox2 = new global::Gtk.VBox ();
55 46 this.vbox2.Name = "vbox2";
56 private Gtk.Label IgnoreLabel;47 this.vbox2.Spacing = 6;
57 48 // Container child vbox2.Gtk.Box+BoxChild
58 private Gtk.HButtonBox hbuttonbox3;49 this.vbox1 = new global::Gtk.VBox ();
59 50 this.vbox1.Name = "vbox1";
60 private Gtk.Button ignore_remove_btn;51 this.vbox1.Spacing = 6;
61 52 // Container child vbox1.Gtk.Box+BoxChild
62 private Gtk.Button ignore_add_btn;53 this.notebook1 = new global::Gtk.Notebook ();
63 54 this.notebook1.HeightRequest = 270;
64 private Gtk.Label label2;55 this.notebook1.CanFocus = true;
65 56 this.notebook1.Name = "notebook1";
66 protected virtual void Build() {57 this.notebook1.CurrentPage = 0;
67 Stetic.Gui.Initialize(this);58 this.notebook1.ShowBorder = false;
68 // Widget Do.FilesAndFolders.Configuration59 // Container child notebook1.Gtk.Notebook+NotebookChild
69 Stetic.BinContainer.Attach(this);60 this.vbox4 = new global::Gtk.VBox ();
70 this.Name = "Do.FilesAndFolders.Configuration";61 this.vbox4.Name = "vbox4";
71 // Container child Do.FilesAndFolders.Configuration.Gtk.Container+ContainerChild62 this.vbox4.Spacing = 6;
72 this.alignment1 = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);63 // Container child vbox4.Gtk.Box+BoxChild
73 this.alignment1.Name = "alignment1";64 this.alignment3 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
74 this.alignment1.BorderWidth = ((uint)(8));65 this.alignment3.Name = "alignment3";
75 // Container child alignment1.Gtk.Container+ContainerChild66 this.alignment3.LeftPadding = ((uint)(8));
76 this.vbox2 = new Gtk.VBox();67 this.alignment3.TopPadding = ((uint)(8));
77 this.vbox2.Name = "vbox2";68 this.alignment3.RightPadding = ((uint)(8));
78 this.vbox2.Spacing = 6;69 this.alignment3.BottomPadding = ((uint)(8));
79 // Container child vbox2.Gtk.Box+BoxChild70 // Container child alignment3.Gtk.Container+ContainerChild
80 this.vbox1 = new Gtk.VBox();71 this.vbox6 = new global::Gtk.VBox ();
81 this.vbox1.Name = "vbox1";72 this.vbox6.Name = "vbox6";
82 this.vbox1.Spacing = 6;73 this.vbox6.Spacing = 6;
83 // Container child vbox1.Gtk.Box+BoxChild74 // Container child vbox6.Gtk.Box+BoxChild
84 this.notebook1 = new Gtk.Notebook();75 this.index_node_scroll = new global::Gtk.ScrolledWindow ();
85 this.notebook1.HeightRequest = 270;76 this.index_node_scroll.CanFocus = true;
86 this.notebook1.CanFocus = true;77 this.index_node_scroll.Name = "index_node_scroll";
87 this.notebook1.Name = "notebook1";78 this.index_node_scroll.ShadowType = ((global::Gtk.ShadowType)(1));
88 this.notebook1.CurrentPage = 0;79 this.vbox6.Add (this.index_node_scroll);
89 this.notebook1.ShowBorder = false;80 global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.index_node_scroll]));
90 // Container child notebook1.Gtk.Notebook+NotebookChild81 w1.Position = 0;
91 this.vbox4 = new Gtk.VBox();82 // Container child vbox6.Gtk.Box+BoxChild
92 this.vbox4.Name = "vbox4";83 this.hbox1 = new global::Gtk.HBox ();
93 this.vbox4.Spacing = 6;84 this.hbox1.Name = "hbox1";
94 // Container child vbox4.Gtk.Box+BoxChild85 this.hbox1.Spacing = 6;
95 this.alignment3 = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);86 // Container child hbox1.Gtk.Box+BoxChild
96 this.alignment3.Name = "alignment3";87 this.ExtensionsHelp = new global::Gtk.Label ();
97 this.alignment3.LeftPadding = ((uint)(8));88 this.ExtensionsHelp.WidthRequest = 410;
98 this.alignment3.TopPadding = ((uint)(8));89 this.ExtensionsHelp.HeightRequest = 30;
99 this.alignment3.RightPadding = ((uint)(8));90 this.ExtensionsHelp.Name = "ExtensionsHelp";
100 this.alignment3.BottomPadding = ((uint)(8));91 this.ExtensionsHelp.Xpad = 8;
101 // Container child alignment3.Gtk.Container+ContainerChild92 this.ExtensionsHelp.Xalign = 0F;
102 this.vbox6 = new Gtk.VBox();93 this.ExtensionsHelp.LabelProp = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Leave extensions blank to index all files. Use a comma seperated\nlist to index only those items. Example: gif,jpg,png\n\n");
103 this.vbox6.Name = "vbox6";94 this.ExtensionsHelp.UseMarkup = true;
104 this.vbox6.Spacing = 6;95 this.ExtensionsHelp.Wrap = true;
105 // Container child vbox6.Gtk.Box+BoxChild96 this.ExtensionsHelp.Justify = ((global::Gtk.Justification)(3));
106 this.index_node_scroll = new Gtk.ScrolledWindow();97 this.hbox1.Add (this.ExtensionsHelp);
107 this.index_node_scroll.CanFocus = true;98 global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.ExtensionsHelp]));
108 this.index_node_scroll.Name = "index_node_scroll";99 w2.Position = 0;
109 this.index_node_scroll.ShadowType = ((Gtk.ShadowType)(1));100 w2.Expand = false;
110 this.vbox6.Add(this.index_node_scroll);101 w2.Fill = false;
111 Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox6[this.index_node_scroll]));102 // Container child hbox1.Gtk.Box+BoxChild
112 w1.Position = 0;103 this.hbuttonbox2 = new global::Gtk.HButtonBox ();
113 // Container child vbox6.Gtk.Box+BoxChild104 this.hbuttonbox2.Name = "hbuttonbox2";
114 this.hbox1 = new Gtk.HBox();105 // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
115 this.hbox1.Name = "hbox1";106 this.index_remove_btn = new global::Gtk.Button ();
116 this.hbox1.Spacing = 6;107 this.index_remove_btn.CanFocus = true;
117 // Container child hbox1.Gtk.Box+BoxChild108 this.index_remove_btn.Name = "index_remove_btn";
118 this.IndexLabel = new Gtk.Label();109 this.index_remove_btn.UseUnderline = true;
119 this.IndexLabel.Name = "IndexLabel";110 // Container child index_remove_btn.Gtk.Container+ContainerChild
120 this.hbox1.Add(this.IndexLabel);111 global::Gtk.Alignment w3 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
121 Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.IndexLabel]));112 // Container child GtkAlignment.Gtk.Container+ContainerChild
122 w2.Position = 0;113 global::Gtk.HBox w4 = new global::Gtk.HBox ();
123 // Container child hbox1.Gtk.Box+BoxChild114 w4.Spacing = 2;
124 this.hbuttonbox2 = new Gtk.HButtonBox();115 // Container child GtkHBox.Gtk.Container+ContainerChild
125 this.hbuttonbox2.Name = "hbuttonbox2";116 global::Gtk.Image w5 = new global::Gtk.Image ();
126 // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild117 w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Button);
127 this.index_remove_btn = new Gtk.Button();118 w4.Add (w5);
128 this.index_remove_btn.CanFocus = true;119 // Container child GtkHBox.Gtk.Container+ContainerChild
129 this.index_remove_btn.Name = "index_remove_btn";120 global::Gtk.Label w7 = new global::Gtk.Label ();
130 this.index_remove_btn.UseUnderline = true;121 w4.Add (w7);
131 // Container child index_remove_btn.Gtk.Container+ContainerChild122 w3.Add (w4);
132 Gtk.Alignment w3 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);123 this.index_remove_btn.Add (w3);
133 // Container child GtkAlignment.Gtk.Container+ContainerChild124 this.hbuttonbox2.Add (this.index_remove_btn);
134 Gtk.HBox w4 = new Gtk.HBox();125 global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.index_remove_btn]));
135 w4.Spacing = 2;126 w11.Expand = false;
136 // Container child GtkHBox.Gtk.Container+ContainerChild127 w11.Fill = false;
137 Gtk.Image w5 = new Gtk.Image();128 // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
138 w5.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-remove", Gtk.IconSize.Button, 16);129 this.index_add_btn = new global::Gtk.Button ();
139 w4.Add(w5);130 this.index_add_btn.CanFocus = true;
140 // Container child GtkHBox.Gtk.Container+ContainerChild131 this.index_add_btn.Name = "index_add_btn";
141 Gtk.Label w7 = new Gtk.Label();132 this.index_add_btn.UseUnderline = true;
142 w4.Add(w7);133 // Container child index_add_btn.Gtk.Container+ContainerChild
143 w3.Add(w4);134 global::Gtk.Alignment w12 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
144 this.index_remove_btn.Add(w3);135 // Container child GtkAlignment.Gtk.Container+ContainerChild
145 this.hbuttonbox2.Add(this.index_remove_btn);136 global::Gtk.HBox w13 = new global::Gtk.HBox ();
146 Gtk.ButtonBox.ButtonBoxChild w11 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.index_remove_btn]));137 w13.Spacing = 2;
147 w11.Expand = false;138 // Container child GtkHBox.Gtk.Container+ContainerChild
148 w11.Fill = false;139 global::Gtk.Image w14 = new global::Gtk.Image ();
149 // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild140 w14.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu);
150 this.index_add_btn = new Gtk.Button();141 w13.Add (w14);
151 this.index_add_btn.CanFocus = true;142 // Container child GtkHBox.Gtk.Container+ContainerChild
152 this.index_add_btn.Name = "index_add_btn";143 global::Gtk.Label w16 = new global::Gtk.Label ();
153 this.index_add_btn.UseUnderline = true;144 w13.Add (w16);
154 // Container child index_add_btn.Gtk.Container+ContainerChild145 w12.Add (w13);
155 Gtk.Alignment w12 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);146 this.index_add_btn.Add (w12);
156 // Container child GtkAlignment.Gtk.Container+ContainerChild147 this.hbuttonbox2.Add (this.index_add_btn);
157 Gtk.HBox w13 = new Gtk.HBox();148 global::Gtk.ButtonBox.ButtonBoxChild w20 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.index_add_btn]));
158 w13.Spacing = 2;149 w20.Position = 1;
159 // Container child GtkHBox.Gtk.Container+ContainerChild150 w20.Expand = false;
160 Gtk.Image w14 = new Gtk.Image();151 w20.Fill = false;
161 w14.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Menu, 16);152 this.hbox1.Add (this.hbuttonbox2);
162 w13.Add(w14);153 global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hbuttonbox2]));
163 // Container child GtkHBox.Gtk.Container+ContainerChild154 w21.Position = 1;
164 Gtk.Label w16 = new Gtk.Label();155 w21.Expand = false;
165 w13.Add(w16);156 this.vbox6.Add (this.hbox1);
166 w12.Add(w13);157 global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.hbox1]));
167 this.index_add_btn.Add(w12);158 w22.Position = 1;
168 this.hbuttonbox2.Add(this.index_add_btn);159 w22.Expand = false;
169 Gtk.ButtonBox.ButtonBoxChild w20 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.index_add_btn]));160 w22.Fill = false;
170 w20.Position = 1;161 // Container child vbox6.Gtk.Box+BoxChild
171 w20.Expand = false;162 this.show_hidden_chk = new global::Gtk.CheckButton ();
172 w20.Fill = false;163 this.show_hidden_chk.CanFocus = true;
173 this.hbox1.Add(this.hbuttonbox2);164 this.show_hidden_chk.Name = "show_hidden_chk";
174 Gtk.Box.BoxChild w21 = ((Gtk.Box.BoxChild)(this.hbox1[this.hbuttonbox2]));165 this.show_hidden_chk.Label = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Show hidden files");
175 w21.Position = 1;166 this.show_hidden_chk.DrawIndicator = true;
176 w21.Expand = false;167 this.show_hidden_chk.UseUnderline = true;
177 this.vbox6.Add(this.hbox1);168 this.show_hidden_chk.BorderWidth = ((uint)(5));
178 Gtk.Box.BoxChild w22 = ((Gtk.Box.BoxChild)(this.vbox6[this.hbox1]));169 this.vbox6.Add (this.show_hidden_chk);
179 w22.Position = 1;170 global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.show_hidden_chk]));
180 w22.Expand = false;171 w23.Position = 2;
181 w22.Fill = false;172 w23.Expand = false;
182 // Container child vbox6.Gtk.Box+BoxChild173 w23.Fill = false;
183 this.show_hidden_chk = new Gtk.CheckButton();174 this.alignment3.Add (this.vbox6);
184 this.show_hidden_chk.CanFocus = true;175 this.vbox4.Add (this.alignment3);
185 this.show_hidden_chk.Name = "show_hidden_chk";176 global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.alignment3]));
186 this.show_hidden_chk.Label = Mono.Addins.AddinManager.CurrentLocalizer.GetString("Show hidden files");177 w25.Position = 0;
187 this.show_hidden_chk.DrawIndicator = true;178 this.notebook1.Add (this.vbox4);
188 this.show_hidden_chk.UseUnderline = true;179 // Notebook tab
189 this.show_hidden_chk.BorderWidth = ((uint)(5));180 this.label1 = new global::Gtk.Label ();
190 this.vbox6.Add(this.show_hidden_chk);181 this.label1.Name = "label1";
191 Gtk.Box.BoxChild w23 = ((Gtk.Box.BoxChild)(this.vbox6[this.show_hidden_chk]));182 this.label1.LabelProp = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Indexed Folders");
192 w23.Position = 2;183 this.notebook1.SetTabLabel (this.vbox4, this.label1);
193 w23.Expand = false;184 this.label1.ShowAll ();
194 w23.Fill = false;185 // Container child notebook1.Gtk.Notebook+NotebookChild
195 this.alignment3.Add(this.vbox6);186 this.vbox5 = new global::Gtk.VBox ();
196 this.vbox4.Add(this.alignment3);187 this.vbox5.Name = "vbox5";
197 Gtk.Box.BoxChild w25 = ((Gtk.Box.BoxChild)(this.vbox4[this.alignment3]));188 this.vbox5.Spacing = 6;
198 w25.Position = 0;189 // Container child vbox5.Gtk.Box+BoxChild
199 this.notebook1.Add(this.vbox4);190 this.alignment2 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
200 // Notebook tab191 this.alignment2.Name = "alignment2";
201 this.label1 = new Gtk.Label();192 this.alignment2.LeftPadding = ((uint)(8));
202 this.label1.Name = "label1";193 this.alignment2.TopPadding = ((uint)(8));
203 this.label1.LabelProp = Mono.Addins.AddinManager.CurrentLocalizer.GetString("Indexed Folders");194 this.alignment2.RightPadding = ((uint)(8));
204 this.notebook1.SetTabLabel(this.vbox4, this.label1);195 this.alignment2.BottomPadding = ((uint)(8));
205 this.label1.ShowAll();196 // Container child alignment2.Gtk.Container+ContainerChild
206 // Container child notebook1.Gtk.Notebook+NotebookChild197 this.vbox3 = new global::Gtk.VBox ();
207 this.vbox5 = new Gtk.VBox();198 this.vbox3.Name = "vbox3";
208 this.vbox5.Name = "vbox5";199 this.vbox3.Spacing = 6;
209 this.vbox5.Spacing = 6;200 // Container child vbox3.Gtk.Box+BoxChild
210 // Container child vbox5.Gtk.Box+BoxChild201 this.ignore_node_scroll = new global::Gtk.ScrolledWindow ();
211 this.alignment2 = new Gtk.Alignment(0.5F, 0.5F, 1F, 1F);202 this.ignore_node_scroll.CanFocus = true;
212 this.alignment2.Name = "alignment2";203 this.ignore_node_scroll.Name = "ignore_node_scroll";
213 this.alignment2.LeftPadding = ((uint)(8));204 this.ignore_node_scroll.ShadowType = ((global::Gtk.ShadowType)(1));
214 this.alignment2.TopPadding = ((uint)(8));205 this.vbox3.Add (this.ignore_node_scroll);
215 this.alignment2.RightPadding = ((uint)(8));206 global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.ignore_node_scroll]));
216 this.alignment2.BottomPadding = ((uint)(8));207 w27.Position = 0;
217 // Container child alignment2.Gtk.Container+ContainerChild208 // Container child vbox3.Gtk.Box+BoxChild
218 this.vbox3 = new Gtk.VBox();209 this.hbox3 = new global::Gtk.HBox ();
219 this.vbox3.Name = "vbox3";210 this.hbox3.Name = "hbox3";
220 this.vbox3.Spacing = 6;211 this.hbox3.Spacing = 6;
221 // Container child vbox3.Gtk.Box+BoxChild212 // Container child hbox3.Gtk.Box+BoxChild
222 this.ignore_node_scroll = new Gtk.ScrolledWindow();213 this.IgnoreLabel = new global::Gtk.Label ();
223 this.ignore_node_scroll.CanFocus = true;214 this.IgnoreLabel.Name = "IgnoreLabel";
224 this.ignore_node_scroll.Name = "ignore_node_scroll";215 this.hbox3.Add (this.IgnoreLabel);
225 this.ignore_node_scroll.ShadowType = ((Gtk.ShadowType)(1));216 global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.IgnoreLabel]));
226 this.vbox3.Add(this.ignore_node_scroll);217 w28.Position = 0;
227 Gtk.Box.BoxChild w27 = ((Gtk.Box.BoxChild)(this.vbox3[this.ignore_node_scroll]));218 w28.Fill = false;
228 w27.Position = 0;219 // Container child hbox3.Gtk.Box+BoxChild
229 // Container child vbox3.Gtk.Box+BoxChild220 this.hbuttonbox3 = new global::Gtk.HButtonBox ();
230 this.hbox3 = new Gtk.HBox();221 this.hbuttonbox3.Name = "hbuttonbox3";
231 this.hbox3.Name = "hbox3";222 // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild
232 this.hbox3.Spacing = 6;223 this.ignore_remove_btn = new global::Gtk.Button ();
233 // Container child hbox3.Gtk.Box+BoxChild224 this.ignore_remove_btn.CanFocus = true;
234 this.IgnoreLabel = new Gtk.Label();225 this.ignore_remove_btn.Name = "ignore_remove_btn";
235 this.IgnoreLabel.Name = "IgnoreLabel";226 this.ignore_remove_btn.UseUnderline = true;
236 this.hbox3.Add(this.IgnoreLabel);227 // Container child ignore_remove_btn.Gtk.Container+ContainerChild
237 Gtk.Box.BoxChild w28 = ((Gtk.Box.BoxChild)(this.hbox3[this.IgnoreLabel]));228 global::Gtk.Alignment w29 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
238 w28.Position = 0;229 // Container child GtkAlignment.Gtk.Container+ContainerChild
239 w28.Fill = false;230 global::Gtk.HBox w30 = new global::Gtk.HBox ();
240 // Container child hbox3.Gtk.Box+BoxChild231 w30.Spacing = 2;
241 this.hbuttonbox3 = new Gtk.HButtonBox();232 // Container child GtkHBox.Gtk.Container+ContainerChild
242 this.hbuttonbox3.Name = "hbuttonbox3";233 global::Gtk.Image w31 = new global::Gtk.Image ();
243 // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild234 w31.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Button);
244 this.ignore_remove_btn = new Gtk.Button();235 w30.Add (w31);
245 this.ignore_remove_btn.CanFocus = true;236 // Container child GtkHBox.Gtk.Container+ContainerChild
246 this.ignore_remove_btn.Name = "ignore_remove_btn";237 global::Gtk.Label w33 = new global::Gtk.Label ();
247 this.ignore_remove_btn.UseUnderline = true;238 w30.Add (w33);
248 // Container child ignore_remove_btn.Gtk.Container+ContainerChild239 w29.Add (w30);
249 Gtk.Alignment w29 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);240 this.ignore_remove_btn.Add (w29);
250 // Container child GtkAlignment.Gtk.Container+ContainerChild241 this.hbuttonbox3.Add (this.ignore_remove_btn);
251 Gtk.HBox w30 = new Gtk.HBox();242 global::Gtk.ButtonBox.ButtonBoxChild w37 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3 [this.ignore_remove_btn]));
252 w30.Spacing = 2;243 w37.Expand = false;
253 // Container child GtkHBox.Gtk.Container+ContainerChild244 w37.Fill = false;
254 Gtk.Image w31 = new Gtk.Image();245 w37.Padding = ((uint)(5));
255 w31.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-remove", Gtk.IconSize.Button, 16);246 // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild
256 w30.Add(w31);247 this.ignore_add_btn = new global::Gtk.Button ();
257 // Container child GtkHBox.Gtk.Container+ContainerChild248 this.ignore_add_btn.CanFocus = true;
258 Gtk.Label w33 = new Gtk.Label();249 this.ignore_add_btn.Name = "ignore_add_btn";
259 w30.Add(w33);250 this.ignore_add_btn.UseUnderline = true;
260 w29.Add(w30);251 // Container child ignore_add_btn.Gtk.Container+ContainerChild
261 this.ignore_remove_btn.Add(w29);252 global::Gtk.Alignment w38 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
262 this.hbuttonbox3.Add(this.ignore_remove_btn);253 // Container child GtkAlignment.Gtk.Container+ContainerChild
263 Gtk.ButtonBox.ButtonBoxChild w37 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3[this.ignore_remove_btn]));254 global::Gtk.HBox w39 = new global::Gtk.HBox ();
264 w37.Expand = false;255 w39.Spacing = 2;
265 w37.Fill = false;256 // Container child GtkHBox.Gtk.Container+ContainerChild
266 w37.Padding = ((uint)(5));257 global::Gtk.Image w40 = new global::Gtk.Image ();
267 // Container child hbuttonbox3.Gtk.ButtonBox+ButtonBoxChild258 w40.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu);
268 this.ignore_add_btn = new Gtk.Button();259 w39.Add (w40);
269 this.ignore_add_btn.CanFocus = true;260 // Container child GtkHBox.Gtk.Container+ContainerChild
270 this.ignore_add_btn.Name = "ignore_add_btn";261 global::Gtk.Label w42 = new global::Gtk.Label ();
271 this.ignore_add_btn.UseUnderline = true;262 w39.Add (w42);
272 // Container child ignore_add_btn.Gtk.Container+ContainerChild263 w38.Add (w39);
273 Gtk.Alignment w38 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);264 this.ignore_add_btn.Add (w38);
274 // Container child GtkAlignment.Gtk.Container+ContainerChild265 this.hbuttonbox3.Add (this.ignore_add_btn);
275 Gtk.HBox w39 = new Gtk.HBox();266 global::Gtk.ButtonBox.ButtonBoxChild w46 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3 [this.ignore_add_btn]));
276 w39.Spacing = 2;267 w46.Position = 1;
277 // Container child GtkHBox.Gtk.Container+ContainerChild268 w46.Expand = false;
278 Gtk.Image w40 = new Gtk.Image();269 w46.Fill = false;
279 w40.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Menu, 16);270 w46.Padding = ((uint)(5));
280 w39.Add(w40);271 this.hbox3.Add (this.hbuttonbox3);
281 // Container child GtkHBox.Gtk.Container+ContainerChild272 global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.hbuttonbox3]));
282 Gtk.Label w42 = new Gtk.Label();273 w47.Position = 1;
283 w39.Add(w42);274 w47.Expand = false;
284 w38.Add(w39);275 this.vbox3.Add (this.hbox3);
285 this.ignore_add_btn.Add(w38);276 global::Gtk.Box.BoxChild w48 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox3]));
286 this.hbuttonbox3.Add(this.ignore_add_btn);277 w48.Position = 1;
287 Gtk.ButtonBox.ButtonBoxChild w46 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox3[this.ignore_add_btn]));278 w48.Expand = false;
288 w46.Position = 1;279 w48.Fill = false;
289 w46.Expand = false;280 this.alignment2.Add (this.vbox3);
290 w46.Fill = false;281 this.vbox5.Add (this.alignment2);
291 w46.Padding = ((uint)(5));282 global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.alignment2]));
292 this.hbox3.Add(this.hbuttonbox3);283 w50.Position = 0;
293 Gtk.Box.BoxChild w47 = ((Gtk.Box.BoxChild)(this.hbox3[this.hbuttonbox3]));284 this.notebook1.Add (this.vbox5);
294 w47.Position = 1;285 global::Gtk.Notebook.NotebookChild w51 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox5]));
295 w47.Expand = false;286 w51.Position = 1;
296 this.vbox3.Add(this.hbox3);287 // Notebook tab
297 Gtk.Box.BoxChild w48 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox3]));288 this.label2 = new global::Gtk.Label ();
298 w48.Position = 1;289 this.label2.Name = "label2";
299 w48.Expand = false;290 this.label2.LabelProp = global::Mono.Addins.AddinManager.CurrentLocalizer.GetString ("Ignored Folders");
300 w48.Fill = false;291 this.notebook1.SetTabLabel (this.vbox5, this.label2);
301 this.alignment2.Add(this.vbox3);292 this.label2.ShowAll ();
302 this.vbox5.Add(this.alignment2);293 this.vbox1.Add (this.notebook1);
303 Gtk.Box.BoxChild w50 = ((Gtk.Box.BoxChild)(this.vbox5[this.alignment2]));294 global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.notebook1]));
304 w50.Position = 0;295 w52.Position = 0;
305 this.notebook1.Add(this.vbox5);296 this.vbox2.Add (this.vbox1);
306 Gtk.Notebook.NotebookChild w51 = ((Gtk.Notebook.NotebookChild)(this.notebook1[this.vbox5]));297 global::Gtk.Box.BoxChild w53 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.vbox1]));
307 w51.Position = 1;298 w53.Position = 0;
308 // Notebook tab299 this.alignment1.Add (this.vbox2);
309 this.label2 = new Gtk.Label();300 this.Add (this.alignment1);
310 this.label2.Name = "label2";301 if ((this.Child != null)) {
311 this.label2.LabelProp = Mono.Addins.AddinManager.CurrentLocalizer.GetString("Ignored Folders");302 this.Child.ShowAll ();
312 this.notebook1.SetTabLabel(this.vbox5, this.label2);303 }
313 this.label2.ShowAll();304 this.Show ();
314 this.vbox1.Add(this.notebook1);305 this.index_remove_btn.Clicked += new global::System.EventHandler (this.OnRemoveBtnClicked);
315 Gtk.Box.BoxChild w52 = ((Gtk.Box.BoxChild)(this.vbox1[this.notebook1]));306 this.index_add_btn.Clicked += new global::System.EventHandler (this.OnAddBtnClicked);
316 w52.Position = 0;307 this.show_hidden_chk.Clicked += new global::System.EventHandler (this.OnShowHiddenChkClicked);
317 this.vbox2.Add(this.vbox1);308 this.ignore_remove_btn.Clicked += new global::System.EventHandler (this.OnRemoveBtnClicked);
318 Gtk.Box.BoxChild w53 = ((Gtk.Box.BoxChild)(this.vbox2[this.vbox1]));309 this.ignore_add_btn.Clicked += new global::System.EventHandler (this.OnAddBtnClicked);
319 w53.Position = 0;310 }
320 this.alignment1.Add(this.vbox2);311 }
321 this.Add(this.alignment1);
322 if ((this.Child != null)) {
323 this.Child.ShowAll();
324 }
325 this.Show();
326 this.index_remove_btn.Clicked += new System.EventHandler(this.OnRemoveBtnClicked);
327 this.index_add_btn.Clicked += new System.EventHandler(this.OnAddBtnClicked);
328 this.show_hidden_chk.Clicked += new System.EventHandler(this.OnShowHiddenChkClicked);
329 this.ignore_remove_btn.Clicked += new System.EventHandler(this.OnRemoveBtnClicked);
330 this.ignore_add_btn.Clicked += new System.EventHandler(this.OnAddBtnClicked);
331 }
332 }
333}312}
334313
=== modified file 'File/gtk-gui/generated.cs'
--- File/gtk-gui/generated.cs 2009-03-05 01:12:21 +0000
+++ File/gtk-gui/generated.cs 2012-02-20 22:25:22 +0000
@@ -1,115 +1,115 @@
1// ------------------------------------------------------------------------------
2// <autogenerated>
3// This code was generated by a tool.
4//
5//
6// Changes to this file may cause incorrect behavior and will be lost if
7// the code is regenerated.
8// </autogenerated>
9// ------------------------------------------------------------------------------
101
11namespace Stetic {2// This file has been generated by the GUI designer. Do not modify.
12 3namespace Stetic
13 4{
14 internal class Gui {5 internal class Gui
15 6 {
16 private static bool initialized;7 private static bool initialized;
17 8
18 internal static void Initialize(Gtk.Widget iconRenderer) {9 internal static void Initialize (Gtk.Widget iconRenderer)
19 if ((Stetic.Gui.initialized == false)) {10 {
20 Stetic.Gui.initialized = true;11 if ((Stetic.Gui.initialized == false)) {
21 }12 Stetic.Gui.initialized = true;
22 }13 }
23 }14 }
24 15 }
25 internal class BinContainer {16
26 17 internal class BinContainer
27 private Gtk.Widget child;18 {
28 19 private Gtk.Widget child;
29 private Gtk.UIManager uimanager;20 private Gtk.UIManager uimanager;
30 21
31 public static BinContainer Attach(Gtk.Bin bin) {22 public static BinContainer Attach (Gtk.Bin bin)
32 BinContainer bc = new BinContainer();23 {
33 bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);24 BinContainer bc = new BinContainer ();
34 bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);25 bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
35 bin.Added += new Gtk.AddedHandler(bc.OnAdded);26 bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
36 return bc;27 bin.Added += new Gtk.AddedHandler (bc.OnAdded);
37 }28 return bc;
38 29 }
39 private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) {30
40 if ((this.child != null)) {31 private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
41 args.Requisition = this.child.SizeRequest();32 {
42 }33 if ((this.child != null)) {
43 }34 args.Requisition = this.child.SizeRequest ();
44 35 }
45 private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) {36 }
46 if ((this.child != null)) {37
47 this.child.Allocation = args.Allocation;38 private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
48 }39 {
49 }40 if ((this.child != null)) {
50 41 this.child.Allocation = args.Allocation;
51 private void OnAdded(object sender, Gtk.AddedArgs args) {42 }
52 this.child = args.Widget;43 }
53 }44
54 45 private void OnAdded (object sender, Gtk.AddedArgs args)
55 public void SetUiManager(Gtk.UIManager uim) {46 {
56 this.uimanager = uim;47 this.child = args.Widget;
57 this.child.Realized += new System.EventHandler(this.OnRealized);48 }
58 }49
59 50 public void SetUiManager (Gtk.UIManager uim)
60 private void OnRealized(object sender, System.EventArgs args) {51 {
61 if ((this.uimanager != null)) {52 this.uimanager = uim;
62 Gtk.Widget w;53 this.child.Realized += new System.EventHandler (this.OnRealized);
63 w = this.child.Toplevel;54 }
64 if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w))) {55
65 ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);56 private void OnRealized (object sender, System.EventArgs args)
66 this.uimanager = null;57 {
67 }58 if ((this.uimanager != null)) {
68 }59 Gtk.Widget w;
69 }60 w = this.child.Toplevel;
70 }61 if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
71 62 ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
72 internal class IconLoader {63 this.uimanager = null;
73 64 }
74 public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size, int sz) {65 }
75 Gdk.Pixbuf res = widget.RenderIcon(name, size, null);66 }
76 if ((res != null)) {67 }
77 return res;68
78 }69 internal class IconLoader
79 else {70 {
80 try {71 public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
81 return Gtk.IconTheme.Default.LoadIcon(name, sz, 0);72 {
82 }73 Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
83 catch (System.Exception ) {74 if ((res != null)) {
84 if ((name != "gtk-missing-image")) {75 return res;
85 return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size, sz);76 } else {
86 }77 int sz;
87 else {78 int sy;
88 Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz);79 global::Gtk.Icon.SizeLookup (size, out sz, out sy);
89 Gdk.GC gc = new Gdk.GC(pmap);80 try {
90 gc.RgbFgColor = new Gdk.Color(255, 255, 255);81 return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
91 pmap.DrawRectangle(gc, true, 0, 0, sz, sz);82 } catch (System.Exception) {
92 gc.RgbFgColor = new Gdk.Color(0, 0, 0);83 if ((name != "gtk-missing-image")) {
93 pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1));84 return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
94 gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);85 } else {
95 gc.RgbFgColor = new Gdk.Color(255, 0, 0);86 Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
96 pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));87 Gdk.GC gc = new Gdk.GC (pmap);
97 pmap.DrawLine(gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));88 gc.RgbFgColor = new Gdk.Color (255, 255, 255);
98 return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);89 pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
99 }90 gc.RgbFgColor = new Gdk.Color (0, 0, 0);
100 }91 pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
101 }92 gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
102 }93 gc.RgbFgColor = new Gdk.Color (255, 0, 0);
103 }94 pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
104 95 pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
105 internal class ActionGroups {96 return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
106 97 }
107 public static Gtk.ActionGroup GetActionGroup(System.Type type) {98 }
108 return Stetic.ActionGroups.GetActionGroup(type.FullName);99 }
109 }100 }
110 101 }
111 public static Gtk.ActionGroup GetActionGroup(string name) {102
112 return null;103 internal class ActionGroups
113 }104 {
114 }105 public static Gtk.ActionGroup GetActionGroup (System.Type type)
106 {
107 return Stetic.ActionGroups.GetActionGroup (type.FullName);
108 }
109
110 public static Gtk.ActionGroup GetActionGroup (string name)
111 {
112 return null;
113 }
114 }
115}115}
116116
=== modified file 'File/gtk-gui/gui.stetic'
--- File/gtk-gui/gui.stetic 2009-06-23 00:52:54 +0000
+++ File/gtk-gui/gui.stetic 2012-02-20 22:25:22 +0000
@@ -5,12 +5,11 @@
5 <target-gtk-version>2.12</target-gtk-version>5 <target-gtk-version>2.12</target-gtk-version>
6 </configuration>6 </configuration>
7 <import>7 <import>
8 <widget-library name="Do.Interface.Linux, Version=0.9.0.0, Culture=neutral" />
9 <widget-library name="Do.Platform.Linux, Version=0.9.0.0, Culture=neutral" />
10 <widget-library name="../bin/Debug/File.dll" internal="true" />8 <widget-library name="../bin/Debug/File.dll" internal="true" />
11 </import>9 </import>
12 <widget class="Gtk.Bin" id="Do.FilesAndFolders.Configuration" design-size="414 356">10 <widget class="Gtk.Bin" id="Do.FilesAndFolders.Configuration" design-size="630 356">
13 <property name="MemberName" />11 <property name="MemberName" />
12 <property name="WidthRequest">630</property>
14 <child>13 <child>
15 <widget class="Gtk.Alignment" id="alignment1">14 <widget class="Gtk.Alignment" id="alignment1">
16 <property name="MemberName" />15 <property name="MemberName" />
@@ -70,12 +69,25 @@
70 <property name="MemberName" />69 <property name="MemberName" />
71 <property name="Spacing">6</property>70 <property name="Spacing">6</property>
72 <child>71 <child>
73 <widget class="Gtk.Label" id="IndexLabel">72 <widget class="Gtk.Label" id="ExtensionsHelp">
74 <property name="MemberName" />73 <property name="MemberName" />
74 <property name="WidthRequest">410</property>
75 <property name="HeightRequest">30</property>
76 <property name="Xpad">8</property>
77 <property name="Xalign">0</property>
78 <property name="LabelProp" translatable="yes">Leave extensions blank to index all files. Use a comma seperated
79list to index only those items. Example: gif,jpg,png
80
81</property>
82 <property name="UseMarkup">True</property>
83 <property name="Wrap">True</property>
84 <property name="Justify">Fill</property>
75 </widget>85 </widget>
76 <packing>86 <packing>
77 <property name="Position">0</property>87 <property name="Position">0</property>
78 <property name="AutoSize">False</property>88 <property name="AutoSize">True</property>
89 <property name="Expand">False</property>
90 <property name="Fill">False</property>
79 </packing>91 </packing>
80 </child>92 </child>
81 <child>93 <child>
8294
=== modified file 'File/src/Do/Do.FilesAndFolders/Configuration.cs'
--- File/src/Do/Do.FilesAndFolders/Configuration.cs 2009-06-22 04:05:16 +0000
+++ File/src/Do/Do.FilesAndFolders/Configuration.cs 2012-02-20 22:25:22 +0000
@@ -98,7 +98,7 @@
98 98
99 if (chooser.Run () == (int) ResponseType.Accept) {99 if (chooser.Run () == (int) ResponseType.Accept) {
100 if (!Plugin.FolderIndex.ContainsFolder (chooser.Filename))100 if (!Plugin.FolderIndex.ContainsFolder (chooser.Filename))
101 Plugin.FolderIndex.Add (new IndexedFolder (chooser.Filename, depth, status));101 Plugin.FolderIndex.Add (new IndexedFolder (chooser.Filename, depth, "", status));
102 RefreshCurrentView ();102 RefreshCurrentView ();
103 }103 }
104 chooser.Destroy ();104 chooser.Destroy ();
105105
=== modified file 'File/src/Do/Do.FilesAndFolders/FileItemSource.cs'
--- File/src/Do/Do.FilesAndFolders/FileItemSource.cs 2009-06-24 14:35:46 +0000
+++ File/src/Do/Do.FilesAndFolders/FileItemSource.cs 2012-02-20 22:25:22 +0000
@@ -20,6 +20,7 @@
20using System;20using System;
21using System.IO;21using System.IO;
22using System.Linq;22using System.Linq;
23using System.Collections;
23using System.Collections.Generic;24using System.Collections.Generic;
2425
25using Mono.Addins;26using Mono.Addins;
@@ -37,6 +38,7 @@
3738
38 IEnumerable<Item> items;39 IEnumerable<Item> items;
39 bool maximum_files_warned;40 bool maximum_files_warned;
41 private static IList<string> NoExtensions = "".Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries);
4042
41 string MaximumFilesIndexedWarning {43 string MaximumFilesIndexedWarning {
42 get {44 get {
@@ -105,7 +107,7 @@
105 else107 else
106 return Enumerable.Empty<Item> ();108 return Enumerable.Empty<Item> ();
107 109
108 return RecursiveGetItems (file.Path, 1, Plugin.Preferences.IncludeHiddenFilesWhenBrowsing);110 return RecursiveGetItems(file.Path, 1, NoExtensions, Plugin.Preferences.IncludeHiddenFilesWhenBrowsing);
109 }111 }
110 112
111 public override void UpdateItems ()113 public override void UpdateItems ()
@@ -118,12 +120,12 @@
118 120
119 if (Plugin.Preferences.LimitMaxFilesIndexed)121 if (Plugin.Preferences.LimitMaxFilesIndexed)
120 items = Plugin.FolderIndex122 items = Plugin.FolderIndex
121 .SelectMany (folder => RecursiveGetItems (folder.Path, folder.Level, Plugin.Preferences.IncludeHiddenFiles, ignored))123 .SelectMany (folder => RecursiveGetItems(folder.Path, folder.Level, folder.ExtensionList, Plugin.Preferences.IncludeHiddenFiles, ignored))
122 .Take (Plugin.Preferences.MaximumFilesIndexed)124 .Take (Plugin.Preferences.MaximumFilesIndexed)
123 .ToArray ();125 .ToArray ();
124 else126 else
125 items = Plugin.FolderIndex127 items = Plugin.FolderIndex
126 .SelectMany (folder => RecursiveGetItems (folder.Path, folder.Level, Plugin.Preferences.IncludeHiddenFiles, ignored))128 .SelectMany (folder => RecursiveGetItems(folder.Path, folder.Level, folder.ExtensionList, Plugin.Preferences.IncludeHiddenFiles, ignored))
127 .ToArray ();129 .ToArray ();
128 130
129 if (!maximum_files_warned && items.Count () == Plugin.Preferences.MaximumFilesIndexed) {131 if (!maximum_files_warned && items.Count () == Plugin.Preferences.MaximumFilesIndexed) {
@@ -157,17 +159,17 @@
157 /// A <see cref="IEnumerable"/>159 /// A <see cref="IEnumerable"/>
158 /// </returns>160 /// </returns>
159 161
160 static IEnumerable<Item> RecursiveGetItems (string path, uint levels, bool includeHidden)162 static IEnumerable<Item> RecursiveGetItems (string path, uint levels, IList<string> extensions, bool includeHidden)
161 {163 {
162 return RecursiveGetItems(path, levels, includeHidden, Enumerable.Empty<IndexedFolder> ());164 return RecursiveGetItems(path, levels, extensions, includeHidden, Enumerable.Empty<IndexedFolder> ());
163 }165 }
164 166
165 static IEnumerable<Item> RecursiveGetItems (string path, uint levels, bool includeHidden, IEnumerable<IndexedFolder> ignored)167 static IEnumerable<Item> RecursiveGetItems (string path, uint levels, IList<string> extensions, bool includeHidden, IEnumerable<IndexedFolder> ignored)
166 {168 {
167 IEnumerable<string> files;169 IEnumerable<string> files;
168 IEnumerable<Item> fileItems, applicationItems;170 IEnumerable<Item> fileItems, applicationItems;
169 171
170 files = RecursiveListFiles (path, levels, includeHidden, ignored);172 files = RecursiveListFiles (path, levels, extensions, includeHidden, ignored);
171173
172 fileItems = files174 fileItems = files
173 .Select (filepath => Plugin.NewFileItem (filepath))175 .Select (filepath => Plugin.NewFileItem (filepath))
@@ -181,7 +183,7 @@
181 return applicationItems.Concat (fileItems);183 return applicationItems.Concat (fileItems);
182 }184 }
183 185
184 static IEnumerable<string> RecursiveListFiles (string path, uint levels, bool includeHidden, IEnumerable<IndexedFolder> ignored)186 static IEnumerable<string> RecursiveListFiles (string path, uint levels, IList<string> extensions, bool includeHidden, IEnumerable<IndexedFolder> ignored)
185 {187 {
186 IEnumerable<string> results = null;188 IEnumerable<string> results = null;
187189
@@ -194,11 +196,11 @@
194 IEnumerable<string> files, directories, recursiveFiles;196 IEnumerable<string> files, directories, recursiveFiles;
195 197
196 files = Directory.GetFiles (path)198 files = Directory.GetFiles (path)
197 .Where (filepath => ShouldIndexPath (filepath, includeHidden, ignored));199 .Where (filepath => ShouldIndexPath (filepath, includeHidden, extensions, ignored));
198 directories = Directory.GetDirectories (path)200 directories = Directory.GetDirectories (path)
199 .Where (filepath => ShouldIndexPath (filepath, includeHidden, ignored));201 .Where (filepath => ShouldIndexPath (filepath, includeHidden, extensions, ignored));
200 recursiveFiles = directories202 recursiveFiles = directories
201 .SelectMany (dir => RecursiveListFiles (dir, levels - 1, includeHidden, ignored));203 .SelectMany (dir => RecursiveListFiles (dir, levels - 1, extensions, includeHidden, ignored));
202 results = files.Concat (directories).Concat (recursiveFiles);204 results = files.Concat (directories).Concat (recursiveFiles);
203 205
204 } catch (Exception e) {206 } catch (Exception e) {
@@ -209,14 +211,21 @@
209 return results;211 return results;
210 }212 }
211213
212 static bool ShouldIndexPath (string path, bool includeHidden, IEnumerable<IndexedFolder> ignored)214 static bool ShouldIndexPath (string path, bool includeHidden, IList<string> extensions, IEnumerable<IndexedFolder> ignored)
213 {215 {
214 string filename = Path.GetFileName (path);216 string filename = Path.GetFileName (path);
215 bool isForbidden = filename == "." || filename == ".." || filename.EndsWith ("~");217 bool isForbidden = filename == "." || filename == ".." || filename.EndsWith ("~");
216 bool isHidden = filename.StartsWith (".");218 bool isHidden = filename.StartsWith (".");
219 bool isIncluded = true;
220
221 if (File.Exists(path) && extensions.Count() > 0) {
222 string extension = Path.GetExtension(path).TrimStart(new char[] {'.'});
223 isIncluded = extensions.Contains(extension);
224 }
225
217 if (ignored.Where (folder => path == folder.Path).Any ()) 226 if (ignored.Where (folder => path == folder.Path).Any ())
218 isForbidden = true;227 isForbidden = true;
219 return !isForbidden && (includeHidden || !isHidden);228 return !isForbidden && isIncluded && (includeHidden || !isHidden);
220 }229 }
221 230
222 }231 }
223232
=== modified file 'File/src/Do/Do.FilesAndFolders/IndexedFolder.cs'
--- File/src/Do/Do.FilesAndFolders/IndexedFolder.cs 2010-11-04 22:55:52 +0000
+++ File/src/Do/Do.FilesAndFolders/IndexedFolder.cs 2012-02-20 22:25:22 +0000
@@ -20,6 +20,7 @@
20using System;20using System;
21using System.Collections;21using System.Collections;
22using System.Collections.Generic;22using System.Collections.Generic;
23using System.Linq;
2324
24using Do.Platform;25using Do.Platform;
2526
@@ -30,24 +31,36 @@
30 {31 {
31 public string Path { get; private set; }32 public string Path { get; private set; }
32 public uint Level { get; private set; }33 public uint Level { get; private set; }
34 public string Extensions { get; private set; }
35 public IList<string> ExtensionList { get; private set; }
33 public FolderStatus Status { get; private set; }36 public FolderStatus Status { get; private set; }
34 37
35 public IndexedFolder (string path, uint level, FolderStatus status) : this ()38 public IndexedFolder (string path, uint level, string extensions, FolderStatus status) : this ()
36 {39 {
37 if (path == null) throw new ArgumentNullException ("path");40 if (path == null) throw new ArgumentNullException ("path");
41 if (extensions == null) extensions = "";
38 42
39 Path = Services.Environment.ExpandPath (path);43 Path = Services.Environment.ExpandPath (path);
40 Level = level;44 Level = level;
45 Extensions = extensions;
46 ExtensionList = BuildExtensionList();
41 Status = status;47 Status = status;
42 }48 }
43 49
44 public IndexedFolder (string path, uint level) : this (path, level, FolderStatus.Indexed)50 private IList<string> BuildExtensionList ()
51 {
52 IList<string> extensions = Extensions.Replace(" ", "").Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries);
53 extensions = (from item in extensions select(item = item.ToLower().TrimStart('.').Trim())).ToList();
54 return extensions;
55 }
56
57 public IndexedFolder (string path, uint level) : this (path, level, "", FolderStatus.Indexed)
45 {58 {
46 }59 }
4760
48 public override string ToString ()61 public override string ToString ()
49 {62 {
50 return string.Format ("{0} {2} {1} {3}", GetType ().Name, Path, Level, Status);63 return string.Format ("{0} {2} {1} {3} {4}", GetType ().Name, Path, Level, Extensions, Status);
51 }64 }
5265
53 public override bool Equals (object other)66 public override bool Equals (object other)
@@ -57,12 +70,12 @@
5770
58 public override int GetHashCode ()71 public override int GetHashCode ()
59 {72 {
60 return Path.GetHashCode () ^ Level.GetHashCode () ^ Status.GetHashCode ();73 return Path.GetHashCode () ^ Level.GetHashCode () ^ Extensions.GetHashCode() ^ Status.GetHashCode ();
61 }74 }
6275
63 public bool Equals (IndexedFolder other)76 public bool Equals (IndexedFolder other)
64 {77 {
65 return other.Path == Path && other.Level == Level && other.Status == Status;78 return other.Path == Path && other.Level == Level && other.Extensions == Extensions && other.Status == Status;
66 }79 }
6780
68 public static bool operator== (IndexedFolder left, IndexedFolder right)81 public static bool operator== (IndexedFolder left, IndexedFolder right)
6982
=== modified file 'File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs'
--- File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs 2009-03-04 22:34:14 +0000
+++ File/src/Do/Do.FilesAndFolders/IndexedFolderCollection.cs 2012-02-20 22:25:22 +0000
@@ -54,10 +54,10 @@
5454
55 IEnumerable<IndexedFolder> GetDefaultFolders ()55 IEnumerable<IndexedFolder> GetDefaultFolders ()
56 {56 {
57 yield return new IndexedFolder (Path.GetDirectoryName (Plugin.ImportantFolders.UserHome), 1, FolderStatus.Indexed);57 yield return new IndexedFolder (Path.GetDirectoryName (Plugin.ImportantFolders.UserHome), 1, "", FolderStatus.Indexed);
58 yield return new IndexedFolder (Plugin.ImportantFolders.UserHome, 1, FolderStatus.Indexed);58 yield return new IndexedFolder (Plugin.ImportantFolders.UserHome, 1, "", FolderStatus.Indexed);
59 yield return new IndexedFolder (Plugin.ImportantFolders.Desktop, 1, FolderStatus.Indexed);59 yield return new IndexedFolder (Plugin.ImportantFolders.Desktop, 1, "", FolderStatus.Indexed);
60 yield return new IndexedFolder (Plugin.ImportantFolders.Documents, 2, FolderStatus.Indexed);60 yield return new IndexedFolder (Plugin.ImportantFolders.Documents, 2, "", FolderStatus.Indexed);
61 }61 }
6262
63 public IndexedFolderCollection ()63 public IndexedFolderCollection ()
@@ -74,11 +74,11 @@
74 }74 }
75 }75 }
7676
77 public void UpdateIndexedFolder (string path, string newPath, uint newDepth, FolderStatus newStatus)77 public void UpdateIndexedFolder (string path, string newPath, uint newDepth, string newExtensions, FolderStatus newStatus)
78 {78 {
79 if (newDepth > LargeIndexLevel)79 if (newDepth > LargeIndexLevel)
80 Log<IndexedFolderCollection>.Warn (LargeIndexLevelWarning, newPath, newDepth);80 Log<IndexedFolderCollection>.Warn (LargeIndexLevelWarning, newPath, newDepth);
81 UpdateIndexedFolder (path, new IndexedFolder (newPath, newDepth, newStatus));81 UpdateIndexedFolder (path, new IndexedFolder (newPath, newDepth, newExtensions, newStatus));
82 }82 }
8383
84 public void UpdateIndexedFolder (string path, IndexedFolder folder)84 public void UpdateIndexedFolder (string path, IndexedFolder folder)
@@ -163,7 +163,7 @@
163 foreach (IndexedFolder folder in f) {163 foreach (IndexedFolder folder in f) {
164 if (folder.Level > 0 && folder.Status == FolderStatus.Ignored) {164 if (folder.Level > 0 && folder.Status == FolderStatus.Ignored) {
165 Log<IndexedFolderCollection>.Debug ("Old DB entry found for {0}, fixing.", folder.Path);165 Log<IndexedFolderCollection>.Debug ("Old DB entry found for {0}, fixing.", folder.Path);
166 UpdateIndexedFolder(folder.Path, folder.Path, folder.Level, FolderStatus.Indexed);166 UpdateIndexedFolder(folder.Path, folder.Path, folder.Level, folder.Extensions, FolderStatus.Indexed);
167 }167 }
168 }168 }
169 Log<IndexedFolderCollection>.Debug ("Loaded Files and Folders plugin state.");169 Log<IndexedFolderCollection>.Debug ("Loaded Files and Folders plugin state.");
170170
=== modified file 'File/src/IndexPathNodeView.cs'
--- File/src/IndexPathNodeView.cs 2010-04-11 17:45:19 +0000
+++ File/src/IndexPathNodeView.cs 2012-02-20 22:25:22 +0000
@@ -32,6 +32,7 @@
32 public enum Column {32 public enum Column {
33 Path = 0,33 Path = 0,
34 Depth,34 Depth,
35 Extensions,
35 NumColumns36 NumColumns
36 }37 }
37 38
@@ -41,7 +42,7 @@
41 RulesHint = true;42 RulesHint = true;
42 HeadersVisible = true;43 HeadersVisible = true;
43 44
44 Model = new ListStore (typeof (string), typeof (uint));45 Model = new ListStore (typeof (string), typeof (uint), typeof(string));
4546
46 cell = new CellRendererText ();47 cell = new CellRendererText ();
47 (cell as CellRendererText).Width = 280;48 (cell as CellRendererText).Width = 280;
@@ -53,7 +54,13 @@
53 (cell as CellRendererText).Edited += OnDepthEdited;54 (cell as CellRendererText).Edited += OnDepthEdited;
54 (cell as CellRendererText).Alignment = Pango.Alignment.Right;55 (cell as CellRendererText).Alignment = Pango.Alignment.Right;
55 AppendColumn (AddinManager.CurrentLocalizer.GetString ("Depth"), cell, "text", Column.Depth);56 AppendColumn (AddinManager.CurrentLocalizer.GetString ("Depth"), cell, "text", Column.Depth);
56 57
58 cell = new CellRendererText();
59 (cell as CellRendererText).Editable = true;
60 (cell as CellRendererText).Edited += OnExtensionsEdited;
61 (cell as CellRendererText).Alignment = Pango.Alignment.Right;
62 AppendColumn(AddinManager.CurrentLocalizer.GetString("Extensions"), cell, "text", Column.Extensions);
63
57 Refresh ();64 Refresh ();
58 }65 }
59 66
@@ -66,6 +73,7 @@
66 {73 {
67 uint depth;74 uint depth;
68 string path;75 string path;
76 string extensions;
69 TreeIter iter;77 TreeIter iter;
70 ListStore store;78 ListStore store;
7179
@@ -73,14 +81,34 @@
73 store.GetIter (out iter, new TreePath (e.Path));81 store.GetIter (out iter, new TreePath (e.Path));
74 82
75 path = store.GetValue (iter, (int) Column.Path) as string;83 path = store.GetValue (iter, (int) Column.Path) as string;
84 extensions = store.GetValue(iter, (int)Column.Extensions) as string;
76 try {85 try {
77 depth = uint.Parse (e.NewText);86 depth = uint.Parse (e.NewText);
78 } catch {87 } catch {
79 depth = 1;88 depth = 1;
80 }89 }
81 Plugin.FolderIndex.UpdateIndexedFolder (path, path, depth, FolderStatus.Indexed);90 Plugin.FolderIndex.UpdateIndexedFolder (path, path, depth, extensions, FolderStatus.Indexed);
82 91
83 Refresh ();92 Refresh ();
84 }93 }
94
95 public void OnExtensionsEdited (object o, EditedArgs e)
96 {
97 uint depth;
98 string path;
99 string extensions;
100 TreeIter iter;
101 ListStore store;
102
103 store = Model as ListStore;
104 store.GetIter(out iter, new TreePath(e.Path));
105
106 path = store.GetValue(iter, (int)Column.Path) as string;
107 depth = (uint)store.GetValue(iter, (int)Column.Depth);
108 extensions = e.NewText;
109 Plugin.FolderIndex.UpdateIndexedFolder(path, path, depth, extensions, FolderStatus.Indexed);
110
111 Refresh();
112 }
85 }113 }
86}114}
87115
=== modified file 'File/src/PathNodeView.cs'
--- File/src/PathNodeView.cs 2009-06-22 04:05:16 +0000
+++ File/src/PathNodeView.cs 2012-02-20 22:25:22 +0000
@@ -48,7 +48,7 @@
48 store.Clear ();48 store.Clear ();
49 foreach (IndexedFolder pair in Plugin.FolderIndex) {49 foreach (IndexedFolder pair in Plugin.FolderIndex) {
50 if (indexed && pair.Status == FolderStatus.Indexed)50 if (indexed && pair.Status == FolderStatus.Indexed)
51 store.AppendValues (pair.Path, pair.Level);51 store.AppendValues (pair.Path, pair.Level, pair.Extensions);
52 else if (!indexed && pair.Status == FolderStatus.Ignored)52 else if (!indexed && pair.Status == FolderStatus.Ignored)
53 store.AppendValues (pair.Path);53 store.AppendValues (pair.Path);
54 }54 }

Subscribers

People subscribed via source and target branches