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