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