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