1 static ValaProjectSettings _ValaProjectSettings;
3 public class ValaProjectSettings : Object
6 private ValaProjectSettings _this;
8 public static ValaProjectSettings singleton()
10 if (_ValaProjectSettings == null) {
11 _ValaProjectSettings= new ValaProjectSettings();
13 return _ValaProjectSettings;
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;
37 public Project.Gtk project;
38 public Xcls_MainWindow window;
41 public ValaProjectSettings()
44 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
51 this.el.hexpand = true;
52 var child_0 = new Xcls_Notebook2( _this );
54 this.el.pack_start ( child_0.el , true,true,0 );
57 // user defined functions
58 public void show (Project.Gtk project) {
61 print("ValaProjectSettings show\n");
63 this.project= project;
65 this.compile_flags.el.text = _this.project.compilegroups.get("_default_").compile_flags;
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();
74 this.project.writeConfig();
76 public class Xcls_Notebook2 : Object
78 public Gtk.Notebook el;
79 private ValaProjectSettings _this;
85 public Xcls_Notebook2(ValaProjectSettings _owner )
88 this.el = new Gtk.Notebook();
93 var child_0 = new Xcls_label_global( _this );
95 var child_1 = new Xcls_label_targets( _this );
97 var child_2 = new Xcls_Box5( _this );
99 this.el.append_page ( child_2.el , _this.label_global.el );
100 var child_3 = new Xcls_Paned26( _this );
102 this.el.append_page ( child_3.el , _this.label_targets.el );
105 // user defined functions
107 public class Xcls_label_global : Object
110 private ValaProjectSettings _this;
116 public Xcls_label_global(ValaProjectSettings _owner )
119 _this.label_global = this;
120 this.el = new Gtk.Label( "Global" );
124 // set gobject values
127 // user defined functions
130 public class Xcls_label_targets : Object
133 private ValaProjectSettings _this;
139 public Xcls_label_targets(ValaProjectSettings _owner )
142 _this.label_targets = this;
143 this.el = new Gtk.Label( "Targets" );
147 // set gobject values
150 // user defined functions
153 public class Xcls_Box5 : Object
156 private ValaProjectSettings _this;
162 public Xcls_Box5(ValaProjectSettings _owner )
165 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
169 // set gobject values
170 this.el.homogeneous = false;
171 var child_0 = new Xcls_Label6( _this );
173 this.el.pack_start ( child_0.el , false,false,0 );
174 var child_1 = new Xcls_compile_flags( _this );
176 this.el.pack_start ( child_1.el , false,false,0 );
177 var child_2 = new Xcls_Paned8( _this );
179 this.el.pack_start ( child_2.el , true,true,0 );
182 // user defined functions
184 public class Xcls_Label6 : Object
187 private ValaProjectSettings _this;
193 public Xcls_Label6(ValaProjectSettings _owner )
196 this.el = new Gtk.Label( "compile flags" );
200 // set gobject values
203 // user defined functions
206 public class Xcls_compile_flags : Object
209 private ValaProjectSettings _this;
215 public Xcls_compile_flags(ValaProjectSettings _owner )
218 _this.compile_flags = this;
219 this.el = new Gtk.Entry();
223 // set gobject values
224 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
227 this.el.changed.connect( () => {
229 _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
230 _this.project.writeConfig();
231 // _this.project.save();
236 // user defined functions
239 public class Xcls_Paned8 : Object
242 private ValaProjectSettings _this;
248 public Xcls_Paned8(ValaProjectSettings _owner )
251 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
255 // set gobject values
256 var child_0 = new Xcls_ScrolledWindow9( _this );
258 this.el.add ( child_0.el );
259 var child_1 = new Xcls_ScrolledWindow16( _this );
261 this.el.add ( child_1.el );
264 // user defined functions
266 public class Xcls_ScrolledWindow9 : Object
268 public Gtk.ScrolledWindow el;
269 private ValaProjectSettings _this;
275 public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
278 this.el = new Gtk.ScrolledWindow( null, null );
282 // set gobject values
283 var child_0 = new Xcls_default_packages_tree( _this );
285 this.el.add ( child_0.el );
288 // user defined functions
290 public class Xcls_default_packages_tree : Object
292 public Gtk.TreeView el;
293 private ValaProjectSettings _this;
299 public Xcls_default_packages_tree(ValaProjectSettings _owner )
302 this.el = new Gtk.TreeView();
306 // set gobject values
307 this.el.headers_visible = true;
308 var child_0 = new Xcls_default_packages_tree_store( _this );
310 this.el.set_model ( child_0.el );
311 var child_1 = new Xcls_TreeViewColumn12( _this );
313 this.el.append_column ( child_1.el );
314 var child_2 = new Xcls_TreeViewColumn14( _this );
316 this.el.append_column ( child_2.el );
319 // user defined functions
321 public class Xcls_default_packages_tree_store : Object
323 public Gtk.ListStore el;
324 private ValaProjectSettings _this;
330 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
333 _this.default_packages_tree_store = this;
334 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
339 // set gobject values
342 // user defined functions
343 public void load () {
345 var def = _this.project.compilegroups.get("_default_");
346 var items = def.packages;
349 var pal = (Palete.Gtk) Palete.factory("Gtk");
350 var pkgs = pal.packages(_this.project);
351 print("ValaProjectSettings:packages load %d\n", pkgs.size);
355 for(var i =0 ; i < pkgs.size; i++) {
356 this.el.append(out citer);
358 this.el.set_value(citer, 0, pkgs.get(i) ); // title
359 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
361 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
366 public class Xcls_TreeViewColumn12 : Object
368 public Gtk.TreeViewColumn el;
369 private ValaProjectSettings _this;
375 public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
378 this.el = new Gtk.TreeViewColumn();
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 );
388 this.el.pack_start ( child_0.el , false );
392 this.el.add_attribute(_this.packages_render.el , "text", 0 );
395 // user defined functions
397 public class Xcls_packages_render : Object
399 public Gtk.CellRendererText el;
400 private ValaProjectSettings _this;
406 public Xcls_packages_render(ValaProjectSettings _owner )
409 _this.packages_render = this;
410 this.el = new Gtk.CellRendererText();
414 // set gobject values
417 // user defined functions
421 public class Xcls_TreeViewColumn14 : Object
423 public Gtk.TreeViewColumn el;
424 private ValaProjectSettings _this;
430 public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
433 this.el = new Gtk.TreeViewColumn();
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 );
443 this.el.pack_start ( child_0.el , false );
448 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
452 // user defined functions
454 public class Xcls_packages_render_use : Object
456 public Gtk.CellRendererToggle el;
457 private ValaProjectSettings _this;
463 public Xcls_packages_render_use(ValaProjectSettings _owner )
466 _this.packages_render_use = this;
467 this.el = new Gtk.CellRendererToggle();
471 // set gobject values
472 this.el.activatable = true;
475 this.el.toggled.connect( ( path_string) => {
476 var m = _this.default_packages_tree_store.el;
478 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
479 m.get_iter (out iter, path);
481 m.get_value(iter, 1, out val);
482 m.set_value(iter, 1, ((bool) val) ? false :true);
484 m.get_value(iter, 0, out fval);
485 var fn = (string)fval;
487 var def = _this.project.compilegroups.get("_default_");
488 var items = def.packages;
499 // user defined functions
505 public class Xcls_ScrolledWindow16 : Object
507 public Gtk.ScrolledWindow el;
508 private ValaProjectSettings _this;
514 public Xcls_ScrolledWindow16(ValaProjectSettings _owner )
517 this.el = new Gtk.ScrolledWindow( null, null );
521 // set gobject values
522 var child_0 = new Xcls_default_directory_tree( _this );
524 this.el.add ( child_0.el );
525 var child_1 = new Xcls_default_directory_menu( _this );
529 // user defined functions
531 public class Xcls_default_directory_tree : Object
533 public Gtk.TreeView el;
534 private ValaProjectSettings _this;
540 public Xcls_default_directory_tree(ValaProjectSettings _owner )
543 _this.default_directory_tree = this;
544 this.el = new Gtk.TreeView();
548 // set gobject values
549 this.el.headers_visible = true;
550 var child_0 = new Xcls_default_directory_tree_store( _this );
552 this.el.set_model ( child_0.el );
553 var child_1 = new Xcls_TreeViewColumn19( _this );
555 this.el.append_column ( child_1.el );
558 this.el.button_press_event.connect( ( ev) => {
559 //console.log("button press?");
562 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
563 //print("click" + ev.type);
567 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
571 // this.el.get_selection().select_path(res);
573 //if (!this.get('/LeftTreeMenu').el) {
574 // this.get('/LeftTreeMenu').init();
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());
585 // user defined functions
587 public class Xcls_default_directory_tree_store : Object
589 public Gtk.ListStore el;
590 private ValaProjectSettings _this;
596 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
599 _this.default_directory_tree_store = this;
600 this.el = new Gtk.ListStore( 1, typeof(string)
605 // set gobject values
608 // user defined functions
609 public void load () {
614 var def = _this.project.compilegroups.get("_default_");
615 var items = def.sources;
620 for(var i =0 ; i < items.size; i++) {
621 this.el.append(out citer);
623 this.el.set_value(citer, 0, items.get(i) ); // title
624 //this.el.set_value(citer, 1, items.get(i) );
626 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
631 public class Xcls_TreeViewColumn19 : Object
633 public Gtk.TreeViewColumn el;
634 private ValaProjectSettings _this;
640 public Xcls_TreeViewColumn19(ValaProjectSettings _owner )
643 this.el = new Gtk.TreeViewColumn();
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 );
652 this.el.pack_start ( child_0.el , false );
656 this.el.add_attribute(_this.directory_render.el , "text", 0 );
659 // user defined functions
661 public class Xcls_directory_render : Object
663 public Gtk.CellRendererText el;
664 private ValaProjectSettings _this;
670 public Xcls_directory_render(ValaProjectSettings _owner )
673 _this.directory_render = this;
674 this.el = new Gtk.CellRendererText();
678 // set gobject values
681 // user defined functions
686 public class Xcls_default_directory_menu : Object
689 private ValaProjectSettings _this;
695 public Xcls_default_directory_menu(ValaProjectSettings _owner )
698 _this.default_directory_menu = this;
699 this.el = new Gtk.Menu();
703 // set gobject values
704 var child_0 = new Xcls_MenuItem22( _this );
706 this.el.add ( child_0.el );
707 var child_1 = new Xcls_MenuItem23( _this );
709 this.el.add ( child_1.el );
710 var child_2 = new Xcls_SeparatorMenuItem24( _this );
712 this.el.add ( child_2.el );
713 var child_3 = new Xcls_MenuItem25( _this );
715 this.el.add ( child_3.el );
718 // user defined functions
720 public class Xcls_MenuItem22 : Object
722 public Gtk.MenuItem el;
723 private ValaProjectSettings _this;
729 public Xcls_MenuItem22(ValaProjectSettings _owner )
732 this.el = new Gtk.MenuItem();
736 // set gobject values
737 this.el.label = "Add Directory";
740 this.el.activate.connect( () => {
742 var chooser = new Gtk.FileChooserDialog (
743 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
745 Gtk.ResponseType.CANCEL,
747 Gtk.ResponseType.ACCEPT);
748 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
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();
760 // user defined functions
763 public class Xcls_MenuItem23 : Object
765 public Gtk.MenuItem el;
766 private ValaProjectSettings _this;
772 public Xcls_MenuItem23(ValaProjectSettings _owner )
775 this.el = new Gtk.MenuItem();
779 // set gobject values
780 this.el.label = "Add File";
783 this.el.activate.connect( () => {
785 var chooser = new Gtk.FileChooserDialog (
786 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
788 Gtk.ResponseType.CANCEL,
790 Gtk.ResponseType.ACCEPT);
791 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
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();
803 // user defined functions
806 public class Xcls_SeparatorMenuItem24 : Object
808 public Gtk.SeparatorMenuItem el;
809 private ValaProjectSettings _this;
815 public Xcls_SeparatorMenuItem24(ValaProjectSettings _owner )
818 this.el = new Gtk.SeparatorMenuItem();
822 // set gobject values
825 // user defined functions
828 public class Xcls_MenuItem25 : Object
830 public Gtk.MenuItem el;
831 private ValaProjectSettings _this;
837 public Xcls_MenuItem25(ValaProjectSettings _owner )
840 this.el = new Gtk.MenuItem();
844 // set gobject values
845 this.el.label = "Remove File/Directory";
848 this.el.activate.connect( () => {
853 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
854 print("nothing selected\n");
859 // add the directory..
863 mod.get_value(iter,0, out val);
864 var fn = (string) val;
866 print("remove: %s\n", fn);
867 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
868 print("remove failed");
870 _this.default_directory_tree_store.load();
874 // user defined functions
881 public class Xcls_Paned26 : Object
884 private ValaProjectSettings _this;
890 public Xcls_Paned26(ValaProjectSettings _owner )
893 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
897 // set gobject values
898 this.el.position = 300;
899 var child_0 = new Xcls_ScrolledWindow27( _this );
901 this.el.add1 ( child_0.el );
902 var child_1 = new Xcls_set_vbox( _this );
904 this.el.add2 ( child_1.el );
907 // user defined functions
909 public class Xcls_ScrolledWindow27 : Object
911 public Gtk.ScrolledWindow el;
912 private ValaProjectSettings _this;
918 public Xcls_ScrolledWindow27(ValaProjectSettings _owner )
921 this.el = new Gtk.ScrolledWindow( null, null );
925 // set gobject values
926 var child_0 = new Xcls_targets_tree_menu( _this );
928 this.el.add ( child_0.el );
929 var child_1 = new Xcls_targets_tree( _this );
931 this.el.add ( child_1.el );
936 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
941 // user defined functions
943 public class Xcls_targets_tree_menu : Object
946 private ValaProjectSettings _this;
952 public Xcls_targets_tree_menu(ValaProjectSettings _owner )
955 _this.targets_tree_menu = this;
956 this.el = new Gtk.Menu();
960 // set gobject values
961 var child_0 = new Xcls_MenuItem29( _this );
963 this.el.add ( child_0.el );
964 var child_1 = new Xcls_SeparatorMenuItem30( _this );
966 this.el.add ( child_1.el );
967 var child_2 = new Xcls_MenuItem31( _this );
969 this.el.add ( child_2.el );
972 // user defined functions
974 public class Xcls_MenuItem29 : Object
976 public Gtk.MenuItem el;
977 private ValaProjectSettings _this;
983 public Xcls_MenuItem29(ValaProjectSettings _owner )
986 this.el = new Gtk.MenuItem();
990 // set gobject values
991 this.el.label = "Add Compile Target";
994 this.el.activate.connect( () => {
996 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1000 // add the directory..
1002 _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
1003 _this.targets_tree_store.load();
1007 // user defined functions
1010 public class Xcls_SeparatorMenuItem30 : Object
1012 public Gtk.SeparatorMenuItem el;
1013 private ValaProjectSettings _this;
1019 public Xcls_SeparatorMenuItem30(ValaProjectSettings _owner )
1022 this.el = new Gtk.SeparatorMenuItem();
1026 // set gobject values
1029 // user defined functions
1032 public class Xcls_MenuItem31 : Object
1034 public Gtk.MenuItem el;
1035 private ValaProjectSettings _this;
1041 public Xcls_MenuItem31(ValaProjectSettings _owner )
1044 this.el = new Gtk.MenuItem();
1048 // set gobject values
1049 this.el.label = "Remove Target";
1052 this.el.activate.connect( () => {
1057 if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1058 print("nothing selected\n");
1063 // add the directory..
1067 mod.get_value(iter,0, out val);
1068 var fn = (string) val;
1070 print("remove: %s\n", fn);
1071 if (!_this.project.compilegroups.unset(fn)) {
1072 print("remove failed");
1074 _this.targets_tree_store.load();
1078 // user defined functions
1082 public class Xcls_targets_tree : Object
1084 public Gtk.TreeView el;
1085 private ValaProjectSettings _this;
1089 public string cursor;
1092 public Xcls_targets_tree(ValaProjectSettings _owner )
1095 _this.targets_tree = this;
1096 this.el = new Gtk.TreeView();
1100 // set gobject values
1101 var child_0 = new Xcls_targets_tree_store( _this );
1103 this.el.set_model ( child_0.el );
1104 var child_1 = new Xcls_TreeViewColumn34( _this );
1106 this.el.append_column ( child_1.el );
1109 this.el.button_press_event.connect( ( ev) => {
1110 //console.log("button press?");
1113 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
1114 //print("click" + ev.type);
1118 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1122 // this.el.get_selection().select_path(res);
1124 //if (!this.get('/LeftTreeMenu').el) {
1125 // this.get('/LeftTreeMenu').init();
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());
1134 this.el.cursor_changed.connect( ( ) => {
1136 if (this.cursor != "") {
1137 // save the values..
1140 // load the new values.
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();
1151 _this.set_vbox.el.show();
1153 // add the directory..
1157 mod.get_value(iter,0, out val);
1158 var fn = (string) val;
1161 var cg = _this.project.compilegroups.get(fn);
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();
1174 // user defined functions
1176 public class Xcls_targets_tree_store : Object
1178 public Gtk.ListStore el;
1179 private ValaProjectSettings _this;
1185 public Xcls_targets_tree_store(ValaProjectSettings _owner )
1188 _this.targets_tree_store = this;
1189 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1190 typeof(string) // ??
1195 // set gobject values
1198 // user defined functions
1199 public void load () {
1204 var cg = _this.project.compilegroups;
1206 _this.targets_tree.cursor = "";
1208 var iter = cg.map_iterator();
1209 while(iter.next()) {
1210 var key = iter.get_key();
1211 if (key == "_default_") {
1215 this.el.append(out citer);
1217 this.el.set_value(citer, 0, key ); // title
1218 //this.el.set_value(citer, 1, items.get(i) );
1220 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1221 _this.set_vbox.el.hide();
1225 public class Xcls_TreeViewColumn34 : Object
1227 public Gtk.TreeViewColumn el;
1228 private ValaProjectSettings _this;
1234 public Xcls_TreeViewColumn34(ValaProjectSettings _owner )
1237 this.el = new Gtk.TreeViewColumn();
1241 // set gobject values
1242 this.el.title = "name";
1243 this.el.resizable = true;
1244 var child_0 = new Xcls_targets_render( _this );
1246 this.el.pack_start ( child_0.el , false );
1251 this.el.add_attribute(_this.targets_render.el , "text", 0 );
1255 // user defined functions
1257 public class Xcls_targets_render : Object
1259 public Gtk.CellRendererText el;
1260 private ValaProjectSettings _this;
1266 public Xcls_targets_render(ValaProjectSettings _owner )
1269 _this.targets_render = this;
1270 this.el = new Gtk.CellRendererText();
1274 // set gobject values
1275 this.el.editable = true;
1278 this.el.edited.connect( (path, newtext) => {
1281 _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1283 _this.targets_tree_store.el.get_value(iter,0, out gval);
1284 var oldval = (string)gval;
1285 if (oldval == newtext) {
1288 var cg = _this.project.compilegroups.get(oldval);
1290 _this.project.compilegroups.unset(oldval);
1291 _this.project.compilegroups.set(newtext, cg);
1292 _this.targets_tree_store.load();
1296 // user defined functions
1302 public class Xcls_set_vbox : Object
1305 private ValaProjectSettings _this;
1309 public Project.GtkValaSettings cgroup;
1312 public Xcls_set_vbox(ValaProjectSettings _owner )
1315 _this.set_vbox = this;
1316 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1321 // set gobject values
1322 this.el.homogeneous = false;
1323 var child_0 = new Xcls_Label37( _this );
1325 this.el.pack_start ( child_0.el , false,false,0 );
1326 var child_1 = new Xcls_build_pack_target( _this );
1328 this.el.pack_start ( child_1.el , false,false,0 );
1329 var child_2 = new Xcls_Label39( _this );
1331 this.el.pack_start ( child_2.el , false,false,0 );
1332 var child_3 = new Xcls_build_compile_flags( _this );
1334 this.el.pack_start ( child_3.el , false,false,0 );
1335 var child_4 = new Xcls_Label41( _this );
1337 this.el.pack_start ( child_4.el , false,false,0 );
1338 var child_5 = new Xcls_ScrolledWindow42( _this );
1340 this.el.pack_start ( child_5.el , true,true,0 );
1343 // user defined functions
1345 public class Xcls_Label37 : Object
1347 public Gtk.Label el;
1348 private ValaProjectSettings _this;
1354 public Xcls_Label37(ValaProjectSettings _owner )
1357 this.el = new Gtk.Label( "target filename" );
1361 // set gobject values
1364 // user defined functions
1367 public class Xcls_build_pack_target : Object
1369 public Gtk.Entry el;
1370 private ValaProjectSettings _this;
1376 public Xcls_build_pack_target(ValaProjectSettings _owner )
1379 _this.build_pack_target = this;
1380 this.el = new Gtk.Entry();
1384 // set gobject values
1387 this.el.changed.connect( () => {
1388 if (_this.targets_tree.cursor.length < 1) {
1391 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1395 // user defined functions
1398 public class Xcls_Label39 : Object
1400 public Gtk.Label el;
1401 private ValaProjectSettings _this;
1407 public Xcls_Label39(ValaProjectSettings _owner )
1410 this.el = new Gtk.Label( "compile flags" );
1414 // set gobject values
1417 // user defined functions
1420 public class Xcls_build_compile_flags : Object
1422 public Gtk.Entry el;
1423 private ValaProjectSettings _this;
1429 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1432 _this.build_compile_flags = this;
1433 this.el = new Gtk.Entry();
1437 // set gobject values
1440 this.el.changed.connect( () => {
1441 if (_this.targets_tree.cursor.length < 1) {
1444 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1448 // user defined functions
1451 public class Xcls_Label41 : Object
1453 public Gtk.Label el;
1454 private ValaProjectSettings _this;
1460 public Xcls_Label41(ValaProjectSettings _owner )
1463 this.el = new Gtk.Label( "Files to compile" );
1467 // set gobject values
1470 // user defined functions
1473 public class Xcls_ScrolledWindow42 : Object
1475 public Gtk.ScrolledWindow el;
1476 private ValaProjectSettings _this;
1482 public Xcls_ScrolledWindow42(ValaProjectSettings _owner )
1485 this.el = new Gtk.ScrolledWindow( null, null );
1489 // set gobject values
1490 var child_0 = new Xcls_files_tree( _this );
1492 this.el.add ( child_0.el );
1495 // user defined functions
1497 public class Xcls_files_tree : Object
1499 public Gtk.TreeView el;
1500 private ValaProjectSettings _this;
1506 public Xcls_files_tree(ValaProjectSettings _owner )
1509 this.el = new Gtk.TreeView();
1513 // set gobject values
1514 var child_0 = new Xcls_files_tree_store( _this );
1516 this.el.set_model ( child_0.el );
1517 var child_1 = new Xcls_TreeViewColumn45( _this );
1519 this.el.append_column ( child_1.el );
1520 var child_2 = new Xcls_TreeViewColumn47( _this );
1522 this.el.append_column ( child_2.el );
1525 // user defined functions
1527 public class Xcls_files_tree_store : Object
1529 public Gtk.ListStore el;
1530 private ValaProjectSettings _this;
1536 public Xcls_files_tree_store(ValaProjectSettings _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.
1548 // set gobject values
1551 // user defined functions
1552 public void updateDir (string dname, bool bval) {
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);
1561 this.el.get_value(citer,0, out val);
1562 var fn = (string) val;
1564 if ( Path.get_dirname (fn) == dname) {
1566 this.el.set_value(citer, 3, bval ); // checked
1572 if (cg.sources.contains(fn)) {
1573 cg.sources.remove(fn);
1576 if (!cg.sources.contains(fn)) {
1586 public void load () {
1591 var def = _this.project.compilegroups.get("_default_");
1592 var items = def.sources;
1600 for(var i =0 ; i < items.size; i++) {
1602 var files = _this.project.filesForCompile(items.get(i), false);
1603 if (files.size < 1) {
1607 this.el.append(out citer);
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>"
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
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
1630 //this.el.set_value(citer, 1, items.get(i) );
1632 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1635 public void update () {
1640 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1641 this.el.iter_nth_child(out citer,null,i);
1644 this.el.get_value(citer,0, out val);
1645 var fn = (string) val;
1648 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1652 this.el.set_value(citer, 3, active ); // checked
1659 public class Xcls_TreeViewColumn45 : Object
1661 public Gtk.TreeViewColumn el;
1662 private ValaProjectSettings _this;
1668 public Xcls_TreeViewColumn45(ValaProjectSettings _owner )
1671 this.el = new Gtk.TreeViewColumn();
1675 // set gobject values
1676 this.el.title = "name";
1677 this.el.resizable = true;
1678 var child_0 = new Xcls_files_render( _this );
1680 this.el.pack_start ( child_0.el , false );
1684 this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1686 /* this.el.add_attribute(_this.files_render.el , "markup", 2 );
1690 // user defined functions
1692 public class Xcls_files_render : Object
1694 public Gtk.CellRendererText el;
1695 private ValaProjectSettings _this;
1701 public Xcls_files_render(ValaProjectSettings _owner )
1704 _this.files_render = this;
1705 this.el = new Gtk.CellRendererText();
1709 // set gobject values
1712 // user defined functions
1716 public class Xcls_TreeViewColumn47 : Object
1718 public Gtk.TreeViewColumn el;
1719 private ValaProjectSettings _this;
1725 public Xcls_TreeViewColumn47(ValaProjectSettings _owner )
1728 this.el = new Gtk.TreeViewColumn();
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 );
1738 this.el.pack_start ( child_0.el , false );
1743 this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1747 // user defined functions
1749 public class Xcls_files_render_use : Object
1751 public Gtk.CellRendererToggle el;
1752 private ValaProjectSettings _this;
1758 public Xcls_files_render_use(ValaProjectSettings _owner )
1761 _this.files_render_use = this;
1762 this.el = new Gtk.CellRendererToggle();
1766 // set gobject values
1767 this.el.activatable = true;
1770 this.el.toggled.connect( ( path_string) => {
1774 var m = _this.files_tree_store.el;
1776 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1777 m.get_iter (out iter, path);
1779 m.get_value(iter, 3, out val);
1780 m.set_value(iter, 3, ((bool) val) ? false :true);
1784 m.get_value(iter, 2, out ftval);
1785 var ftype = (string)ftval;
1789 m.get_value(iter, 0, out fval);
1790 var fn = (string)fval;
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.
1798 if (ftype == "dir") {
1799 _this.files_tree_store.updateDir(fn, ((bool) val) ? false :true);
1802 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1807 cg.sources.remove(fn);
1815 // user defined functions