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_build_execute_args build_execute_args;
33 public Xcls_files_tree_store files_tree_store;
34 public Xcls_files_render files_render;
35 public Xcls_files_render_use files_render_use;
38 public Project.Gtk project;
39 public Xcls_MainWindow window;
42 public ValaProjectSettings()
45 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
52 this.el.hexpand = true;
53 var child_0 = new Xcls_Notebook2( _this );
55 this.el.pack_start ( child_0.el , true,true,0 );
58 // user defined functions
59 public void show (Project.Gtk project) {
62 print("ValaProjectSettings show\n");
64 this.project= project;
66 this.compile_flags.el.text = _this.project.compilegroups.get("_default_").compile_flags;
68 this.default_directory_tree_store.load();
69 this.default_packages_tree_store.load();
70 this.targets_tree_store.load();
71 this.files_tree_store.load();
75 this.project.writeConfig();
77 public class Xcls_Notebook2 : Object
79 public Gtk.Notebook el;
80 private ValaProjectSettings _this;
86 public Xcls_Notebook2(ValaProjectSettings _owner )
89 this.el = new Gtk.Notebook();
94 var child_0 = new Xcls_label_global( _this );
96 var child_1 = new Xcls_label_targets( _this );
98 var child_2 = new Xcls_Box5( _this );
100 this.el.append_page ( child_2.el , _this.label_global.el );
101 var child_3 = new Xcls_Paned26( _this );
103 this.el.append_page ( child_3.el , _this.label_targets.el );
106 // user defined functions
108 public class Xcls_label_global : Object
111 private ValaProjectSettings _this;
117 public Xcls_label_global(ValaProjectSettings _owner )
120 _this.label_global = this;
121 this.el = new Gtk.Label( "Global" );
125 // set gobject values
128 // user defined functions
131 public class Xcls_label_targets : Object
134 private ValaProjectSettings _this;
140 public Xcls_label_targets(ValaProjectSettings _owner )
143 _this.label_targets = this;
144 this.el = new Gtk.Label( "Targets" );
148 // set gobject values
151 // user defined functions
154 public class Xcls_Box5 : Object
157 private ValaProjectSettings _this;
163 public Xcls_Box5(ValaProjectSettings _owner )
166 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
170 // set gobject values
171 this.el.homogeneous = false;
172 var child_0 = new Xcls_Label6( _this );
174 this.el.pack_start ( child_0.el , false,false,0 );
175 var child_1 = new Xcls_compile_flags( _this );
177 this.el.pack_start ( child_1.el , false,false,0 );
178 var child_2 = new Xcls_Paned8( _this );
180 this.el.pack_start ( child_2.el , true,true,0 );
183 // user defined functions
185 public class Xcls_Label6 : Object
188 private ValaProjectSettings _this;
194 public Xcls_Label6(ValaProjectSettings _owner )
197 this.el = new Gtk.Label( "compile flags" );
201 // set gobject values
204 // user defined functions
207 public class Xcls_compile_flags : Object
210 private ValaProjectSettings _this;
216 public Xcls_compile_flags(ValaProjectSettings _owner )
219 _this.compile_flags = this;
220 this.el = new Gtk.Entry();
224 // set gobject values
225 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
228 this.el.changed.connect( () => {
230 _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
231 _this.project.writeConfig();
232 // _this.project.save();
237 // user defined functions
240 public class Xcls_Paned8 : Object
243 private ValaProjectSettings _this;
249 public Xcls_Paned8(ValaProjectSettings _owner )
252 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
256 // set gobject values
257 this.el.position = 300;
258 var child_0 = new Xcls_ScrolledWindow9( _this );
260 this.el.add ( child_0.el );
261 var child_1 = new Xcls_ScrolledWindow16( _this );
263 this.el.add2 ( child_1.el );
266 // user defined functions
268 public class Xcls_ScrolledWindow9 : Object
270 public Gtk.ScrolledWindow el;
271 private ValaProjectSettings _this;
277 public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
280 this.el = new Gtk.ScrolledWindow( null, null );
284 // set gobject values
285 this.el.hexpand = true;
286 var child_0 = new Xcls_default_packages_tree( _this );
288 this.el.add ( child_0.el );
291 // user defined functions
293 public class Xcls_default_packages_tree : Object
295 public Gtk.TreeView el;
296 private ValaProjectSettings _this;
302 public Xcls_default_packages_tree(ValaProjectSettings _owner )
305 this.el = new Gtk.TreeView();
309 // set gobject values
310 this.el.headers_visible = true;
311 var child_0 = new Xcls_default_packages_tree_store( _this );
313 this.el.set_model ( child_0.el );
314 var child_1 = new Xcls_TreeViewColumn12( _this );
316 this.el.append_column ( child_1.el );
317 var child_2 = new Xcls_TreeViewColumn14( _this );
319 this.el.append_column ( child_2.el );
322 // user defined functions
324 public class Xcls_default_packages_tree_store : Object
326 public Gtk.ListStore el;
327 private ValaProjectSettings _this;
333 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
336 _this.default_packages_tree_store = this;
337 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
342 // set gobject values
345 // user defined functions
346 public void load () {
348 var def = _this.project.compilegroups.get("_default_");
349 var items = def.packages;
352 var pal = (Palete.Gtk) Palete.factory("Gtk");
353 var pkgs = pal.packages(_this.project);
354 print("ValaProjectSettings:packages load %d\n", pkgs.size);
358 for(var i =0 ; i < pkgs.size; i++) {
359 this.el.append(out citer);
361 this.el.set_value(citer, 0, pkgs.get(i) ); // title
362 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
364 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
369 public class Xcls_TreeViewColumn12 : Object
371 public Gtk.TreeViewColumn el;
372 private ValaProjectSettings _this;
378 public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
381 this.el = new Gtk.TreeViewColumn();
385 // set gobject values
386 this.el.title = "package name";
387 this.el.expand = true;
388 this.el.resizable = true;
389 var child_0 = new Xcls_packages_render( _this );
391 this.el.pack_start ( child_0.el , false );
395 this.el.add_attribute(_this.packages_render.el , "text", 0 );
398 // user defined functions
400 public class Xcls_packages_render : Object
402 public Gtk.CellRendererText el;
403 private ValaProjectSettings _this;
409 public Xcls_packages_render(ValaProjectSettings _owner )
412 _this.packages_render = this;
413 this.el = new Gtk.CellRendererText();
417 // set gobject values
420 // user defined functions
424 public class Xcls_TreeViewColumn14 : Object
426 public Gtk.TreeViewColumn el;
427 private ValaProjectSettings _this;
433 public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
436 this.el = new Gtk.TreeViewColumn();
440 // set gobject values
441 this.el.title = "use";
442 this.el.resizable = false;
443 this.el.fixed_width = 50;
444 var child_0 = new Xcls_packages_render_use( _this );
446 this.el.pack_start ( child_0.el , false );
451 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
455 // user defined functions
457 public class Xcls_packages_render_use : Object
459 public Gtk.CellRendererToggle el;
460 private ValaProjectSettings _this;
466 public Xcls_packages_render_use(ValaProjectSettings _owner )
469 _this.packages_render_use = this;
470 this.el = new Gtk.CellRendererToggle();
474 // set gobject values
475 this.el.activatable = true;
478 this.el.toggled.connect( ( path_string) => {
479 var m = _this.default_packages_tree_store.el;
481 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
482 m.get_iter (out iter, path);
484 m.get_value(iter, 1, out val);
485 m.set_value(iter, 1, ((bool) val) ? false :true);
487 m.get_value(iter, 0, out fval);
488 var fn = (string)fval;
490 var def = _this.project.compilegroups.get("_default_");
491 var items = def.packages;
502 // user defined functions
508 public class Xcls_ScrolledWindow16 : Object
510 public Gtk.ScrolledWindow el;
511 private ValaProjectSettings _this;
517 public Xcls_ScrolledWindow16(ValaProjectSettings _owner )
520 this.el = new Gtk.ScrolledWindow( null, null );
524 // set gobject values
525 this.el.hexpand = true;
526 var child_0 = new Xcls_default_directory_tree( _this );
528 this.el.add ( child_0.el );
529 var child_1 = new Xcls_default_directory_menu( _this );
533 // user defined functions
535 public class Xcls_default_directory_tree : Object
537 public Gtk.TreeView el;
538 private ValaProjectSettings _this;
544 public Xcls_default_directory_tree(ValaProjectSettings _owner )
547 _this.default_directory_tree = this;
548 this.el = new Gtk.TreeView();
552 // set gobject values
553 this.el.headers_visible = true;
554 var child_0 = new Xcls_default_directory_tree_store( _this );
556 this.el.set_model ( child_0.el );
557 var child_1 = new Xcls_TreeViewColumn19( _this );
559 this.el.append_column ( child_1.el );
562 this.el.button_press_event.connect( ( ev) => {
563 //console.log("button press?");
566 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
567 //print("click" + ev.type);
571 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
575 // this.el.get_selection().select_path(res);
577 //if (!this.get('/LeftTreeMenu').el) {
578 // this.get('/LeftTreeMenu').init();
581 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
582 _this.default_directory_menu.el.show_all();
583 _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);
584 // print("click:" + res.path.to_string());
589 // user defined functions
591 public class Xcls_default_directory_tree_store : Object
593 public Gtk.ListStore el;
594 private ValaProjectSettings _this;
600 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
603 _this.default_directory_tree_store = this;
604 this.el = new Gtk.ListStore( 1, typeof(string)
609 // set gobject values
612 // user defined functions
613 public void load () {
618 var def = _this.project.compilegroups.get("_default_");
619 var items = def.sources;
624 for(var i =0 ; i < items.size; i++) {
625 this.el.append(out citer);
627 this.el.set_value(citer, 0, items.get(i) ); // title
628 //this.el.set_value(citer, 1, items.get(i) );
630 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
635 public class Xcls_TreeViewColumn19 : Object
637 public Gtk.TreeViewColumn el;
638 private ValaProjectSettings _this;
644 public Xcls_TreeViewColumn19(ValaProjectSettings _owner )
647 this.el = new Gtk.TreeViewColumn();
651 // set gobject values
652 this.el.title = "Available Directories (right click to add)";
653 this.el.resizable = true;
654 var child_0 = new Xcls_directory_render( _this );
656 this.el.pack_start ( child_0.el , false );
660 this.el.add_attribute(_this.directory_render.el , "text", 0 );
663 // user defined functions
665 public class Xcls_directory_render : Object
667 public Gtk.CellRendererText el;
668 private ValaProjectSettings _this;
674 public Xcls_directory_render(ValaProjectSettings _owner )
677 _this.directory_render = this;
678 this.el = new Gtk.CellRendererText();
682 // set gobject values
685 // user defined functions
690 public class Xcls_default_directory_menu : Object
693 private ValaProjectSettings _this;
699 public Xcls_default_directory_menu(ValaProjectSettings _owner )
702 _this.default_directory_menu = this;
703 this.el = new Gtk.Menu();
707 // set gobject values
708 var child_0 = new Xcls_MenuItem22( _this );
710 this.el.add ( child_0.el );
711 var child_1 = new Xcls_MenuItem23( _this );
713 this.el.add ( child_1.el );
714 var child_2 = new Xcls_SeparatorMenuItem24( _this );
716 this.el.add ( child_2.el );
717 var child_3 = new Xcls_MenuItem25( _this );
719 this.el.add ( child_3.el );
722 // user defined functions
724 public class Xcls_MenuItem22 : Object
726 public Gtk.MenuItem el;
727 private ValaProjectSettings _this;
733 public Xcls_MenuItem22(ValaProjectSettings _owner )
736 this.el = new Gtk.MenuItem();
740 // set gobject values
741 this.el.label = "Add Directory";
744 this.el.activate.connect( () => {
746 var chooser = new Gtk.FileChooserDialog (
747 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
749 Gtk.ResponseType.CANCEL,
751 Gtk.ResponseType.ACCEPT);
752 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
757 // add the directory..
758 var fn = _this.project.relPath(chooser.get_filename());
759 _this.project.compilegroups.get("_default_").sources.add(fn);
760 _this.default_directory_tree_store.load();
764 // user defined functions
767 public class Xcls_MenuItem23 : Object
769 public Gtk.MenuItem el;
770 private ValaProjectSettings _this;
776 public Xcls_MenuItem23(ValaProjectSettings _owner )
779 this.el = new Gtk.MenuItem();
783 // set gobject values
784 this.el.label = "Add File";
787 this.el.activate.connect( () => {
789 var chooser = new Gtk.FileChooserDialog (
790 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
792 Gtk.ResponseType.CANCEL,
794 Gtk.ResponseType.ACCEPT);
795 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
800 // add the directory..
801 var fn = _this.project.relPath(chooser.get_filename());
802 _this.project.compilegroups.get("_default_").sources.add(fn);
803 _this.default_directory_tree_store.load();
807 // user defined functions
810 public class Xcls_SeparatorMenuItem24 : Object
812 public Gtk.SeparatorMenuItem el;
813 private ValaProjectSettings _this;
819 public Xcls_SeparatorMenuItem24(ValaProjectSettings _owner )
822 this.el = new Gtk.SeparatorMenuItem();
826 // set gobject values
829 // user defined functions
832 public class Xcls_MenuItem25 : Object
834 public Gtk.MenuItem el;
835 private ValaProjectSettings _this;
841 public Xcls_MenuItem25(ValaProjectSettings _owner )
844 this.el = new Gtk.MenuItem();
848 // set gobject values
849 this.el.label = "Remove File/Directory";
852 this.el.activate.connect( () => {
857 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
858 print("nothing selected\n");
863 // add the directory..
867 mod.get_value(iter,0, out val);
868 var fn = (string) val;
870 print("remove: %s\n", fn);
871 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
872 print("remove failed");
874 _this.default_directory_tree_store.load();
878 // user defined functions
885 public class Xcls_Paned26 : Object
888 private ValaProjectSettings _this;
894 public Xcls_Paned26(ValaProjectSettings _owner )
897 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
901 // set gobject values
902 this.el.position = 300;
903 var child_0 = new Xcls_ScrolledWindow27( _this );
905 this.el.add1 ( child_0.el );
906 var child_1 = new Xcls_set_vbox( _this );
908 this.el.add2 ( child_1.el );
911 // user defined functions
913 public class Xcls_ScrolledWindow27 : Object
915 public Gtk.ScrolledWindow el;
916 private ValaProjectSettings _this;
922 public Xcls_ScrolledWindow27(ValaProjectSettings _owner )
925 this.el = new Gtk.ScrolledWindow( null, null );
929 // set gobject values
930 var child_0 = new Xcls_targets_tree_menu( _this );
932 this.el.add ( child_0.el );
933 var child_1 = new Xcls_targets_tree( _this );
935 this.el.add ( child_1.el );
940 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
945 // user defined functions
947 public class Xcls_targets_tree_menu : Object
950 private ValaProjectSettings _this;
956 public Xcls_targets_tree_menu(ValaProjectSettings _owner )
959 _this.targets_tree_menu = this;
960 this.el = new Gtk.Menu();
964 // set gobject values
965 var child_0 = new Xcls_MenuItem29( _this );
967 this.el.add ( child_0.el );
968 var child_1 = new Xcls_SeparatorMenuItem30( _this );
970 this.el.add ( child_1.el );
971 var child_2 = new Xcls_MenuItem31( _this );
973 this.el.add ( child_2.el );
976 // user defined functions
978 public class Xcls_MenuItem29 : Object
980 public Gtk.MenuItem el;
981 private ValaProjectSettings _this;
987 public Xcls_MenuItem29(ValaProjectSettings _owner )
990 this.el = new Gtk.MenuItem();
994 // set gobject values
995 this.el.label = "Add Compile Target";
998 this.el.activate.connect( () => {
1000 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1004 // add the directory..
1006 _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
1007 _this.targets_tree_store.load();
1011 // user defined functions
1014 public class Xcls_SeparatorMenuItem30 : Object
1016 public Gtk.SeparatorMenuItem el;
1017 private ValaProjectSettings _this;
1023 public Xcls_SeparatorMenuItem30(ValaProjectSettings _owner )
1026 this.el = new Gtk.SeparatorMenuItem();
1030 // set gobject values
1033 // user defined functions
1036 public class Xcls_MenuItem31 : Object
1038 public Gtk.MenuItem el;
1039 private ValaProjectSettings _this;
1045 public Xcls_MenuItem31(ValaProjectSettings _owner )
1048 this.el = new Gtk.MenuItem();
1052 // set gobject values
1053 this.el.label = "Remove Target";
1056 this.el.activate.connect( () => {
1061 if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1062 print("nothing selected\n");
1067 // add the directory..
1071 mod.get_value(iter,0, out val);
1072 var fn = (string) val;
1074 print("remove: %s\n", fn);
1075 if (!_this.project.compilegroups.unset(fn)) {
1076 print("remove failed");
1078 _this.targets_tree_store.load();
1082 // user defined functions
1086 public class Xcls_targets_tree : Object
1088 public Gtk.TreeView el;
1089 private ValaProjectSettings _this;
1093 public string cursor;
1096 public Xcls_targets_tree(ValaProjectSettings _owner )
1099 _this.targets_tree = this;
1100 this.el = new Gtk.TreeView();
1104 // set gobject values
1105 var child_0 = new Xcls_targets_tree_store( _this );
1107 this.el.set_model ( child_0.el );
1108 var child_1 = new Xcls_TreeViewColumn34( _this );
1110 this.el.append_column ( child_1.el );
1113 this.el.button_press_event.connect( ( ev) => {
1114 //console.log("button press?");
1117 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
1118 //print("click" + ev.type);
1122 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1126 // this.el.get_selection().select_path(res);
1128 //if (!this.get('/LeftTreeMenu').el) {
1129 // this.get('/LeftTreeMenu').init();
1132 _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1133 _this.targets_tree_menu.el.show_all();
1134 _this.targets_tree_menu.el.popup(null, null, null, 3, ev.time);
1135 // print("click:" + res.path.to_string());
1138 this.el.cursor_changed.connect( ( ) => {
1140 if (this.cursor != "") {
1141 // save the values..
1144 // load the new values.
1149 if (!this.el.get_selection().get_selected(out mod, out iter)) {
1150 print("nothing selected\n");
1151 // should disable the right hand side..
1152 _this.set_vbox.el.hide();
1155 _this.set_vbox.el.show();
1157 // add the directory..
1161 mod.get_value(iter,0, out val);
1162 var fn = (string) val;
1165 var cg = _this.project.compilegroups.get(fn);
1167 _this.build_pack_target.el.set_text(cg.target_bin);
1168 _this.build_compile_flags.el.set_text(cg.compile_flags);
1169 _this.build_execute_args.el.set_text(cg.execute_args);
1171 _this.set_vbox.cgroup = cg;
1172 _this.files_tree_store.update();
1180 // user defined functions
1182 public class Xcls_targets_tree_store : Object
1184 public Gtk.ListStore el;
1185 private ValaProjectSettings _this;
1191 public Xcls_targets_tree_store(ValaProjectSettings _owner )
1194 _this.targets_tree_store = this;
1195 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1196 typeof(string) // ??
1201 // set gobject values
1204 // user defined functions
1205 public void load () {
1210 var cg = _this.project.compilegroups;
1212 _this.targets_tree.cursor = "";
1214 var iter = cg.map_iterator();
1215 while(iter.next()) {
1216 var key = iter.get_key();
1217 if (key == "_default_") {
1221 this.el.append(out citer);
1223 this.el.set_value(citer, 0, key ); // title
1224 //this.el.set_value(citer, 1, items.get(i) );
1226 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1227 _this.set_vbox.el.hide();
1231 public class Xcls_TreeViewColumn34 : Object
1233 public Gtk.TreeViewColumn el;
1234 private ValaProjectSettings _this;
1240 public Xcls_TreeViewColumn34(ValaProjectSettings _owner )
1243 this.el = new Gtk.TreeViewColumn();
1247 // set gobject values
1248 this.el.title = "name";
1249 this.el.resizable = true;
1250 var child_0 = new Xcls_targets_render( _this );
1252 this.el.pack_start ( child_0.el , false );
1257 this.el.add_attribute(_this.targets_render.el , "text", 0 );
1261 // user defined functions
1263 public class Xcls_targets_render : Object
1265 public Gtk.CellRendererText el;
1266 private ValaProjectSettings _this;
1272 public Xcls_targets_render(ValaProjectSettings _owner )
1275 _this.targets_render = this;
1276 this.el = new Gtk.CellRendererText();
1280 // set gobject values
1281 this.el.editable = true;
1284 this.el.edited.connect( (path, newtext) => {
1287 _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1289 _this.targets_tree_store.el.get_value(iter,0, out gval);
1290 var oldval = (string)gval;
1291 if (oldval == newtext) {
1294 var cg = _this.project.compilegroups.get(oldval);
1296 _this.project.compilegroups.unset(oldval);
1297 _this.project.compilegroups.set(newtext, cg);
1298 _this.targets_tree_store.load();
1302 // user defined functions
1308 public class Xcls_set_vbox : Object
1311 private ValaProjectSettings _this;
1315 public Project.GtkValaSettings cgroup;
1318 public Xcls_set_vbox(ValaProjectSettings _owner )
1321 _this.set_vbox = this;
1322 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1327 // set gobject values
1328 this.el.homogeneous = false;
1329 var child_0 = new Xcls_Label37( _this );
1331 this.el.pack_start ( child_0.el , false,false,0 );
1332 var child_1 = new Xcls_build_pack_target( _this );
1334 this.el.pack_start ( child_1.el , false,false,0 );
1335 var child_2 = new Xcls_Label39( _this );
1337 this.el.pack_start ( child_2.el , false,false,0 );
1338 var child_3 = new Xcls_build_compile_flags( _this );
1340 this.el.pack_start ( child_3.el , false,false,0 );
1341 var child_4 = new Xcls_Label41( _this );
1343 this.el.pack_start ( child_4.el , false,false,0 );
1344 var child_5 = new Xcls_build_execute_args( _this );
1346 this.el.pack_start ( child_5.el , false,false,0 );
1347 var child_6 = new Xcls_Label43( _this );
1349 this.el.pack_start ( child_6.el , false,false,0 );
1350 var child_7 = new Xcls_ScrolledWindow44( _this );
1352 this.el.pack_start ( child_7.el , true,true,0 );
1355 // user defined functions
1357 public class Xcls_Label37 : Object
1359 public Gtk.Label el;
1360 private ValaProjectSettings _this;
1366 public Xcls_Label37(ValaProjectSettings _owner )
1369 this.el = new Gtk.Label( "target filename" );
1373 // set gobject values
1376 // user defined functions
1379 public class Xcls_build_pack_target : Object
1381 public Gtk.Entry el;
1382 private ValaProjectSettings _this;
1388 public Xcls_build_pack_target(ValaProjectSettings _owner )
1391 _this.build_pack_target = this;
1392 this.el = new Gtk.Entry();
1396 // set gobject values
1399 this.el.changed.connect( () => {
1400 if (_this.targets_tree.cursor.length < 1) {
1403 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1407 // user defined functions
1410 public class Xcls_Label39 : Object
1412 public Gtk.Label el;
1413 private ValaProjectSettings _this;
1419 public Xcls_Label39(ValaProjectSettings _owner )
1422 this.el = new Gtk.Label( "compile flags" );
1426 // set gobject values
1429 // user defined functions
1432 public class Xcls_build_compile_flags : Object
1434 public Gtk.Entry el;
1435 private ValaProjectSettings _this;
1441 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1444 _this.build_compile_flags = this;
1445 this.el = new Gtk.Entry();
1449 // set gobject values
1452 this.el.changed.connect( () => {
1453 if (_this.targets_tree.cursor.length < 1) {
1456 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1460 // user defined functions
1463 public class Xcls_Label41 : Object
1465 public Gtk.Label el;
1466 private ValaProjectSettings _this;
1472 public Xcls_Label41(ValaProjectSettings _owner )
1475 this.el = new Gtk.Label( "test argments - when run after a build" );
1479 // set gobject values
1482 // user defined functions
1485 public class Xcls_build_execute_args : Object
1487 public Gtk.Entry el;
1488 private ValaProjectSettings _this;
1494 public Xcls_build_execute_args(ValaProjectSettings _owner )
1497 _this.build_execute_args = this;
1498 this.el = new Gtk.Entry();
1502 // set gobject values
1503 this.el.placeholder_text = "eg. -f somefile -g ";
1506 this.el.changed.connect( () => {
1507 if (_this.targets_tree.cursor.length < 1) {
1510 _this.project.compilegroups.get(_this.targets_tree.cursor).execute_args = this.el.text;
1514 // user defined functions
1517 public class Xcls_Label43 : Object
1519 public Gtk.Label el;
1520 private ValaProjectSettings _this;
1526 public Xcls_Label43(ValaProjectSettings _owner )
1529 this.el = new Gtk.Label( "Files to compile" );
1533 // set gobject values
1536 // user defined functions
1539 public class Xcls_ScrolledWindow44 : Object
1541 public Gtk.ScrolledWindow el;
1542 private ValaProjectSettings _this;
1548 public Xcls_ScrolledWindow44(ValaProjectSettings _owner )
1551 this.el = new Gtk.ScrolledWindow( null, null );
1555 // set gobject values
1556 var child_0 = new Xcls_files_tree( _this );
1558 this.el.add ( child_0.el );
1561 // user defined functions
1563 public class Xcls_files_tree : Object
1565 public Gtk.TreeView el;
1566 private ValaProjectSettings _this;
1572 public Xcls_files_tree(ValaProjectSettings _owner )
1575 this.el = new Gtk.TreeView();
1579 // set gobject values
1580 var child_0 = new Xcls_files_tree_store( _this );
1582 this.el.set_model ( child_0.el );
1583 var child_1 = new Xcls_TreeViewColumn47( _this );
1585 this.el.append_column ( child_1.el );
1586 var child_2 = new Xcls_TreeViewColumn49( _this );
1588 this.el.append_column ( child_2.el );
1591 // user defined functions
1593 public class Xcls_files_tree_store : Object
1595 public Gtk.ListStore el;
1596 private ValaProjectSettings _this;
1602 public Xcls_files_tree_store(ValaProjectSettings _owner )
1605 _this.files_tree_store = this;
1606 this.el = new Gtk.ListStore( 4, typeof(string), // 0 file name
1607 typeof(string), // 0 basename
1608 typeof(string), // type (dir orfile)
1609 typeof(bool) // is checked.
1614 // set gobject values
1617 // user defined functions
1618 public void updateDir (string dname, bool bval) {
1622 var cg = _this.set_vbox.cgroup;
1623 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1624 this.el.iter_nth_child(out citer,null,i);
1627 this.el.get_value(citer,0, out val);
1628 var fn = (string) val;
1630 if ( Path.get_dirname (fn) == dname) {
1632 this.el.set_value(citer, 3, bval ); // checked
1638 if (cg.sources.contains(fn)) {
1639 cg.sources.remove(fn);
1642 if (!cg.sources.contains(fn)) {
1652 public void load () {
1657 var def = _this.project.compilegroups.get("_default_");
1658 var items = def.sources;
1666 for(var i =0 ; i < items.size; i++) {
1668 var files = _this.project.filesForCompile(items.get(i), false);
1669 if (files.size < 1) {
1673 this.el.append(out citer);
1675 this.el.set_value(citer, 0, items.get(i) ); // title
1676 this.el.set_value(citer, 1, "<span foreground=\"green\" font_weight=\"bold\">" +
1677 GLib.Markup.escape_text(items.get(i)) + "</span>"
1679 print("ADD item %s", items.get(i));
1680 this.el.set_value(citer, 2, "dir"); // type
1681 this.el.set_value(citer, 3, false ); // checked
1685 for(var j =0 ; j < files.size; j++) {
1686 this.el.append(out citer);
1687 print("ADD item %s", files.get(j));
1688 this.el.set_value(citer, 0, files.get(j) ); // title
1689 this.el.set_value(citer, 1, GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title
1690 this.el.set_value(citer, 2, "file"); // type
1691 this.el.set_value(citer, 3, false ); // checked
1696 //this.el.set_value(citer, 1, items.get(i) );
1698 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1701 public void update () {
1706 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1707 this.el.iter_nth_child(out citer,null,i);
1710 this.el.get_value(citer,0, out val);
1711 var fn = (string) val;
1714 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1718 this.el.set_value(citer, 3, active ); // checked
1725 public class Xcls_TreeViewColumn47 : Object
1727 public Gtk.TreeViewColumn el;
1728 private ValaProjectSettings _this;
1734 public Xcls_TreeViewColumn47(ValaProjectSettings _owner )
1737 this.el = new Gtk.TreeViewColumn();
1741 // set gobject values
1742 this.el.title = "name";
1743 this.el.resizable = true;
1744 var child_0 = new Xcls_files_render( _this );
1746 this.el.pack_start ( child_0.el , false );
1750 this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1752 /* this.el.add_attribute(_this.files_render.el , "markup", 2 );
1756 // user defined functions
1758 public class Xcls_files_render : Object
1760 public Gtk.CellRendererText el;
1761 private ValaProjectSettings _this;
1767 public Xcls_files_render(ValaProjectSettings _owner )
1770 _this.files_render = this;
1771 this.el = new Gtk.CellRendererText();
1775 // set gobject values
1778 // user defined functions
1782 public class Xcls_TreeViewColumn49 : Object
1784 public Gtk.TreeViewColumn el;
1785 private ValaProjectSettings _this;
1791 public Xcls_TreeViewColumn49(ValaProjectSettings _owner )
1794 this.el = new Gtk.TreeViewColumn();
1798 // set gobject values
1799 this.el.title = "use";
1800 this.el.resizable = false;
1801 this.el.fixed_width = 50;
1802 var child_0 = new Xcls_files_render_use( _this );
1804 this.el.pack_start ( child_0.el , false );
1809 this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1813 // user defined functions
1815 public class Xcls_files_render_use : Object
1817 public Gtk.CellRendererToggle el;
1818 private ValaProjectSettings _this;
1824 public Xcls_files_render_use(ValaProjectSettings _owner )
1827 _this.files_render_use = this;
1828 this.el = new Gtk.CellRendererToggle();
1832 // set gobject values
1833 this.el.activatable = true;
1836 this.el.toggled.connect( ( path_string) => {
1840 var m = _this.files_tree_store.el;
1842 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1843 m.get_iter (out iter, path);
1845 m.get_value(iter, 3, out val);
1846 m.set_value(iter, 3, ((bool) val) ? false :true);
1850 m.get_value(iter, 2, out ftval);
1851 var ftype = (string)ftval;
1855 m.get_value(iter, 0, out fval);
1856 var fn = (string)fval;
1859 var cg = _this.set_vbox.cgroup;
1860 // what's the sleected target?
1861 // update the list..
1862 // if ftype is a dir == then toggle all the bellow.
1864 if (ftype == "dir") {
1865 _this.files_tree_store.updateDir(fn, ((bool) val) ? false :true);
1868 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1873 cg.sources.remove(fn);
1881 // user defined functions