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