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