src/Builder4/ValaProjectSettings.bjs
[app.Builder.js] / src / Builder4 / ValaProjectSettings.vala
1 static ValaProjectSettings  _ValaProjectSettings;
2
3 public class ValaProjectSettings : Object
4 {
5     public Gtk.Box el;
6     private ValaProjectSettings  _this;
7
8     public static ValaProjectSettings singleton()
9     {
10         if (_ValaProjectSettings == null) {
11             _ValaProjectSettings= new ValaProjectSettings();
12         }
13         return _ValaProjectSettings;
14     }
15     public Xcls_label_global label_global;
16     public Xcls_label_targets label_targets;
17     public Xcls_compile_flags compile_flags;
18     public Xcls_default_packages_tree_store default_packages_tree_store;
19     public Xcls_packages_render packages_render;
20     public Xcls_packages_render_use packages_render_use;
21     public Xcls_default_directory_tree default_directory_tree;
22     public Xcls_default_directory_tree_store default_directory_tree_store;
23     public Xcls_directory_render directory_render;
24     public Xcls_default_directory_menu default_directory_menu;
25     public Xcls_targets_tree_menu targets_tree_menu;
26     public Xcls_targets_tree targets_tree;
27     public Xcls_targets_tree_store targets_tree_store;
28     public Xcls_targets_render targets_render;
29     public Xcls_set_vbox set_vbox;
30     public Xcls_build_pack_target build_pack_target;
31     public Xcls_build_compile_flags build_compile_flags;
32     public Xcls_files_tree_store files_tree_store;
33     public Xcls_files_render files_render;
34     public Xcls_files_render_use files_render_use;
35
36         // my vars (def)
37     public Project.Gtk project;
38     public Xcls_MainWindow window;
39
40     // ctor
41     public ValaProjectSettings()
42     {
43         _this = this;
44         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
45
46         // my vars (dec)
47         this.project = null;
48         this.window = null;
49
50         // set gobject values
51         var child_0 = new Xcls_Notebook2( _this );
52         child_0.ref();
53         this.el.pack_start (  child_0.el , true,true,0 );
54     }
55
56     // user defined functions
57     public void show (Project.Gtk project) {
58         
59         
60         print("ValaProjectSettings show\n");
61         
62         this.project=  project;
63     
64         this.compile_flags.el.text = _this.project.compilegroups.get("_default_").compile_flags;
65         
66         this.default_directory_tree_store.load();    
67         this.default_packages_tree_store.load();            
68         this.targets_tree_store.load();
69         this.files_tree_store.load();
70     
71     }
72     public void save ()  {
73         this.project.writeConfig();
74     }
75     public class Xcls_Notebook2 : Object
76     {
77         public Gtk.Notebook el;
78         private ValaProjectSettings  _this;
79
80
81             // my vars (def)
82
83         // ctor
84         public Xcls_Notebook2(ValaProjectSettings _owner )
85         {
86             _this = _owner;
87             this.el = new Gtk.Notebook();
88
89             // my vars (dec)
90
91             // set gobject values
92             var child_0 = new Xcls_label_global( _this );
93             child_0.ref();
94             var child_1 = new Xcls_label_targets( _this );
95             child_1.ref();
96             var child_2 = new Xcls_Box5( _this );
97             child_2.ref();
98             this.el.append_page (  child_2.el , _this.label_global.el );
99             var child_3 = new Xcls_Paned26( _this );
100             child_3.ref();
101             this.el.append_page (  child_3.el , _this.label_targets.el );
102         }
103
104         // user defined functions
105     }
106     public class Xcls_label_global : Object
107     {
108         public Gtk.Label el;
109         private ValaProjectSettings  _this;
110
111
112             // my vars (def)
113
114         // ctor
115         public Xcls_label_global(ValaProjectSettings _owner )
116         {
117             _this = _owner;
118             _this.label_global = this;
119             this.el = new Gtk.Label( "Global" );
120
121             // my vars (dec)
122
123             // set gobject values
124         }
125
126         // user defined functions
127     }
128
129     public class Xcls_label_targets : Object
130     {
131         public Gtk.Label el;
132         private ValaProjectSettings  _this;
133
134
135             // my vars (def)
136
137         // ctor
138         public Xcls_label_targets(ValaProjectSettings _owner )
139         {
140             _this = _owner;
141             _this.label_targets = this;
142             this.el = new Gtk.Label( "Targets" );
143
144             // my vars (dec)
145
146             // set gobject values
147         }
148
149         // user defined functions
150     }
151
152     public class Xcls_Box5 : Object
153     {
154         public Gtk.Box el;
155         private ValaProjectSettings  _this;
156
157
158             // my vars (def)
159
160         // ctor
161         public Xcls_Box5(ValaProjectSettings _owner )
162         {
163             _this = _owner;
164             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
165
166             // my vars (dec)
167
168             // set gobject values
169             this.el.homogeneous = false;
170             var child_0 = new Xcls_Label6( _this );
171             child_0.ref();
172             this.el.pack_start (  child_0.el , false,false,0 );
173             var child_1 = new Xcls_compile_flags( _this );
174             child_1.ref();
175             this.el.pack_start (  child_1.el , false,false,0 );
176             var child_2 = new Xcls_Box8( _this );
177             child_2.ref();
178             this.el.pack_start (  child_2.el , true,true,0 );
179         }
180
181         // user defined functions
182     }
183     public class Xcls_Label6 : Object
184     {
185         public Gtk.Label el;
186         private ValaProjectSettings  _this;
187
188
189             // my vars (def)
190
191         // ctor
192         public Xcls_Label6(ValaProjectSettings _owner )
193         {
194             _this = _owner;
195             this.el = new Gtk.Label( "compile flags" );
196
197             // my vars (dec)
198
199             // set gobject values
200         }
201
202         // user defined functions
203     }
204
205     public class Xcls_compile_flags : Object
206     {
207         public Gtk.Entry el;
208         private ValaProjectSettings  _this;
209
210
211             // my vars (def)
212
213         // ctor
214         public Xcls_compile_flags(ValaProjectSettings _owner )
215         {
216             _this = _owner;
217             _this.compile_flags = this;
218             this.el = new Gtk.Entry();
219
220             // my vars (dec)
221
222             // set gobject values
223             this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
224
225             //listeners
226             this.el.changed.connect( () => {
227                 
228                _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
229                _this.project.writeConfig();
230             //    _this.project.save();
231             
232             });
233         }
234
235         // user defined functions
236     }
237
238     public class Xcls_Box8 : Object
239     {
240         public Gtk.Box el;
241         private ValaProjectSettings  _this;
242
243
244             // my vars (def)
245
246         // ctor
247         public Xcls_Box8(ValaProjectSettings _owner )
248         {
249             _this = _owner;
250             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
251
252             // my vars (dec)
253
254             // set gobject values
255             var child_0 = new Xcls_ScrolledWindow9( _this );
256             child_0.ref();
257             this.el.add (  child_0.el  );
258             var child_1 = new Xcls_ScrolledWindow16( _this );
259             child_1.ref();
260             this.el.add (  child_1.el  );
261         }
262
263         // user defined functions
264     }
265     public class Xcls_ScrolledWindow9 : Object
266     {
267         public Gtk.ScrolledWindow el;
268         private ValaProjectSettings  _this;
269
270
271             // my vars (def)
272
273         // ctor
274         public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
275         {
276             _this = _owner;
277             this.el = new Gtk.ScrolledWindow( null, null );
278
279             // my vars (dec)
280
281             // set gobject values
282             var child_0 = new Xcls_default_packages_tree( _this );
283             child_0.ref();
284             this.el.add (  child_0.el  );
285         }
286
287         // user defined functions
288     }
289     public class Xcls_default_packages_tree : Object
290     {
291         public Gtk.TreeView el;
292         private ValaProjectSettings  _this;
293
294
295             // my vars (def)
296
297         // ctor
298         public Xcls_default_packages_tree(ValaProjectSettings _owner )
299         {
300             _this = _owner;
301             this.el = new Gtk.TreeView();
302
303             // my vars (dec)
304
305             // set gobject values
306             this.el.headers_visible = true;
307             var child_0 = new Xcls_default_packages_tree_store( _this );
308             child_0.ref();
309             this.el.set_model (  child_0.el  );
310             var child_1 = new Xcls_TreeViewColumn12( _this );
311             child_1.ref();
312             this.el.append_column (  child_1.el  );
313             var child_2 = new Xcls_TreeViewColumn14( _this );
314             child_2.ref();
315             this.el.append_column (  child_2.el  );
316         }
317
318         // user defined functions
319     }
320     public class Xcls_default_packages_tree_store : Object
321     {
322         public Gtk.ListStore el;
323         private ValaProjectSettings  _this;
324
325
326             // my vars (def)
327
328         // ctor
329         public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
330         {
331             _this = _owner;
332             _this.default_packages_tree_store = this;
333             this.el = new Gtk.ListStore( 2,     typeof(string),  // 0 key type
334       typeof(bool) );
335
336             // my vars (dec)
337
338             // set gobject values
339         }
340
341         // user defined functions
342         public void load () {
343          
344             var def = _this.project.compilegroups.get("_default_");
345             var items  = def.packages;
346             
347             this.el.clear();
348             var pal = (Palete.Gtk) Palete.factory("Gtk");
349             var pkgs = pal.packages(_this.project);
350             print("ValaProjectSettings:packages load %d\n", pkgs.size);
351         
352             Gtk.TreeIter citer;
353         
354             for(var i =0 ; i < pkgs.size; i++) {
355                  this.el.append(out citer);   
356                  
357                 this.el.set_value(citer, 0,   pkgs.get(i) ); // title 
358                 this.el.set_value(citer, 1,   items.contains(pkgs.get(i)) );
359             }
360             this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
361             
362         }
363     }
364
365     public class Xcls_TreeViewColumn12 : Object
366     {
367         public Gtk.TreeViewColumn el;
368         private ValaProjectSettings  _this;
369
370
371             // my vars (def)
372
373         // ctor
374         public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
375         {
376             _this = _owner;
377             this.el = new Gtk.TreeViewColumn();
378
379             // my vars (dec)
380
381             // set gobject values
382             this.el.title = "package name";
383             this.el.expand = true;
384             this.el.resizable = true;
385             var child_0 = new Xcls_packages_render( _this );
386             child_0.ref();
387             this.el.pack_start (  child_0.el , false );
388
389             // init method
390
391             this.el.add_attribute(_this.packages_render.el , "text", 0 );
392         }
393
394         // user defined functions
395     }
396     public class Xcls_packages_render : Object
397     {
398         public Gtk.CellRendererText el;
399         private ValaProjectSettings  _this;
400
401
402             // my vars (def)
403
404         // ctor
405         public Xcls_packages_render(ValaProjectSettings _owner )
406         {
407             _this = _owner;
408             _this.packages_render = this;
409             this.el = new Gtk.CellRendererText();
410
411             // my vars (dec)
412
413             // set gobject values
414         }
415
416         // user defined functions
417     }
418
419
420     public class Xcls_TreeViewColumn14 : Object
421     {
422         public Gtk.TreeViewColumn el;
423         private ValaProjectSettings  _this;
424
425
426             // my vars (def)
427
428         // ctor
429         public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
430         {
431             _this = _owner;
432             this.el = new Gtk.TreeViewColumn();
433
434             // my vars (dec)
435
436             // set gobject values
437             this.el.title = "use";
438             this.el.resizable = false;
439             this.el.fixed_width = 50;
440             var child_0 = new Xcls_packages_render_use( _this );
441             child_0.ref();
442             this.el.pack_start (  child_0.el , false );
443
444             // init method
445
446             {
447              this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
448              }
449         }
450
451         // user defined functions
452     }
453     public class Xcls_packages_render_use : Object
454     {
455         public Gtk.CellRendererToggle el;
456         private ValaProjectSettings  _this;
457
458
459             // my vars (def)
460
461         // ctor
462         public Xcls_packages_render_use(ValaProjectSettings _owner )
463         {
464             _this = _owner;
465             _this.packages_render_use = this;
466             this.el = new Gtk.CellRendererToggle();
467
468             // my vars (dec)
469
470             // set gobject values
471             this.el.activatable = true;
472
473             //listeners
474             this.el.toggled.connect( (  path_string) =>  { 
475                 var m = _this.default_packages_tree_store.el;
476                Gtk.TreeIter iter;
477                Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
478                m.get_iter (out iter, path);
479                GLib.Value val;
480                m.get_value(iter, 1, out val);
481                m.set_value(iter, 1,  ((bool) val) ? false :true); 
482                  GLib.Value fval;  
483                m.get_value(iter, 0, out fval);
484                var fn = (string)fval;
485                 
486                 var def = _this.project.compilegroups.get("_default_");
487                 var items  = def.packages;
488                 if ((bool)val) {
489                     // renive
490                     items.remove(fn);
491                 } else {
492                     items.add(fn);
493                 }
494                 
495             });
496         }
497
498         // user defined functions
499     }
500
501
502
503
504     public class Xcls_ScrolledWindow16 : Object
505     {
506         public Gtk.ScrolledWindow el;
507         private ValaProjectSettings  _this;
508
509
510             // my vars (def)
511
512         // ctor
513         public Xcls_ScrolledWindow16(ValaProjectSettings _owner )
514         {
515             _this = _owner;
516             this.el = new Gtk.ScrolledWindow( null, null );
517
518             // my vars (dec)
519
520             // set gobject values
521             var child_0 = new Xcls_default_directory_tree( _this );
522             child_0.ref();
523             this.el.add (  child_0.el  );
524             var child_1 = new Xcls_default_directory_menu( _this );
525             child_1.ref();
526         }
527
528         // user defined functions
529     }
530     public class Xcls_default_directory_tree : Object
531     {
532         public Gtk.TreeView el;
533         private ValaProjectSettings  _this;
534
535
536             // my vars (def)
537
538         // ctor
539         public Xcls_default_directory_tree(ValaProjectSettings _owner )
540         {
541             _this = _owner;
542             _this.default_directory_tree = this;
543             this.el = new Gtk.TreeView();
544
545             // my vars (dec)
546
547             // set gobject values
548             this.el.headers_visible = true;
549             var child_0 = new Xcls_default_directory_tree_store( _this );
550             child_0.ref();
551             this.el.set_model (  child_0.el  );
552             var child_1 = new Xcls_TreeViewColumn19( _this );
553             child_1.ref();
554             this.el.append_column (  child_1.el  );
555
556             //listeners
557             this.el.button_press_event.connect( ( ev) => {
558                 //console.log("button press?");
559                
560                 
561                 if (ev.type != Gdk.EventType.BUTTON_PRESS  || ev.button != 3) {
562                     //print("click" + ev.type);
563                     return false;
564                 }
565                 //Gtk.TreePath res;
566                 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
567                 //    return true;
568                 //}
569                  
570               //  this.el.get_selection().select_path(res);
571                  
572                   //if (!this.get('/LeftTreeMenu').el)  { 
573                   //      this.get('/LeftTreeMenu').init(); 
574                   //  }
575                     
576                  _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
577                  _this.default_directory_menu.el.show_all();
578                   _this.default_directory_menu.el.popup(null, null, null,  3, ev.time);
579                  //   print("click:" + res.path.to_string());
580                   return true;
581             });
582         }
583
584         // user defined functions
585     }
586     public class Xcls_default_directory_tree_store : Object
587     {
588         public Gtk.ListStore el;
589         private ValaProjectSettings  _this;
590
591
592             // my vars (def)
593
594         // ctor
595         public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
596         {
597             _this = _owner;
598             _this.default_directory_tree_store = this;
599             this.el = new Gtk.ListStore( 1,     typeof(string)
600       );
601
602             // my vars (dec)
603
604             // set gobject values
605         }
606
607         // user defined functions
608         public void load () {
609          
610           this.el.clear();
611           
612             
613              var def = _this.project.compilegroups.get("_default_");
614              var items  = def.sources;
615              
616          
617             Gtk.TreeIter citer;
618         
619             for(var i =0 ; i < items.size; i++) {
620                  this.el.append(out citer);   
621                  
622                 this.el.set_value(citer, 0,   items.get(i) ); // title 
623                 //this.el.set_value(citer, 1,   items.get(i) );
624             }
625             this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
626             
627         }
628     }
629
630     public class Xcls_TreeViewColumn19 : Object
631     {
632         public Gtk.TreeViewColumn el;
633         private ValaProjectSettings  _this;
634
635
636             // my vars (def)
637
638         // ctor
639         public Xcls_TreeViewColumn19(ValaProjectSettings _owner )
640         {
641             _this = _owner;
642             this.el = new Gtk.TreeViewColumn();
643
644             // my vars (dec)
645
646             // set gobject values
647             this.el.title = "Available Directories (right click to add)";
648             this.el.resizable = true;
649             var child_0 = new Xcls_directory_render( _this );
650             child_0.ref();
651             this.el.pack_start (  child_0.el , false );
652
653             // init method
654
655             this.el.add_attribute(_this.directory_render.el , "text", 0 );
656         }
657
658         // user defined functions
659     }
660     public class Xcls_directory_render : Object
661     {
662         public Gtk.CellRendererText el;
663         private ValaProjectSettings  _this;
664
665
666             // my vars (def)
667
668         // ctor
669         public Xcls_directory_render(ValaProjectSettings _owner )
670         {
671             _this = _owner;
672             _this.directory_render = this;
673             this.el = new Gtk.CellRendererText();
674
675             // my vars (dec)
676
677             // set gobject values
678         }
679
680         // user defined functions
681     }
682
683
684
685     public class Xcls_default_directory_menu : Object
686     {
687         public Gtk.Menu el;
688         private ValaProjectSettings  _this;
689
690
691             // my vars (def)
692
693         // ctor
694         public Xcls_default_directory_menu(ValaProjectSettings _owner )
695         {
696             _this = _owner;
697             _this.default_directory_menu = this;
698             this.el = new Gtk.Menu();
699
700             // my vars (dec)
701
702             // set gobject values
703             var child_0 = new Xcls_MenuItem22( _this );
704             child_0.ref();
705             this.el.add (  child_0.el  );
706             var child_1 = new Xcls_MenuItem23( _this );
707             child_1.ref();
708             this.el.add (  child_1.el  );
709             var child_2 = new Xcls_SeparatorMenuItem24( _this );
710             child_2.ref();
711             this.el.add (  child_2.el  );
712             var child_3 = new Xcls_MenuItem25( _this );
713             child_3.ref();
714             this.el.add (  child_3.el  );
715         }
716
717         // user defined functions
718     }
719     public class Xcls_MenuItem22 : Object
720     {
721         public Gtk.MenuItem el;
722         private ValaProjectSettings  _this;
723
724
725             // my vars (def)
726
727         // ctor
728         public Xcls_MenuItem22(ValaProjectSettings _owner )
729         {
730             _this = _owner;
731             this.el = new Gtk.MenuItem();
732
733             // my vars (dec)
734
735             // set gobject values
736             this.el.label = "Add Directory";
737
738             //listeners
739             this.el.activate.connect( ()  => {
740                 
741                 var  chooser = new Gtk.FileChooserDialog (
742                 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
743                 "_Cancel",
744                 Gtk.ResponseType.CANCEL,
745                 "_Add",
746                 Gtk.ResponseType.ACCEPT);
747                 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
748                     chooser.close ();
749                        return;
750                    }
751                    chooser.close ();
752                    // add the directory..
753                    var fn = _this.project.relPath(chooser.get_filename());
754                    _this.project.compilegroups.get("_default_").sources.add(fn);
755                    _this.default_directory_tree_store.load();
756             });
757         }
758
759         // user defined functions
760     }
761
762     public class Xcls_MenuItem23 : Object
763     {
764         public Gtk.MenuItem el;
765         private ValaProjectSettings  _this;
766
767
768             // my vars (def)
769
770         // ctor
771         public Xcls_MenuItem23(ValaProjectSettings _owner )
772         {
773             _this = _owner;
774             this.el = new Gtk.MenuItem();
775
776             // my vars (dec)
777
778             // set gobject values
779             this.el.label = "Add File";
780
781             //listeners
782             this.el.activate.connect( ()  => {
783                 
784                 var  chooser = new Gtk.FileChooserDialog (
785                 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
786                 "_Cancel",
787                 Gtk.ResponseType.CANCEL,
788                 "_Add",
789                 Gtk.ResponseType.ACCEPT);
790                 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
791                     chooser.close ();
792                        return;
793                    }
794                    chooser.close ();
795                    // add the directory..
796                    var fn = _this.project.relPath(chooser.get_filename());
797                    _this.project.compilegroups.get("_default_").sources.add(fn);
798                    _this.default_directory_tree_store.load();
799             });
800         }
801
802         // user defined functions
803     }
804
805     public class Xcls_SeparatorMenuItem24 : Object
806     {
807         public Gtk.SeparatorMenuItem el;
808         private ValaProjectSettings  _this;
809
810
811             // my vars (def)
812
813         // ctor
814         public Xcls_SeparatorMenuItem24(ValaProjectSettings _owner )
815         {
816             _this = _owner;
817             this.el = new Gtk.SeparatorMenuItem();
818
819             // my vars (dec)
820
821             // set gobject values
822         }
823
824         // user defined functions
825     }
826
827     public class Xcls_MenuItem25 : Object
828     {
829         public Gtk.MenuItem el;
830         private ValaProjectSettings  _this;
831
832
833             // my vars (def)
834
835         // ctor
836         public Xcls_MenuItem25(ValaProjectSettings _owner )
837         {
838             _this = _owner;
839             this.el = new Gtk.MenuItem();
840
841             // my vars (dec)
842
843             // set gobject values
844             this.el.label = "Remove File/Directory";
845
846             //listeners
847             this.el.activate.connect( ()  => {
848                 
849                  //
850                     Gtk.TreeModel mod;
851                     Gtk.TreeIter iter;
852                     if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
853                            print("nothing selected\n");
854                         return;
855                     }
856             
857                         
858                    // add the directory..
859                    
860                    
861                    GLib.Value val;
862                     mod.get_value(iter,0, out val);
863                    var fn =  (string) val;
864                    
865                    print("remove: %s\n", fn);
866                    if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
867                               print("remove failed");
868                           }
869                    _this.default_directory_tree_store.load();
870             });
871         }
872
873         // user defined functions
874     }
875
876
877
878
879
880     public class Xcls_Paned26 : Object
881     {
882         public Gtk.Paned el;
883         private ValaProjectSettings  _this;
884
885
886             // my vars (def)
887
888         // ctor
889         public Xcls_Paned26(ValaProjectSettings _owner )
890         {
891             _this = _owner;
892             this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
893
894             // my vars (dec)
895
896             // set gobject values
897             this.el.position = 300;
898             var child_0 = new Xcls_ScrolledWindow27( _this );
899             child_0.ref();
900             this.el.add1 (  child_0.el  );
901             var child_1 = new Xcls_set_vbox( _this );
902             child_1.ref();
903             this.el.add2 (  child_1.el  );
904         }
905
906         // user defined functions
907     }
908     public class Xcls_ScrolledWindow27 : Object
909     {
910         public Gtk.ScrolledWindow el;
911         private ValaProjectSettings  _this;
912
913
914             // my vars (def)
915
916         // ctor
917         public Xcls_ScrolledWindow27(ValaProjectSettings _owner )
918         {
919             _this = _owner;
920             this.el = new Gtk.ScrolledWindow( null, null );
921
922             // my vars (dec)
923
924             // set gobject values
925             var child_0 = new Xcls_targets_tree_menu( _this );
926             child_0.ref();
927             this.el.add (  child_0.el  );
928             var child_1 = new Xcls_targets_tree( _this );
929             child_1.ref();
930             this.el.add (  child_1.el  );
931
932             // init method
933
934             {  
935             this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
936             
937             }
938         }
939
940         // user defined functions
941     }
942     public class Xcls_targets_tree_menu : Object
943     {
944         public Gtk.Menu el;
945         private ValaProjectSettings  _this;
946
947
948             // my vars (def)
949
950         // ctor
951         public Xcls_targets_tree_menu(ValaProjectSettings _owner )
952         {
953             _this = _owner;
954             _this.targets_tree_menu = this;
955             this.el = new Gtk.Menu();
956
957             // my vars (dec)
958
959             // set gobject values
960             var child_0 = new Xcls_MenuItem29( _this );
961             child_0.ref();
962             this.el.add (  child_0.el  );
963             var child_1 = new Xcls_SeparatorMenuItem30( _this );
964             child_1.ref();
965             this.el.add (  child_1.el  );
966             var child_2 = new Xcls_MenuItem31( _this );
967             child_2.ref();
968             this.el.add (  child_2.el  );
969         }
970
971         // user defined functions
972     }
973     public class Xcls_MenuItem29 : Object
974     {
975         public Gtk.MenuItem el;
976         private ValaProjectSettings  _this;
977
978
979             // my vars (def)
980
981         // ctor
982         public Xcls_MenuItem29(ValaProjectSettings _owner )
983         {
984             _this = _owner;
985             this.el = new Gtk.MenuItem();
986
987             // my vars (dec)
988
989             // set gobject values
990             this.el.label = "Add Compile Target";
991
992             //listeners
993             this.el.activate.connect( ()  => {
994                 
995                    if (_this.project.compilegroups.has_key("NEW GROUP")) {
996                     return;
997                 }
998                   
999                    // add the directory..
1000                    
1001                    _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
1002                    _this.targets_tree_store.load();
1003             });
1004         }
1005
1006         // user defined functions
1007     }
1008
1009     public class Xcls_SeparatorMenuItem30 : Object
1010     {
1011         public Gtk.SeparatorMenuItem el;
1012         private ValaProjectSettings  _this;
1013
1014
1015             // my vars (def)
1016
1017         // ctor
1018         public Xcls_SeparatorMenuItem30(ValaProjectSettings _owner )
1019         {
1020             _this = _owner;
1021             this.el = new Gtk.SeparatorMenuItem();
1022
1023             // my vars (dec)
1024
1025             // set gobject values
1026         }
1027
1028         // user defined functions
1029     }
1030
1031     public class Xcls_MenuItem31 : Object
1032     {
1033         public Gtk.MenuItem el;
1034         private ValaProjectSettings  _this;
1035
1036
1037             // my vars (def)
1038
1039         // ctor
1040         public Xcls_MenuItem31(ValaProjectSettings _owner )
1041         {
1042             _this = _owner;
1043             this.el = new Gtk.MenuItem();
1044
1045             // my vars (dec)
1046
1047             // set gobject values
1048             this.el.label = "Remove Target";
1049
1050             //listeners
1051             this.el.activate.connect( ()  => {
1052                 
1053                  //
1054                     Gtk.TreeModel mod;
1055                     Gtk.TreeIter iter;
1056                     if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1057                            print("nothing selected\n");
1058                         return;
1059                     }
1060             
1061                         
1062                    // add the directory..
1063                    
1064                    
1065                    GLib.Value val;
1066                     mod.get_value(iter,0, out val);
1067                    var fn =  (string) val;
1068                    
1069                    print("remove: %s\n", fn);
1070                    if (!_this.project.compilegroups.unset(fn)) {
1071                               print("remove failed");
1072                   }
1073                    _this.targets_tree_store.load();
1074             });
1075         }
1076
1077         // user defined functions
1078     }
1079
1080
1081     public class Xcls_targets_tree : Object
1082     {
1083         public Gtk.TreeView el;
1084         private ValaProjectSettings  _this;
1085
1086
1087             // my vars (def)
1088         public string cursor;
1089
1090         // ctor
1091         public Xcls_targets_tree(ValaProjectSettings _owner )
1092         {
1093             _this = _owner;
1094             _this.targets_tree = this;
1095             this.el = new Gtk.TreeView();
1096
1097             // my vars (dec)
1098
1099             // set gobject values
1100             var child_0 = new Xcls_targets_tree_store( _this );
1101             child_0.ref();
1102             this.el.set_model (  child_0.el  );
1103             var child_1 = new Xcls_TreeViewColumn34( _this );
1104             child_1.ref();
1105             this.el.append_column (  child_1.el  );
1106
1107             //listeners
1108             this.el.button_press_event.connect( ( ev) => {
1109                 //console.log("button press?");
1110                
1111                 
1112                 if (ev.type != Gdk.EventType.BUTTON_PRESS  || ev.button != 3) {
1113                     //print("click" + ev.type);
1114                     return false;
1115                 }
1116                 //Gtk.TreePath res;
1117                 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1118                 //    return true;
1119                 //}
1120                  
1121               //  this.el.get_selection().select_path(res);
1122                  
1123                   //if (!this.get('/LeftTreeMenu').el)  { 
1124                   //      this.get('/LeftTreeMenu').init(); 
1125                   //  }
1126                     
1127                  _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1128                  _this.targets_tree_menu.el.show_all();
1129                   _this.targets_tree_menu.el.popup(null, null, null,  3, ev.time);
1130                  //   print("click:" + res.path.to_string());
1131                   return true;
1132             });
1133             this.el.cursor_changed.connect( ( ) => {
1134             
1135                 if (this.cursor != "") {
1136                      // save the values..
1137                  }
1138                  
1139                  // load the new values.
1140                  
1141             
1142                      Gtk.TreeModel mod;
1143                     Gtk.TreeIter iter;
1144                     if (!this.el.get_selection().get_selected(out mod, out iter)) {
1145                         print("nothing selected\n");
1146                         // should disable the right hand side..
1147                         _this.set_vbox.el.hide();
1148                         return;
1149                     }
1150                     _this.set_vbox.el.show();
1151                         
1152                    // add the directory..
1153                    
1154                    
1155                    GLib.Value val;
1156                     mod.get_value(iter,0, out val);
1157                    var fn =  (string) val;
1158                    
1159                    this.cursor = fn;
1160                    var cg = _this.project.compilegroups.get(fn);
1161                    
1162                    _this.build_pack_target.el.set_text(cg.target_bin);
1163                    _this.build_compile_flags.el.set_text(cg.compile_flags);
1164                    _this.set_vbox.cgroup = cg;
1165                    _this.files_tree_store.update();
1166                    
1167                    // load the srouces
1168                    
1169             
1170               });
1171         }
1172
1173         // user defined functions
1174     }
1175     public class Xcls_targets_tree_store : Object
1176     {
1177         public Gtk.ListStore el;
1178         private ValaProjectSettings  _this;
1179
1180
1181             // my vars (def)
1182
1183         // ctor
1184         public Xcls_targets_tree_store(ValaProjectSettings _owner )
1185         {
1186             _this = _owner;
1187             _this.targets_tree_store = this;
1188             this.el = new Gtk.ListStore( 2,     typeof(string),  // 0 key type
1189      typeof(string) // ??
1190       );
1191
1192             // my vars (dec)
1193
1194             // set gobject values
1195         }
1196
1197         // user defined functions
1198         public void load () {
1199          
1200           this.el.clear();
1201           
1202             
1203              var cg = _this.project.compilegroups;
1204              
1205            _this.targets_tree.cursor = "";
1206             Gtk.TreeIter citer;
1207             var iter = cg.map_iterator();
1208            while(iter.next()) {
1209                 var key = iter.get_key();
1210                 if (key == "_default_") {
1211                     continue;
1212                 }
1213             
1214                  this.el.append(out citer);   
1215                  
1216                 this.el.set_value(citer, 0,   key ); // title 
1217                 //this.el.set_value(citer, 1,   items.get(i) );
1218             };
1219             this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1220             _this.set_vbox.el.hide();
1221         }
1222     }
1223
1224     public class Xcls_TreeViewColumn34 : Object
1225     {
1226         public Gtk.TreeViewColumn el;
1227         private ValaProjectSettings  _this;
1228
1229
1230             // my vars (def)
1231
1232         // ctor
1233         public Xcls_TreeViewColumn34(ValaProjectSettings _owner )
1234         {
1235             _this = _owner;
1236             this.el = new Gtk.TreeViewColumn();
1237
1238             // my vars (dec)
1239
1240             // set gobject values
1241             this.el.title = "name";
1242             this.el.resizable = true;
1243             var child_0 = new Xcls_targets_render( _this );
1244             child_0.ref();
1245             this.el.pack_start (  child_0.el , false );
1246
1247             // init method
1248
1249             {
1250                  this.el.add_attribute(_this.targets_render.el , "text", 0 );
1251              }
1252         }
1253
1254         // user defined functions
1255     }
1256     public class Xcls_targets_render : Object
1257     {
1258         public Gtk.CellRendererText el;
1259         private ValaProjectSettings  _this;
1260
1261
1262             // my vars (def)
1263
1264         // ctor
1265         public Xcls_targets_render(ValaProjectSettings _owner )
1266         {
1267             _this = _owner;
1268             _this.targets_render = this;
1269             this.el = new Gtk.CellRendererText();
1270
1271             // my vars (dec)
1272
1273             // set gobject values
1274             this.el.editable = true;
1275
1276             //listeners
1277             this.el.edited.connect( (path, newtext) => {
1278                  
1279                  Gtk.TreeIter  iter;
1280                     _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1281                    GLib.Value gval;
1282                     _this.targets_tree_store.el.get_value(iter,0, out gval);
1283                     var oldval = (string)gval;
1284                    if (oldval == newtext) {
1285                       return;
1286                     }
1287                      var cg = _this.project.compilegroups.get(oldval);
1288                     cg.name = newtext;
1289                     _this.project.compilegroups.unset(oldval);
1290                     _this.project.compilegroups.set(newtext, cg);
1291                    _this.targets_tree_store.load();
1292               });
1293         }
1294
1295         // user defined functions
1296     }
1297
1298
1299
1300
1301     public class Xcls_set_vbox : Object
1302     {
1303         public Gtk.Box el;
1304         private ValaProjectSettings  _this;
1305
1306
1307             // my vars (def)
1308         public Project.GtkValaSettings cgroup;
1309
1310         // ctor
1311         public Xcls_set_vbox(ValaProjectSettings _owner )
1312         {
1313             _this = _owner;
1314             _this.set_vbox = this;
1315             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1316
1317             // my vars (dec)
1318             this.cgroup = null;
1319
1320             // set gobject values
1321             this.el.homogeneous = false;
1322             var child_0 = new Xcls_Label37( _this );
1323             child_0.ref();
1324             this.el.pack_start (  child_0.el , false,false,0 );
1325             var child_1 = new Xcls_build_pack_target( _this );
1326             child_1.ref();
1327             this.el.pack_start (  child_1.el , false,false,0 );
1328             var child_2 = new Xcls_Label39( _this );
1329             child_2.ref();
1330             this.el.pack_start (  child_2.el , false,false,0 );
1331             var child_3 = new Xcls_build_compile_flags( _this );
1332             child_3.ref();
1333             this.el.pack_start (  child_3.el , false,false,0 );
1334             var child_4 = new Xcls_Label41( _this );
1335             child_4.ref();
1336             this.el.pack_start (  child_4.el , false,false,0 );
1337             var child_5 = new Xcls_ScrolledWindow42( _this );
1338             child_5.ref();
1339             this.el.pack_start (  child_5.el , true,true,0 );
1340         }
1341
1342         // user defined functions
1343     }
1344     public class Xcls_Label37 : Object
1345     {
1346         public Gtk.Label el;
1347         private ValaProjectSettings  _this;
1348
1349
1350             // my vars (def)
1351
1352         // ctor
1353         public Xcls_Label37(ValaProjectSettings _owner )
1354         {
1355             _this = _owner;
1356             this.el = new Gtk.Label( "target filename" );
1357
1358             // my vars (dec)
1359
1360             // set gobject values
1361         }
1362
1363         // user defined functions
1364     }
1365
1366     public class Xcls_build_pack_target : Object
1367     {
1368         public Gtk.Entry el;
1369         private ValaProjectSettings  _this;
1370
1371
1372             // my vars (def)
1373
1374         // ctor
1375         public Xcls_build_pack_target(ValaProjectSettings _owner )
1376         {
1377             _this = _owner;
1378             _this.build_pack_target = this;
1379             this.el = new Gtk.Entry();
1380
1381             // my vars (dec)
1382
1383             // set gobject values
1384
1385             //listeners
1386             this.el.changed.connect( ()  => {
1387                     if (_this.targets_tree.cursor.length < 1) {
1388                     return;
1389                 }
1390                 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1391             });
1392         }
1393
1394         // user defined functions
1395     }
1396
1397     public class Xcls_Label39 : Object
1398     {
1399         public Gtk.Label el;
1400         private ValaProjectSettings  _this;
1401
1402
1403             // my vars (def)
1404
1405         // ctor
1406         public Xcls_Label39(ValaProjectSettings _owner )
1407         {
1408             _this = _owner;
1409             this.el = new Gtk.Label( "compile flags" );
1410
1411             // my vars (dec)
1412
1413             // set gobject values
1414         }
1415
1416         // user defined functions
1417     }
1418
1419     public class Xcls_build_compile_flags : Object
1420     {
1421         public Gtk.Entry el;
1422         private ValaProjectSettings  _this;
1423
1424
1425             // my vars (def)
1426
1427         // ctor
1428         public Xcls_build_compile_flags(ValaProjectSettings _owner )
1429         {
1430             _this = _owner;
1431             _this.build_compile_flags = this;
1432             this.el = new Gtk.Entry();
1433
1434             // my vars (dec)
1435
1436             // set gobject values
1437
1438             //listeners
1439             this.el.changed.connect( () => {
1440                 if (_this.targets_tree.cursor.length < 1) {
1441                     return;
1442                 }
1443                 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1444             });
1445         }
1446
1447         // user defined functions
1448     }
1449
1450     public class Xcls_Label41 : Object
1451     {
1452         public Gtk.Label el;
1453         private ValaProjectSettings  _this;
1454
1455
1456             // my vars (def)
1457
1458         // ctor
1459         public Xcls_Label41(ValaProjectSettings _owner )
1460         {
1461             _this = _owner;
1462             this.el = new Gtk.Label( "Files to compile" );
1463
1464             // my vars (dec)
1465
1466             // set gobject values
1467         }
1468
1469         // user defined functions
1470     }
1471
1472     public class Xcls_ScrolledWindow42 : Object
1473     {
1474         public Gtk.ScrolledWindow el;
1475         private ValaProjectSettings  _this;
1476
1477
1478             // my vars (def)
1479
1480         // ctor
1481         public Xcls_ScrolledWindow42(ValaProjectSettings _owner )
1482         {
1483             _this = _owner;
1484             this.el = new Gtk.ScrolledWindow( null, null );
1485
1486             // my vars (dec)
1487
1488             // set gobject values
1489             var child_0 = new Xcls_files_tree( _this );
1490             child_0.ref();
1491             this.el.add (  child_0.el  );
1492         }
1493
1494         // user defined functions
1495     }
1496     public class Xcls_files_tree : Object
1497     {
1498         public Gtk.TreeView el;
1499         private ValaProjectSettings  _this;
1500
1501
1502             // my vars (def)
1503
1504         // ctor
1505         public Xcls_files_tree(ValaProjectSettings _owner )
1506         {
1507             _this = _owner;
1508             this.el = new Gtk.TreeView();
1509
1510             // my vars (dec)
1511
1512             // set gobject values
1513             var child_0 = new Xcls_files_tree_store( _this );
1514             child_0.ref();
1515             this.el.set_model (  child_0.el  );
1516             var child_1 = new Xcls_TreeViewColumn45( _this );
1517             child_1.ref();
1518             this.el.append_column (  child_1.el  );
1519             var child_2 = new Xcls_TreeViewColumn47( _this );
1520             child_2.ref();
1521             this.el.append_column (  child_2.el  );
1522         }
1523
1524         // user defined functions
1525     }
1526     public class Xcls_files_tree_store : Object
1527     {
1528         public Gtk.ListStore el;
1529         private ValaProjectSettings  _this;
1530
1531
1532             // my vars (def)
1533
1534         // ctor
1535         public Xcls_files_tree_store(ValaProjectSettings _owner )
1536         {
1537             _this = _owner;
1538             _this.files_tree_store = this;
1539             this.el = new Gtk.ListStore( 4,     typeof(string),  // 0 file name
1540         typeof(string),  // 0 basename
1541      typeof(string), // type (dir orfile)
1542      typeof(bool)  // is checked.
1543       );
1544
1545             // my vars (dec)
1546
1547             // set gobject values
1548         }
1549
1550         // user defined functions
1551         public void updateDir (string dname, bool bval) {
1552           
1553           Gtk.TreeIter citer;
1554         
1555             var cg =   _this.set_vbox.cgroup;
1556           for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1557                 this.el.iter_nth_child(out citer,null,i);
1558         
1559                 GLib.Value val;
1560                 this.el.get_value(citer,0, out val);
1561                 var fn = (string) val;
1562                 
1563                 if ( Path.get_dirname (fn) == dname) {
1564                 
1565                     this.el.set_value(citer, 3,   bval ); // checked 
1566                    
1567              
1568              
1569                     if (!bval) {
1570                         // renive
1571                         if (cg.sources.contains(fn)) {
1572                             cg.sources.remove(fn);
1573                         }
1574                     } else {
1575                         if (!cg.sources.contains(fn)) {
1576                             cg.sources.add(fn);
1577                         }
1578                     }
1579                     
1580                     
1581                 }
1582             }
1583         
1584         }
1585         public void load () {
1586          
1587               this.el.clear();
1588           
1589             
1590              var def = _this.project.compilegroups.get("_default_");
1591              var items  = def.sources;
1592              
1593              
1594              
1595              
1596          
1597             Gtk.TreeIter citer;
1598         
1599             for(var i =0 ; i < items.size; i++) {
1600             
1601                  var files = _this.project.filesForCompile(items.get(i));
1602                  if (files.size < 1) {
1603                     continue;
1604                  }
1605             
1606                  this.el.append(out citer);   
1607                  
1608                 this.el.set_value(citer, 0,   items.get(i) ); // title 
1609                 this.el.set_value(citer, 1,   "<span foreground=\"green\" font_weight=\"bold\">" + 
1610                             GLib.Markup.escape_text(items.get(i)) + "</span>"
1611                     ); // title 
1612                 print("ADD item %s", items.get(i));
1613                 this.el.set_value(citer, 2,   "dir"); // type         
1614                 this.el.set_value(citer, 3,   false ); // checked 
1615         
1616                
1617                 
1618                  for(var j =0 ; j < files.size; j++) {
1619                     this.el.append(out citer);   
1620                      print("ADD item %s", files.get(j));
1621                     this.el.set_value(citer, 0,   files.get(j) ); // title 
1622                     this.el.set_value(citer, 1,   GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title             
1623                     this.el.set_value(citer, 2,   "file"); // type         
1624                     this.el.set_value(citer, 3,   false ); // checked 
1625         
1626                 }
1627                 
1628                 
1629                 //this.el.set_value(citer, 1,   items.get(i) );
1630             }
1631             this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1632             
1633         }
1634         public void update () {
1635         
1636         
1637             Gtk.TreeIter citer;
1638         
1639             for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1640                 this.el.iter_nth_child(out citer,null,i);
1641         
1642                 GLib.Value val;
1643                 this.el.get_value(citer,0, out val);
1644                 var fn = (string) val;
1645                 
1646                 var active = false;
1647                 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1648                     active = true;
1649                 }
1650                 
1651                 this.el.set_value(citer, 3,   active ); // checked 
1652             }
1653         
1654         
1655         }
1656     }
1657
1658     public class Xcls_TreeViewColumn45 : Object
1659     {
1660         public Gtk.TreeViewColumn el;
1661         private ValaProjectSettings  _this;
1662
1663
1664             // my vars (def)
1665
1666         // ctor
1667         public Xcls_TreeViewColumn45(ValaProjectSettings _owner )
1668         {
1669             _this = _owner;
1670             this.el = new Gtk.TreeViewColumn();
1671
1672             // my vars (dec)
1673
1674             // set gobject values
1675             this.el.title = "name";
1676             this.el.resizable = true;
1677             var child_0 = new Xcls_files_render( _this );
1678             child_0.ref();
1679             this.el.pack_start (  child_0.el , false );
1680
1681             // init method
1682
1683             this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1684              
1685             /*  this.el.add_attribute(_this.files_render.el , "markup", 2 );
1686             */
1687         }
1688
1689         // user defined functions
1690     }
1691     public class Xcls_files_render : Object
1692     {
1693         public Gtk.CellRendererText el;
1694         private ValaProjectSettings  _this;
1695
1696
1697             // my vars (def)
1698
1699         // ctor
1700         public Xcls_files_render(ValaProjectSettings _owner )
1701         {
1702             _this = _owner;
1703             _this.files_render = this;
1704             this.el = new Gtk.CellRendererText();
1705
1706             // my vars (dec)
1707
1708             // set gobject values
1709         }
1710
1711         // user defined functions
1712     }
1713
1714
1715     public class Xcls_TreeViewColumn47 : Object
1716     {
1717         public Gtk.TreeViewColumn el;
1718         private ValaProjectSettings  _this;
1719
1720
1721             // my vars (def)
1722
1723         // ctor
1724         public Xcls_TreeViewColumn47(ValaProjectSettings _owner )
1725         {
1726             _this = _owner;
1727             this.el = new Gtk.TreeViewColumn();
1728
1729             // my vars (dec)
1730
1731             // set gobject values
1732             this.el.title = "use";
1733             this.el.resizable = false;
1734             this.el.fixed_width = 50;
1735             var child_0 = new Xcls_files_render_use( _this );
1736             child_0.ref();
1737             this.el.pack_start (  child_0.el , false );
1738
1739             // init method
1740
1741             {
1742              this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1743              }
1744         }
1745
1746         // user defined functions
1747     }
1748     public class Xcls_files_render_use : Object
1749     {
1750         public Gtk.CellRendererToggle el;
1751         private ValaProjectSettings  _this;
1752
1753
1754             // my vars (def)
1755
1756         // ctor
1757         public Xcls_files_render_use(ValaProjectSettings _owner )
1758         {
1759             _this = _owner;
1760             _this.files_render_use = this;
1761             this.el = new Gtk.CellRendererToggle();
1762
1763             // my vars (dec)
1764
1765             // set gobject values
1766             this.el.activatable = true;
1767
1768             //listeners
1769             this.el.toggled.connect( (  path_string) =>  { 
1770             
1771             
1772             
1773                 var m = _this.files_tree_store.el;
1774                Gtk.TreeIter iter;
1775                Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1776                m.get_iter (out iter, path);
1777                GLib.Value val;
1778                m.get_value(iter, 3, out val);
1779                m.set_value(iter, 3,  ((bool) val) ? false :true); 
1780                
1781                // type.
1782                GLib.Value ftval;  
1783                m.get_value(iter, 2, out ftval);
1784                var ftype = (string)ftval;   
1785                
1786                // full name...  
1787                GLib.Value fval;     
1788                m.get_value(iter, 0, out fval);
1789                var fn = (string)fval;
1790                 
1791                 
1792                 var cg =   _this.set_vbox.cgroup;
1793                 // what's the sleected target?
1794                 // update the list..
1795                 // if ftype is a dir == then toggle all the bellow.
1796                 
1797                 if (ftype == "dir") {
1798                     _this.files_tree_store.updateDir(fn,  ((bool) val) ? false :true);
1799                 }
1800                 
1801                 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1802             
1803                  
1804                 if ((bool)val) {
1805                     // renive
1806                     cg.sources.remove(fn);
1807                 } else {
1808                     cg.sources.add(fn);
1809                 }
1810                 
1811             });
1812         }
1813
1814         // user defined functions
1815     }
1816
1817
1818
1819
1820
1821
1822
1823 }