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.VBox( true, 0 );
51 var child_0 = new Xcls_Notebook2( _this );
53 this.el.pack_start ( child_0.el , true,true,0 );
56 // user defined functions
57 public void show (Project.Gtk project) {
60 print("ValaProjectSettings show\n");
62 this.project= project;
64 this.compile_flags.el.text = _this.project.compilegroups.get("_default_").compile_flags;
66 this.default_directory_tree_store.load();
67 this.default_packages_tree_store.load();
68 this.targets_tree_store.load();
69 this.files_tree_store.load();
73 this.project.writeConfig();
75 public class Xcls_Notebook2 : Object
77 public Gtk.Notebook el;
78 private ValaProjectSettings _this;
84 public Xcls_Notebook2(ValaProjectSettings _owner )
87 this.el = new Gtk.Notebook();
92 var child_0 = new Xcls_label_global( _this );
94 var child_1 = new Xcls_label_targets( _this );
96 var child_2 = new Xcls_Box5( _this );
98 this.el.append_page ( child_2.el , _this.label_global.el );
99 var child_3 = new Xcls_HPaned26( _this );
101 this.el.append_page ( child_3.el , _this.label_targets.el );
104 // user defined functions
106 public class Xcls_label_global : Object
109 private ValaProjectSettings _this;
115 public Xcls_label_global(ValaProjectSettings _owner )
118 _this.label_global = this;
119 this.el = new Gtk.Label( "Global" );
123 // set gobject values
126 // user defined functions
128 public class Xcls_label_targets : Object
131 private ValaProjectSettings _this;
137 public Xcls_label_targets(ValaProjectSettings _owner )
140 _this.label_targets = this;
141 this.el = new Gtk.Label( "Targets" );
145 // set gobject values
148 // user defined functions
150 public class Xcls_Box5 : Object
153 private ValaProjectSettings _this;
159 public Xcls_Box5(ValaProjectSettings _owner )
162 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
166 // set gobject values
167 this.el.homogeneous = false;
168 var child_0 = new Xcls_Label6( _this );
170 this.el.pack_start ( child_0.el , false,false,0 );
171 var child_1 = new Xcls_compile_flags( _this );
173 this.el.pack_start ( child_1.el , false,false,0 );
174 var child_2 = new Xcls_Box8( _this );
176 this.el.pack_start ( child_2.el , true,true,0 );
179 // user defined functions
181 public class Xcls_Label6 : Object
184 private ValaProjectSettings _this;
190 public Xcls_Label6(ValaProjectSettings _owner )
193 this.el = new Gtk.Label( "compile flags" );
197 // set gobject values
200 // user defined functions
202 public class Xcls_compile_flags : Object
205 private ValaProjectSettings _this;
211 public Xcls_compile_flags(ValaProjectSettings _owner )
214 _this.compile_flags = this;
215 this.el = new Gtk.Entry();
219 // set gobject values
220 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
223 this.el.changed.connect( () => {
225 _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
226 _this.project.writeConfig();
227 // _this.project.save();
232 // user defined functions
234 public class Xcls_Box8 : Object
237 private ValaProjectSettings _this;
243 public Xcls_Box8(ValaProjectSettings _owner )
246 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
250 // set gobject values
251 var child_0 = new Xcls_ScrolledWindow9( _this );
253 this.el.add ( child_0.el );
254 var child_1 = new Xcls_ScrolledWindow16( _this );
256 this.el.add ( child_1.el );
259 // user defined functions
261 public class Xcls_ScrolledWindow9 : Object
263 public Gtk.ScrolledWindow el;
264 private ValaProjectSettings _this;
270 public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
273 this.el = new Gtk.ScrolledWindow( null, null );
277 // set gobject values
278 var child_0 = new Xcls_default_packages_tree( _this );
280 this.el.add ( child_0.el );
283 // user defined functions
285 public class Xcls_default_packages_tree : Object
287 public Gtk.TreeView el;
288 private ValaProjectSettings _this;
294 public Xcls_default_packages_tree(ValaProjectSettings _owner )
297 this.el = new Gtk.TreeView();
301 // set gobject values
302 this.el.headers_visible = true;
303 var child_0 = new Xcls_default_packages_tree_store( _this );
305 this.el.set_model ( child_0.el );
306 var child_1 = new Xcls_TreeViewColumn12( _this );
308 this.el.append_column ( child_1.el );
309 var child_2 = new Xcls_TreeViewColumn14( _this );
311 this.el.append_column ( child_2.el );
314 // user defined functions
316 public class Xcls_default_packages_tree_store : Object
318 public Gtk.ListStore el;
319 private ValaProjectSettings _this;
325 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
328 _this.default_packages_tree_store = this;
329 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
334 // set gobject values
337 // user defined functions
338 public void load () {
340 var def = _this.project.compilegroups.get("_default_");
341 var items = def.packages;
344 var pal = (Palete.Gtk) Palete.factory("Gtk");
345 var pkgs = pal.packages(_this.project);
346 print("ValaProjectSettings:packages load %d\n", pkgs.size);
350 for(var i =0 ; i < pkgs.size; i++) {
351 this.el.append(out citer);
353 this.el.set_value(citer, 0, pkgs.get(i) ); // title
354 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
356 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
360 public class Xcls_TreeViewColumn12 : Object
362 public Gtk.TreeViewColumn el;
363 private ValaProjectSettings _this;
369 public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
372 this.el = new Gtk.TreeViewColumn();
376 // set gobject values
377 this.el.title = "package name";
378 this.el.expand = true;
379 this.el.resizable = true;
380 var child_0 = new Xcls_packages_render( _this );
382 this.el.pack_start ( child_0.el , false );
386 this.el.add_attribute(_this.packages_render.el , "text", 0 );
389 // user defined functions
391 public class Xcls_packages_render : Object
393 public Gtk.CellRendererText el;
394 private ValaProjectSettings _this;
400 public Xcls_packages_render(ValaProjectSettings _owner )
403 _this.packages_render = this;
404 this.el = new Gtk.CellRendererText();
408 // set gobject values
411 // user defined functions
413 public class Xcls_TreeViewColumn14 : Object
415 public Gtk.TreeViewColumn el;
416 private ValaProjectSettings _this;
422 public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
425 this.el = new Gtk.TreeViewColumn();
429 // set gobject values
430 this.el.title = "use";
431 this.el.resizable = false;
432 this.el.fixed_width = 50;
433 var child_0 = new Xcls_packages_render_use( _this );
435 this.el.pack_start ( child_0.el , false );
440 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
444 // user defined functions
446 public class Xcls_packages_render_use : Object
448 public Gtk.CellRendererToggle el;
449 private ValaProjectSettings _this;
455 public Xcls_packages_render_use(ValaProjectSettings _owner )
458 _this.packages_render_use = this;
459 this.el = new Gtk.CellRendererToggle();
463 // set gobject values
464 this.el.activatable = true;
467 this.el.toggled.connect( ( path_string) => {
468 var m = _this.default_packages_tree_store.el;
470 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
471 m.get_iter (out iter, path);
473 m.get_value(iter, 1, out val);
474 m.set_value(iter, 1, ((bool) val) ? false :true);
476 m.get_value(iter, 0, out fval);
477 var fn = (string)fval;
479 var def = _this.project.compilegroups.get("_default_");
480 var items = def.packages;
491 // user defined functions
493 public class Xcls_ScrolledWindow16 : Object
495 public Gtk.ScrolledWindow el;
496 private ValaProjectSettings _this;
502 public Xcls_ScrolledWindow16(ValaProjectSettings _owner )
505 this.el = new Gtk.ScrolledWindow( null, null );
509 // set gobject values
510 var child_0 = new Xcls_default_directory_tree( _this );
512 this.el.add ( child_0.el );
513 var child_1 = new Xcls_default_directory_menu( _this );
517 // user defined functions
519 public class Xcls_default_directory_tree : Object
521 public Gtk.TreeView el;
522 private ValaProjectSettings _this;
528 public Xcls_default_directory_tree(ValaProjectSettings _owner )
531 _this.default_directory_tree = this;
532 this.el = new Gtk.TreeView();
536 // set gobject values
537 this.el.headers_visible = true;
538 var child_0 = new Xcls_default_directory_tree_store( _this );
540 this.el.set_model ( child_0.el );
541 var child_1 = new Xcls_TreeViewColumn19( _this );
543 this.el.append_column ( child_1.el );
546 this.el.button_press_event.connect( ( ev) => {
547 //console.log("button press?");
550 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
551 //print("click" + ev.type);
555 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
559 // this.el.get_selection().select_path(res);
561 //if (!this.get('/LeftTreeMenu').el) {
562 // this.get('/LeftTreeMenu').init();
565 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
566 _this.default_directory_menu.el.show_all();
567 _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);
568 // print("click:" + res.path.to_string());
573 // user defined functions
575 public class Xcls_default_directory_tree_store : Object
577 public Gtk.ListStore el;
578 private ValaProjectSettings _this;
584 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
587 _this.default_directory_tree_store = this;
588 this.el = new Gtk.ListStore( 1, typeof(string)
593 // set gobject values
596 // user defined functions
597 public void load () {
602 var def = _this.project.compilegroups.get("_default_");
603 var items = def.sources;
608 for(var i =0 ; i < items.size; i++) {
609 this.el.append(out citer);
611 this.el.set_value(citer, 0, items.get(i) ); // title
612 //this.el.set_value(citer, 1, items.get(i) );
614 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
618 public class Xcls_TreeViewColumn19 : Object
620 public Gtk.TreeViewColumn el;
621 private ValaProjectSettings _this;
627 public Xcls_TreeViewColumn19(ValaProjectSettings _owner )
630 this.el = new Gtk.TreeViewColumn();
634 // set gobject values
635 this.el.title = "Available Directories (right click to add)";
636 this.el.resizable = true;
637 var child_0 = new Xcls_directory_render( _this );
639 this.el.pack_start ( child_0.el , false );
643 this.el.add_attribute(_this.directory_render.el , "text", 0 );
646 // user defined functions
648 public class Xcls_directory_render : Object
650 public Gtk.CellRendererText el;
651 private ValaProjectSettings _this;
657 public Xcls_directory_render(ValaProjectSettings _owner )
660 _this.directory_render = this;
661 this.el = new Gtk.CellRendererText();
665 // set gobject values
668 // user defined functions
670 public class Xcls_default_directory_menu : Object
673 private ValaProjectSettings _this;
679 public Xcls_default_directory_menu(ValaProjectSettings _owner )
682 _this.default_directory_menu = this;
683 this.el = new Gtk.Menu();
687 // set gobject values
688 var child_0 = new Xcls_MenuItem22( _this );
690 this.el.add ( child_0.el );
691 var child_1 = new Xcls_MenuItem23( _this );
693 this.el.add ( child_1.el );
694 var child_2 = new Xcls_SeparatorMenuItem24( _this );
696 this.el.add ( child_2.el );
697 var child_3 = new Xcls_MenuItem25( _this );
699 this.el.add ( child_3.el );
702 // user defined functions
704 public class Xcls_MenuItem22 : Object
706 public Gtk.MenuItem el;
707 private ValaProjectSettings _this;
713 public Xcls_MenuItem22(ValaProjectSettings _owner )
716 this.el = new Gtk.MenuItem();
720 // set gobject values
721 this.el.label = "Add Directory";
724 this.el.activate.connect( () => {
726 var chooser = new Gtk.FileChooserDialog (
727 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
729 Gtk.ResponseType.CANCEL,
731 Gtk.ResponseType.ACCEPT);
732 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
737 // add the directory..
738 var fn = _this.project.relPath(chooser.get_filename());
739 _this.project.compilegroups.get("_default_").sources.add(fn);
740 _this.default_directory_tree_store.load();
744 // user defined functions
746 public class Xcls_MenuItem23 : Object
748 public Gtk.MenuItem el;
749 private ValaProjectSettings _this;
755 public Xcls_MenuItem23(ValaProjectSettings _owner )
758 this.el = new Gtk.MenuItem();
762 // set gobject values
763 this.el.label = "Add File";
766 this.el.activate.connect( () => {
768 var chooser = new Gtk.FileChooserDialog (
769 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
771 Gtk.ResponseType.CANCEL,
773 Gtk.ResponseType.ACCEPT);
774 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
779 // add the directory..
780 var fn = _this.project.relPath(chooser.get_filename());
781 _this.project.compilegroups.get("_default_").sources.add(fn);
782 _this.default_directory_tree_store.load();
786 // user defined functions
788 public class Xcls_SeparatorMenuItem24 : Object
790 public Gtk.SeparatorMenuItem el;
791 private ValaProjectSettings _this;
797 public Xcls_SeparatorMenuItem24(ValaProjectSettings _owner )
800 this.el = new Gtk.SeparatorMenuItem();
804 // set gobject values
807 // user defined functions
809 public class Xcls_MenuItem25 : Object
811 public Gtk.MenuItem el;
812 private ValaProjectSettings _this;
818 public Xcls_MenuItem25(ValaProjectSettings _owner )
821 this.el = new Gtk.MenuItem();
825 // set gobject values
826 this.el.label = "Remove File/Directory";
829 this.el.activate.connect( () => {
834 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
835 print("nothing selected\n");
840 // add the directory..
844 mod.get_value(iter,0, out val);
845 var fn = (string) val;
847 print("remove: %s\n", fn);
848 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
849 print("remove failed");
851 _this.default_directory_tree_store.load();
855 // user defined functions
857 public class Xcls_HPaned26 : Object
859 public Gtk.HPaned el;
860 private ValaProjectSettings _this;
866 public Xcls_HPaned26(ValaProjectSettings _owner )
869 this.el = new Gtk.HPaned();
873 // set gobject values
874 this.el.position = 300;
875 var child_0 = new Xcls_ScrolledWindow27( _this );
877 this.el.add1 ( child_0.el );
878 var child_1 = new Xcls_set_vbox( _this );
880 this.el.add2 ( child_1.el );
883 // user defined functions
885 public class Xcls_ScrolledWindow27 : Object
887 public Gtk.ScrolledWindow el;
888 private ValaProjectSettings _this;
894 public Xcls_ScrolledWindow27(ValaProjectSettings _owner )
897 this.el = new Gtk.ScrolledWindow( null, null );
901 // set gobject values
902 var child_0 = new Xcls_targets_tree_menu( _this );
904 this.el.add ( child_0.el );
905 var child_1 = new Xcls_targets_tree( _this );
907 this.el.add ( child_1.el );
912 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
917 // user defined functions
919 public class Xcls_targets_tree_menu : Object
922 private ValaProjectSettings _this;
928 public Xcls_targets_tree_menu(ValaProjectSettings _owner )
931 _this.targets_tree_menu = this;
932 this.el = new Gtk.Menu();
936 // set gobject values
937 var child_0 = new Xcls_MenuItem29( _this );
939 this.el.add ( child_0.el );
940 var child_1 = new Xcls_SeparatorMenuItem30( _this );
942 this.el.add ( child_1.el );
943 var child_2 = new Xcls_MenuItem31( _this );
945 this.el.add ( child_2.el );
948 // user defined functions
950 public class Xcls_MenuItem29 : Object
952 public Gtk.MenuItem el;
953 private ValaProjectSettings _this;
959 public Xcls_MenuItem29(ValaProjectSettings _owner )
962 this.el = new Gtk.MenuItem();
966 // set gobject values
967 this.el.label = "Add Compile Target";
970 this.el.activate.connect( () => {
972 if (_this.project.compilegroups.has_key("NEW GROUP")) {
976 // add the directory..
978 _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
979 _this.targets_tree_store.load();
983 // user defined functions
985 public class Xcls_SeparatorMenuItem30 : Object
987 public Gtk.SeparatorMenuItem el;
988 private ValaProjectSettings _this;
994 public Xcls_SeparatorMenuItem30(ValaProjectSettings _owner )
997 this.el = new Gtk.SeparatorMenuItem();
1001 // set gobject values
1004 // user defined functions
1006 public class Xcls_MenuItem31 : Object
1008 public Gtk.MenuItem el;
1009 private ValaProjectSettings _this;
1015 public Xcls_MenuItem31(ValaProjectSettings _owner )
1018 this.el = new Gtk.MenuItem();
1022 // set gobject values
1023 this.el.label = "Remove Target";
1026 this.el.activate.connect( () => {
1031 if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1032 print("nothing selected\n");
1037 // add the directory..
1041 mod.get_value(iter,0, out val);
1042 var fn = (string) val;
1044 print("remove: %s\n", fn);
1045 if (!_this.project.compilegroups.unset(fn)) {
1046 print("remove failed");
1048 _this.targets_tree_store.load();
1052 // user defined functions
1054 public class Xcls_targets_tree : Object
1056 public Gtk.TreeView el;
1057 private ValaProjectSettings _this;
1061 public string cursor;
1064 public Xcls_targets_tree(ValaProjectSettings _owner )
1067 _this.targets_tree = this;
1068 this.el = new Gtk.TreeView();
1072 // set gobject values
1073 var child_0 = new Xcls_targets_tree_store( _this );
1075 this.el.set_model ( child_0.el );
1076 var child_1 = new Xcls_TreeViewColumn34( _this );
1078 this.el.append_column ( child_1.el );
1081 this.el.button_press_event.connect( ( ev) => {
1082 //console.log("button press?");
1085 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
1086 //print("click" + ev.type);
1090 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1094 // this.el.get_selection().select_path(res);
1096 //if (!this.get('/LeftTreeMenu').el) {
1097 // this.get('/LeftTreeMenu').init();
1100 _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1101 _this.targets_tree_menu.el.show_all();
1102 _this.targets_tree_menu.el.popup(null, null, null, 3, ev.time);
1103 // print("click:" + res.path.to_string());
1106 this.el.cursor_changed.connect( ( ) => {
1108 if (this.cursor != "") {
1109 // save the values..
1112 // load the new values.
1117 if (!this.el.get_selection().get_selected(out mod, out iter)) {
1118 print("nothing selected\n");
1119 // should disable the right hand side..
1120 _this.set_vbox.el.hide();
1123 _this.set_vbox.el.show();
1125 // add the directory..
1129 mod.get_value(iter,0, out val);
1130 var fn = (string) val;
1133 var cg = _this.project.compilegroups.get(fn);
1135 _this.build_pack_target.el.set_text(cg.target_bin);
1136 _this.build_compile_flags.el.set_text(cg.compile_flags);
1137 _this.set_vbox.cgroup = cg;
1138 _this.files_tree_store.update();
1146 // user defined functions
1148 public class Xcls_targets_tree_store : Object
1150 public Gtk.ListStore el;
1151 private ValaProjectSettings _this;
1157 public Xcls_targets_tree_store(ValaProjectSettings _owner )
1160 _this.targets_tree_store = this;
1161 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1162 typeof(string) // ??
1167 // set gobject values
1170 // user defined functions
1171 public void load () {
1176 var cg = _this.project.compilegroups;
1178 _this.targets_tree.cursor = "";
1180 var iter = cg.map_iterator();
1181 while(iter.next()) {
1182 var key = iter.get_key();
1183 if (key == "_default_") {
1187 this.el.append(out citer);
1189 this.el.set_value(citer, 0, key ); // title
1190 //this.el.set_value(citer, 1, items.get(i) );
1192 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1193 _this.set_vbox.el.hide();
1196 public class Xcls_TreeViewColumn34 : Object
1198 public Gtk.TreeViewColumn el;
1199 private ValaProjectSettings _this;
1205 public Xcls_TreeViewColumn34(ValaProjectSettings _owner )
1208 this.el = new Gtk.TreeViewColumn();
1212 // set gobject values
1213 this.el.title = "name";
1214 this.el.resizable = true;
1215 var child_0 = new Xcls_targets_render( _this );
1217 this.el.pack_start ( child_0.el , false );
1222 this.el.add_attribute(_this.targets_render.el , "text", 0 );
1226 // user defined functions
1228 public class Xcls_targets_render : Object
1230 public Gtk.CellRendererText el;
1231 private ValaProjectSettings _this;
1237 public Xcls_targets_render(ValaProjectSettings _owner )
1240 _this.targets_render = this;
1241 this.el = new Gtk.CellRendererText();
1245 // set gobject values
1246 this.el.editable = true;
1249 this.el.edited.connect( (path, newtext) => {
1252 _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1254 _this.targets_tree_store.el.get_value(iter,0, out gval);
1255 var oldval = (string)gval;
1256 if (oldval == newtext) {
1259 var cg = _this.project.compilegroups.get(oldval);
1261 _this.project.compilegroups.unset(oldval);
1262 _this.project.compilegroups.set(newtext, cg);
1263 _this.targets_tree_store.load();
1267 // user defined functions
1269 public class Xcls_set_vbox : Object
1272 private ValaProjectSettings _this;
1276 public Project.GtkValaSettings cgroup;
1279 public Xcls_set_vbox(ValaProjectSettings _owner )
1282 _this.set_vbox = this;
1283 this.el = new Gtk.VBox( false, 0 );
1288 // set gobject values
1289 var child_0 = new Xcls_Label37( _this );
1291 this.el.pack_start ( child_0.el , false,false,0 );
1292 var child_1 = new Xcls_build_pack_target( _this );
1294 this.el.pack_start ( child_1.el , false,false,0 );
1295 var child_2 = new Xcls_Label39( _this );
1297 this.el.pack_start ( child_2.el , false,false,0 );
1298 var child_3 = new Xcls_build_compile_flags( _this );
1300 this.el.pack_start ( child_3.el , false,false,0 );
1301 var child_4 = new Xcls_Label41( _this );
1303 this.el.pack_start ( child_4.el , false,false,0 );
1304 var child_5 = new Xcls_ScrolledWindow42( _this );
1306 this.el.pack_start ( child_5.el , true,true,0 );
1309 // user defined functions
1311 public class Xcls_Label37 : Object
1313 public Gtk.Label el;
1314 private ValaProjectSettings _this;
1320 public Xcls_Label37(ValaProjectSettings _owner )
1323 this.el = new Gtk.Label( "target filename" );
1327 // set gobject values
1330 // user defined functions
1332 public class Xcls_build_pack_target : Object
1334 public Gtk.Entry el;
1335 private ValaProjectSettings _this;
1341 public Xcls_build_pack_target(ValaProjectSettings _owner )
1344 _this.build_pack_target = this;
1345 this.el = new Gtk.Entry();
1349 // set gobject values
1352 this.el.changed.connect( () => {
1353 if (_this.targets_tree.cursor.length < 1) {
1356 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1360 // user defined functions
1362 public class Xcls_Label39 : Object
1364 public Gtk.Label el;
1365 private ValaProjectSettings _this;
1371 public Xcls_Label39(ValaProjectSettings _owner )
1374 this.el = new Gtk.Label( "compile flags" );
1378 // set gobject values
1381 // user defined functions
1383 public class Xcls_build_compile_flags : Object
1385 public Gtk.Entry el;
1386 private ValaProjectSettings _this;
1392 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1395 _this.build_compile_flags = this;
1396 this.el = new Gtk.Entry();
1400 // set gobject values
1403 this.el.changed.connect( () => {
1404 if (_this.targets_tree.cursor.length < 1) {
1407 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1411 // user defined functions
1413 public class Xcls_Label41 : Object
1415 public Gtk.Label el;
1416 private ValaProjectSettings _this;
1422 public Xcls_Label41(ValaProjectSettings _owner )
1425 this.el = new Gtk.Label( "Files to compile" );
1429 // set gobject values
1432 // user defined functions
1434 public class Xcls_ScrolledWindow42 : Object
1436 public Gtk.ScrolledWindow el;
1437 private ValaProjectSettings _this;
1443 public Xcls_ScrolledWindow42(ValaProjectSettings _owner )
1446 this.el = new Gtk.ScrolledWindow( null, null );
1450 // set gobject values
1451 var child_0 = new Xcls_files_tree( _this );
1453 this.el.add ( child_0.el );
1456 // user defined functions
1458 public class Xcls_files_tree : Object
1460 public Gtk.TreeView el;
1461 private ValaProjectSettings _this;
1467 public Xcls_files_tree(ValaProjectSettings _owner )
1470 this.el = new Gtk.TreeView();
1474 // set gobject values
1475 var child_0 = new Xcls_files_tree_store( _this );
1477 this.el.set_model ( child_0.el );
1478 var child_1 = new Xcls_TreeViewColumn45( _this );
1480 this.el.append_column ( child_1.el );
1481 var child_2 = new Xcls_TreeViewColumn47( _this );
1483 this.el.append_column ( child_2.el );
1486 // user defined functions
1488 public class Xcls_files_tree_store : Object
1490 public Gtk.ListStore el;
1491 private ValaProjectSettings _this;
1497 public Xcls_files_tree_store(ValaProjectSettings _owner )
1500 _this.files_tree_store = this;
1501 this.el = new Gtk.ListStore( 4, typeof(string), // 0 file name
1502 typeof(string), // 0 basename
1503 typeof(string), // type (dir orfile)
1504 typeof(bool) // is checked.
1509 // set gobject values
1512 // user defined functions
1513 public void updateDir (string dname, bool bval) {
1517 var cg = _this.set_vbox.cgroup;
1518 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1519 this.el.iter_nth_child(out citer,null,i);
1522 this.el.get_value(citer,0, out val);
1523 var fn = (string) val;
1525 if ( Path.get_dirname (fn) == dname) {
1527 this.el.set_value(citer, 3, bval ); // checked
1533 if (cg.sources.contains(fn)) {
1534 cg.sources.remove(fn);
1537 if (!cg.sources.contains(fn)) {
1547 public void load () {
1552 var def = _this.project.compilegroups.get("_default_");
1553 var items = def.sources;
1561 for(var i =0 ; i < items.size; i++) {
1563 var files = _this.project.files(items.get(i));
1564 if (files.size < 1) {
1568 this.el.append(out citer);
1570 this.el.set_value(citer, 0, items.get(i) ); // title
1571 this.el.set_value(citer, 1, "<span foreground=\"green\" font_weight=\"bold\">" +
1572 GLib.Markup.escape_text(items.get(i)) + "</span>"
1574 print("ADD item %s", items.get(i));
1575 this.el.set_value(citer, 2, "dir"); // type
1576 this.el.set_value(citer, 3, false ); // checked
1580 for(var j =0 ; j < files.size; j++) {
1581 this.el.append(out citer);
1582 print("ADD item %s", files.get(j));
1583 this.el.set_value(citer, 0, files.get(j) ); // title
1584 this.el.set_value(citer, 1, GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title
1585 this.el.set_value(citer, 2, "file"); // type
1586 this.el.set_value(citer, 3, false ); // checked
1591 //this.el.set_value(citer, 1, items.get(i) );
1593 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1596 public void update () {
1601 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1602 this.el.iter_nth_child(out citer,null,i);
1605 this.el.get_value(citer,0, out val);
1606 var fn = (string) val;
1609 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1613 this.el.set_value(citer, 3, active ); // checked
1619 public class Xcls_TreeViewColumn45 : Object
1621 public Gtk.TreeViewColumn el;
1622 private ValaProjectSettings _this;
1628 public Xcls_TreeViewColumn45(ValaProjectSettings _owner )
1631 this.el = new Gtk.TreeViewColumn();
1635 // set gobject values
1636 this.el.title = "name";
1637 this.el.resizable = true;
1638 var child_0 = new Xcls_files_render( _this );
1640 this.el.pack_start ( child_0.el , false );
1644 this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1646 /* this.el.add_attribute(_this.files_render.el , "markup", 2 );
1650 // user defined functions
1652 public class Xcls_files_render : Object
1654 public Gtk.CellRendererText el;
1655 private ValaProjectSettings _this;
1661 public Xcls_files_render(ValaProjectSettings _owner )
1664 _this.files_render = this;
1665 this.el = new Gtk.CellRendererText();
1669 // set gobject values
1672 // user defined functions
1674 public class Xcls_TreeViewColumn47 : Object
1676 public Gtk.TreeViewColumn el;
1677 private ValaProjectSettings _this;
1683 public Xcls_TreeViewColumn47(ValaProjectSettings _owner )
1686 this.el = new Gtk.TreeViewColumn();
1690 // set gobject values
1691 this.el.title = "use";
1692 this.el.resizable = false;
1693 this.el.fixed_width = 50;
1694 var child_0 = new Xcls_files_render_use( _this );
1696 this.el.pack_start ( child_0.el , false );
1701 this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1705 // user defined functions
1707 public class Xcls_files_render_use : Object
1709 public Gtk.CellRendererToggle el;
1710 private ValaProjectSettings _this;
1716 public Xcls_files_render_use(ValaProjectSettings _owner )
1719 _this.files_render_use = this;
1720 this.el = new Gtk.CellRendererToggle();
1724 // set gobject values
1725 this.el.activatable = true;
1728 this.el.toggled.connect( ( path_string) => {
1732 var m = _this.files_tree_store.el;
1734 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1735 m.get_iter (out iter, path);
1737 m.get_value(iter, 3, out val);
1738 m.set_value(iter, 3, ((bool) val) ? false :true);
1742 m.get_value(iter, 2, out ftval);
1743 var ftype = (string)ftval;
1747 m.get_value(iter, 0, out fval);
1748 var fn = (string)fval;
1751 var cg = _this.set_vbox.cgroup;
1752 // what's the sleected target?
1753 // update the list..
1754 // if ftype is a dir == then toggle all the bellow.
1756 if (ftype == "dir") {
1757 _this.files_tree_store.updateDir(fn, ((bool) val) ? false :true);
1760 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1765 cg.sources.remove(fn);
1773 // user defined functions