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