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_VBox5( _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_VBox5 : Object
153 private ValaProjectSettings _this;
159 public Xcls_VBox5(ValaProjectSettings _owner )
162 this.el = new Gtk.VBox( false, 0 );
166 // set gobject values
167 var child_0 = new Xcls_Label6( _this );
169 this.el.pack_start ( child_0.el , false,false,0 );
170 var child_1 = new Xcls_compile_flags( _this );
172 this.el.pack_start ( child_1.el , false,false,0 );
173 var child_2 = new Xcls_HBox8( _this );
175 this.el.pack_start ( child_2.el , true,true,0 );
178 // user defined functions
180 public class Xcls_Label6 : Object
183 private ValaProjectSettings _this;
189 public Xcls_Label6(ValaProjectSettings _owner )
192 this.el = new Gtk.Label( "compile flags" );
196 // set gobject values
199 // user defined functions
201 public class Xcls_compile_flags : Object
204 private ValaProjectSettings _this;
210 public Xcls_compile_flags(ValaProjectSettings _owner )
213 _this.compile_flags = this;
214 this.el = new Gtk.Entry();
218 // set gobject values
219 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
222 this.el.changed.connect( () => {
224 _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
225 _this.project.writeConfig();
226 // _this.project.save();
231 // user defined functions
233 public class Xcls_HBox8 : Object
236 private ValaProjectSettings _this;
242 public Xcls_HBox8(ValaProjectSettings _owner )
245 this.el = new Gtk.HBox( true, 0 );
249 // set gobject values
250 var child_0 = new Xcls_ScrolledWindow9( _this );
252 this.el.add ( child_0.el );
253 var child_1 = new Xcls_ScrolledWindow16( _this );
255 this.el.add ( child_1.el );
258 // user defined functions
260 public class Xcls_ScrolledWindow9 : Object
262 public Gtk.ScrolledWindow el;
263 private ValaProjectSettings _this;
269 public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
272 this.el = new Gtk.ScrolledWindow( null, null );
276 // set gobject values
277 var child_0 = new Xcls_default_packages_tree( _this );
279 this.el.add ( child_0.el );
282 // user defined functions
284 public class Xcls_default_packages_tree : Object
286 public Gtk.TreeView el;
287 private ValaProjectSettings _this;
293 public Xcls_default_packages_tree(ValaProjectSettings _owner )
296 this.el = new Gtk.TreeView();
300 // set gobject values
301 this.el.headers_visible = true;
302 var child_0 = new Xcls_default_packages_tree_store( _this );
304 this.el.set_model ( child_0.el );
305 var child_1 = new Xcls_TreeViewColumn12( _this );
307 this.el.append_column ( child_1.el );
308 var child_2 = new Xcls_TreeViewColumn14( _this );
310 this.el.append_column ( child_2.el );
313 // user defined functions
315 public class Xcls_default_packages_tree_store : Object
317 public Gtk.ListStore el;
318 private ValaProjectSettings _this;
324 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
327 _this.default_packages_tree_store = this;
328 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
333 // set gobject values
336 // user defined functions
337 public void load () {
339 var def = _this.project.compilegroups.get("_default_");
340 var items = def.packages;
343 var pal = (Palete.Gtk) Palete.factory("Gtk");
344 var pkgs = pal.packages(_this.project);
345 print("ValaProjectSettings:packages load %d\n", pkgs.size);
349 for(var i =0 ; i < pkgs.size; i++) {
350 this.el.append(out citer);
352 this.el.set_value(citer, 0, pkgs.get(i) ); // title
353 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
355 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
359 public class Xcls_TreeViewColumn12 : Object
361 public Gtk.TreeViewColumn el;
362 private ValaProjectSettings _this;
368 public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
371 this.el = new Gtk.TreeViewColumn();
375 // set gobject values
376 this.el.title = "package name";
377 this.el.expand = true;
378 this.el.resizable = true;
379 var child_0 = new Xcls_packages_render( _this );
381 this.el.pack_start ( child_0.el , false );
385 this.el.add_attribute(_this.packages_render.el , "text", 0 );
388 // user defined functions
390 public class Xcls_packages_render : Object
392 public Gtk.CellRendererText el;
393 private ValaProjectSettings _this;
399 public Xcls_packages_render(ValaProjectSettings _owner )
402 _this.packages_render = this;
403 this.el = new Gtk.CellRendererText();
407 // set gobject values
410 // user defined functions
412 public class Xcls_TreeViewColumn14 : Object
414 public Gtk.TreeViewColumn el;
415 private ValaProjectSettings _this;
421 public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
424 this.el = new Gtk.TreeViewColumn();
428 // set gobject values
429 this.el.title = "use";
430 this.el.resizable = false;
431 this.el.fixed_width = 50;
432 var child_0 = new Xcls_packages_render_use( _this );
434 this.el.pack_start ( child_0.el , false );
439 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
443 // user defined functions
445 public class Xcls_packages_render_use : Object
447 public Gtk.CellRendererToggle el;
448 private ValaProjectSettings _this;
454 public Xcls_packages_render_use(ValaProjectSettings _owner )
457 _this.packages_render_use = this;
458 this.el = new Gtk.CellRendererToggle();
462 // set gobject values
463 this.el.activatable = true;
466 this.el.toggled.connect( ( path_string) => {
467 var m = _this.default_packages_tree_store.el;
469 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
470 m.get_iter (out iter, path);
472 m.get_value(iter, 1, out val);
473 m.set_value(iter, 1, ((bool) val) ? false :true);
475 m.get_value(iter, 0, out fval);
476 var fn = (string)fval;
478 var def = _this.project.compilegroups.get("_default_");
479 var items = def.packages;
490 // user defined functions
492 public class Xcls_ScrolledWindow16 : Object
494 public Gtk.ScrolledWindow el;
495 private ValaProjectSettings _this;
501 public Xcls_ScrolledWindow16(ValaProjectSettings _owner )
504 this.el = new Gtk.ScrolledWindow( null, null );
508 // set gobject values
509 var child_0 = new Xcls_default_directory_tree( _this );
511 this.el.add ( child_0.el );
512 var child_1 = new Xcls_default_directory_menu( _this );
516 // user defined functions
518 public class Xcls_default_directory_tree : Object
520 public Gtk.TreeView el;
521 private ValaProjectSettings _this;
527 public Xcls_default_directory_tree(ValaProjectSettings _owner )
530 _this.default_directory_tree = this;
531 this.el = new Gtk.TreeView();
535 // set gobject values
536 this.el.headers_visible = true;
537 var child_0 = new Xcls_default_directory_tree_store( _this );
539 this.el.set_model ( child_0.el );
540 var child_1 = new Xcls_TreeViewColumn19( _this );
542 this.el.append_column ( child_1.el );
545 this.el.button_press_event.connect( ( ev) => {
546 //console.log("button press?");
549 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
550 //print("click" + ev.type);
554 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
558 // this.el.get_selection().select_path(res);
560 //if (!this.get('/LeftTreeMenu').el) {
561 // this.get('/LeftTreeMenu').init();
564 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
565 _this.default_directory_menu.el.show_all();
566 _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);
567 // print("click:" + res.path.to_string());
572 // user defined functions
574 public class Xcls_default_directory_tree_store : Object
576 public Gtk.ListStore el;
577 private ValaProjectSettings _this;
583 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
586 _this.default_directory_tree_store = this;
587 this.el = new Gtk.ListStore( 1, typeof(string)
592 // set gobject values
595 // user defined functions
596 public void load () {
601 var def = _this.project.compilegroups.get("_default_");
602 var items = def.sources;
607 for(var i =0 ; i < items.size; i++) {
608 this.el.append(out citer);
610 this.el.set_value(citer, 0, items.get(i) ); // title
611 //this.el.set_value(citer, 1, items.get(i) );
613 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
617 public class Xcls_TreeViewColumn19 : Object
619 public Gtk.TreeViewColumn el;
620 private ValaProjectSettings _this;
626 public Xcls_TreeViewColumn19(ValaProjectSettings _owner )
629 this.el = new Gtk.TreeViewColumn();
633 // set gobject values
634 this.el.title = "Available Directories (right click to add)";
635 this.el.resizable = true;
636 var child_0 = new Xcls_directory_render( _this );
638 this.el.pack_start ( child_0.el , false );
642 this.el.add_attribute(_this.directory_render.el , "text", 0 );
645 // user defined functions
647 public class Xcls_directory_render : Object
649 public Gtk.CellRendererText el;
650 private ValaProjectSettings _this;
656 public Xcls_directory_render(ValaProjectSettings _owner )
659 _this.directory_render = this;
660 this.el = new Gtk.CellRendererText();
664 // set gobject values
667 // user defined functions
669 public class Xcls_default_directory_menu : Object
672 private ValaProjectSettings _this;
678 public Xcls_default_directory_menu(ValaProjectSettings _owner )
681 _this.default_directory_menu = this;
682 this.el = new Gtk.Menu();
686 // set gobject values
687 var child_0 = new Xcls_MenuItem22( _this );
689 this.el.add ( child_0.el );
690 var child_1 = new Xcls_MenuItem23( _this );
692 this.el.add ( child_1.el );
693 var child_2 = new Xcls_SeparatorMenuItem24( _this );
695 this.el.add ( child_2.el );
696 var child_3 = new Xcls_MenuItem25( _this );
698 this.el.add ( child_3.el );
701 // user defined functions
703 public class Xcls_MenuItem22 : Object
705 public Gtk.MenuItem el;
706 private ValaProjectSettings _this;
712 public Xcls_MenuItem22(ValaProjectSettings _owner )
715 this.el = new Gtk.MenuItem();
719 // set gobject values
720 this.el.label = "Add Directory";
723 this.el.activate.connect( () => {
725 var chooser = new Gtk.FileChooserDialog (
726 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
728 Gtk.ResponseType.CANCEL,
730 Gtk.ResponseType.ACCEPT);
731 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
736 // add the directory..
737 var fn = _this.project.relPath(chooser.get_filename());
738 _this.project.compilegroups.get("_default_").sources.add(fn);
739 _this.default_directory_tree_store.load();
743 // user defined functions
745 public class Xcls_MenuItem23 : Object
747 public Gtk.MenuItem el;
748 private ValaProjectSettings _this;
754 public Xcls_MenuItem23(ValaProjectSettings _owner )
757 this.el = new Gtk.MenuItem();
761 // set gobject values
762 this.el.label = "Add File";
765 this.el.activate.connect( () => {
767 var chooser = new Gtk.FileChooserDialog (
768 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
770 Gtk.ResponseType.CANCEL,
772 Gtk.ResponseType.ACCEPT);
773 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
778 // add the directory..
779 var fn = _this.project.relPath(chooser.get_filename());
780 _this.project.compilegroups.get("_default_").sources.add(fn);
781 _this.default_directory_tree_store.load();
785 // user defined functions
787 public class Xcls_SeparatorMenuItem24 : Object
789 public Gtk.SeparatorMenuItem el;
790 private ValaProjectSettings _this;
796 public Xcls_SeparatorMenuItem24(ValaProjectSettings _owner )
799 this.el = new Gtk.SeparatorMenuItem();
803 // set gobject values
806 // user defined functions
808 public class Xcls_MenuItem25 : Object
810 public Gtk.MenuItem el;
811 private ValaProjectSettings _this;
817 public Xcls_MenuItem25(ValaProjectSettings _owner )
820 this.el = new Gtk.MenuItem();
824 // set gobject values
825 this.el.label = "Remove File/Directory";
828 this.el.activate.connect( () => {
833 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
834 print("nothing selected\n");
839 // add the directory..
843 mod.get_value(iter,0, out val);
844 var fn = (string) val;
846 print("remove: %s\n", fn);
847 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
848 print("remove failed");
850 _this.default_directory_tree_store.load();
854 // user defined functions
856 public class Xcls_HPaned26 : Object
858 public Gtk.HPaned el;
859 private ValaProjectSettings _this;
865 public Xcls_HPaned26(ValaProjectSettings _owner )
868 this.el = new Gtk.HPaned();
872 // set gobject values
873 this.el.position = 300;
874 var child_0 = new Xcls_ScrolledWindow27( _this );
876 this.el.add1 ( child_0.el );
877 var child_1 = new Xcls_set_vbox( _this );
879 this.el.add2 ( child_1.el );
882 // user defined functions
884 public class Xcls_ScrolledWindow27 : Object
886 public Gtk.ScrolledWindow el;
887 private ValaProjectSettings _this;
893 public Xcls_ScrolledWindow27(ValaProjectSettings _owner )
896 this.el = new Gtk.ScrolledWindow( null, null );
900 // set gobject values
901 var child_0 = new Xcls_targets_tree_menu( _this );
903 this.el.add ( child_0.el );
904 var child_1 = new Xcls_targets_tree( _this );
906 this.el.add ( child_1.el );
911 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
916 // user defined functions
918 public class Xcls_targets_tree_menu : Object
921 private ValaProjectSettings _this;
927 public Xcls_targets_tree_menu(ValaProjectSettings _owner )
930 _this.targets_tree_menu = this;
931 this.el = new Gtk.Menu();
935 // set gobject values
936 var child_0 = new Xcls_MenuItem29( _this );
938 this.el.add ( child_0.el );
939 var child_1 = new Xcls_SeparatorMenuItem30( _this );
941 this.el.add ( child_1.el );
942 var child_2 = new Xcls_MenuItem31( _this );
944 this.el.add ( child_2.el );
947 // user defined functions
949 public class Xcls_MenuItem29 : Object
951 public Gtk.MenuItem el;
952 private ValaProjectSettings _this;
958 public Xcls_MenuItem29(ValaProjectSettings _owner )
961 this.el = new Gtk.MenuItem();
965 // set gobject values
966 this.el.label = "Add Compile Target";
969 this.el.activate.connect( () => {
971 if (_this.project.compilegroups.has_key("NEW GROUP")) {
975 // add the directory..
977 _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
978 _this.targets_tree_store.load();
982 // user defined functions
984 public class Xcls_SeparatorMenuItem30 : Object
986 public Gtk.SeparatorMenuItem el;
987 private ValaProjectSettings _this;
993 public Xcls_SeparatorMenuItem30(ValaProjectSettings _owner )
996 this.el = new Gtk.SeparatorMenuItem();
1000 // set gobject values
1003 // user defined functions
1005 public class Xcls_MenuItem31 : Object
1007 public Gtk.MenuItem el;
1008 private ValaProjectSettings _this;
1014 public Xcls_MenuItem31(ValaProjectSettings _owner )
1017 this.el = new Gtk.MenuItem();
1021 // set gobject values
1022 this.el.label = "Remove Target";
1025 this.el.activate.connect( () => {
1030 if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1031 print("nothing selected\n");
1036 // add the directory..
1040 mod.get_value(iter,0, out val);
1041 var fn = (string) val;
1043 print("remove: %s\n", fn);
1044 if (!_this.project.compilegroups.unset(fn)) {
1045 print("remove failed");
1047 _this.targets_tree_store.load();
1051 // user defined functions
1053 public class Xcls_targets_tree : Object
1055 public Gtk.TreeView el;
1056 private ValaProjectSettings _this;
1060 public string cursor;
1063 public Xcls_targets_tree(ValaProjectSettings _owner )
1066 _this.targets_tree = this;
1067 this.el = new Gtk.TreeView();
1071 // set gobject values
1072 var child_0 = new Xcls_targets_tree_store( _this );
1074 this.el.set_model ( child_0.el );
1075 var child_1 = new Xcls_TreeViewColumn34( _this );
1077 this.el.append_column ( child_1.el );
1080 this.el.button_press_event.connect( ( ev) => {
1081 //console.log("button press?");
1084 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
1085 //print("click" + ev.type);
1089 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1093 // this.el.get_selection().select_path(res);
1095 //if (!this.get('/LeftTreeMenu').el) {
1096 // this.get('/LeftTreeMenu').init();
1099 _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1100 _this.targets_tree_menu.el.show_all();
1101 _this.targets_tree_menu.el.popup(null, null, null, 3, ev.time);
1102 // print("click:" + res.path.to_string());
1105 this.el.cursor_changed.connect( ( ) => {
1107 if (this.cursor != "") {
1108 // save the values..
1111 // load the new values.
1116 if (!this.el.get_selection().get_selected(out mod, out iter)) {
1117 print("nothing selected\n");
1118 // should disable the right hand side..
1119 _this.set_vbox.el.hide();
1122 _this.set_vbox.el.show();
1124 // add the directory..
1128 mod.get_value(iter,0, out val);
1129 var fn = (string) val;
1132 var cg = _this.project.compilegroups.get(fn);
1134 _this.build_pack_target.el.set_text(cg.target_bin);
1135 _this.build_compile_flags.el.set_text(cg.compile_flags);
1136 _this.set_vbox.cgroup = cg;
1137 _this.files_tree_store.update();
1145 // user defined functions
1147 public class Xcls_targets_tree_store : Object
1149 public Gtk.ListStore el;
1150 private ValaProjectSettings _this;
1156 public Xcls_targets_tree_store(ValaProjectSettings _owner )
1159 _this.targets_tree_store = this;
1160 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1161 typeof(string) // ??
1166 // set gobject values
1169 // user defined functions
1170 public void load () {
1175 var cg = _this.project.compilegroups;
1177 _this.targets_tree.cursor = "";
1179 var iter = cg.map_iterator();
1180 while(iter.next()) {
1181 var key = iter.get_key();
1182 if (key == "_default_") {
1186 this.el.append(out citer);
1188 this.el.set_value(citer, 0, key ); // title
1189 //this.el.set_value(citer, 1, items.get(i) );
1191 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1192 _this.set_vbox.el.hide();
1195 public class Xcls_TreeViewColumn34 : Object
1197 public Gtk.TreeViewColumn el;
1198 private ValaProjectSettings _this;
1204 public Xcls_TreeViewColumn34(ValaProjectSettings _owner )
1207 this.el = new Gtk.TreeViewColumn();
1211 // set gobject values
1212 this.el.title = "name";
1213 this.el.resizable = true;
1214 var child_0 = new Xcls_targets_render( _this );
1216 this.el.pack_start ( child_0.el , false );
1221 this.el.add_attribute(_this.targets_render.el , "text", 0 );
1225 // user defined functions
1227 public class Xcls_targets_render : Object
1229 public Gtk.CellRendererText el;
1230 private ValaProjectSettings _this;
1236 public Xcls_targets_render(ValaProjectSettings _owner )
1239 _this.targets_render = this;
1240 this.el = new Gtk.CellRendererText();
1244 // set gobject values
1245 this.el.editable = true;
1248 this.el.edited.connect( (path, newtext) => {
1251 _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1253 _this.targets_tree_store.el.get_value(iter,0, out gval);
1254 var oldval = (string)gval;
1255 if (oldval == newtext) {
1258 var cg = _this.project.compilegroups.get(oldval);
1260 _this.project.compilegroups.unset(oldval);
1261 _this.project.compilegroups.set(newtext, cg);
1262 _this.targets_tree_store.load();
1266 // user defined functions
1268 public class Xcls_set_vbox : Object
1271 private ValaProjectSettings _this;
1275 public Project.GtkValaSettings cgroup;
1278 public Xcls_set_vbox(ValaProjectSettings _owner )
1281 _this.set_vbox = this;
1282 this.el = new Gtk.VBox( false, 0 );
1287 // set gobject values
1288 var child_0 = new Xcls_Label37( _this );
1290 this.el.pack_start ( child_0.el , false,false,0 );
1291 var child_1 = new Xcls_build_pack_target( _this );
1293 this.el.pack_start ( child_1.el , false,false,0 );
1294 var child_2 = new Xcls_Label39( _this );
1296 this.el.pack_start ( child_2.el , false,false,0 );
1297 var child_3 = new Xcls_build_compile_flags( _this );
1299 this.el.pack_start ( child_3.el , false,false,0 );
1300 var child_4 = new Xcls_Label41( _this );
1302 this.el.pack_start ( child_4.el , false,false,0 );
1303 var child_5 = new Xcls_ScrolledWindow42( _this );
1305 this.el.pack_start ( child_5.el , true,true,0 );
1308 // user defined functions
1310 public class Xcls_Label37 : Object
1312 public Gtk.Label el;
1313 private ValaProjectSettings _this;
1319 public Xcls_Label37(ValaProjectSettings _owner )
1322 this.el = new Gtk.Label( "target filename" );
1326 // set gobject values
1329 // user defined functions
1331 public class Xcls_build_pack_target : Object
1333 public Gtk.Entry el;
1334 private ValaProjectSettings _this;
1340 public Xcls_build_pack_target(ValaProjectSettings _owner )
1343 _this.build_pack_target = this;
1344 this.el = new Gtk.Entry();
1348 // set gobject values
1351 this.el.changed.connect( () => {
1352 if (_this.targets_tree.cursor.length < 1) {
1355 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1359 // user defined functions
1361 public class Xcls_Label39 : Object
1363 public Gtk.Label el;
1364 private ValaProjectSettings _this;
1370 public Xcls_Label39(ValaProjectSettings _owner )
1373 this.el = new Gtk.Label( "compile flags" );
1377 // set gobject values
1380 // user defined functions
1382 public class Xcls_build_compile_flags : Object
1384 public Gtk.Entry el;
1385 private ValaProjectSettings _this;
1391 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1394 _this.build_compile_flags = this;
1395 this.el = new Gtk.Entry();
1399 // set gobject values
1402 this.el.changed.connect( () => {
1403 if (_this.targets_tree.cursor.length < 1) {
1406 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1410 // user defined functions
1412 public class Xcls_Label41 : Object
1414 public Gtk.Label el;
1415 private ValaProjectSettings _this;
1421 public Xcls_Label41(ValaProjectSettings _owner )
1424 this.el = new Gtk.Label( "Files to compile" );
1428 // set gobject values
1431 // user defined functions
1433 public class Xcls_ScrolledWindow42 : Object
1435 public Gtk.ScrolledWindow el;
1436 private ValaProjectSettings _this;
1442 public Xcls_ScrolledWindow42(ValaProjectSettings _owner )
1445 this.el = new Gtk.ScrolledWindow( null, null );
1449 // set gobject values
1450 var child_0 = new Xcls_files_tree( _this );
1452 this.el.add ( child_0.el );
1455 // user defined functions
1457 public class Xcls_files_tree : Object
1459 public Gtk.TreeView el;
1460 private ValaProjectSettings _this;
1466 public Xcls_files_tree(ValaProjectSettings _owner )
1469 this.el = new Gtk.TreeView();
1473 // set gobject values
1474 var child_0 = new Xcls_files_tree_store( _this );
1476 this.el.set_model ( child_0.el );
1477 var child_1 = new Xcls_TreeViewColumn45( _this );
1479 this.el.append_column ( child_1.el );
1480 var child_2 = new Xcls_TreeViewColumn47( _this );
1482 this.el.append_column ( child_2.el );
1485 // user defined functions
1487 public class Xcls_files_tree_store : Object
1489 public Gtk.ListStore el;
1490 private ValaProjectSettings _this;
1496 public Xcls_files_tree_store(ValaProjectSettings _owner )
1499 _this.files_tree_store = this;
1500 this.el = new Gtk.ListStore( 4, typeof(string), // 0 file name
1501 typeof(string), // 0 basename
1502 typeof(string), // type (dir orfile)
1503 typeof(bool) // is checked.
1508 // set gobject values
1511 // user defined functions
1512 public void updateDir (string dname, bool bval) {
1516 var cg = _this.set_vbox.cgroup;
1517 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1518 this.el.iter_nth_child(out citer,null,i);
1521 this.el.get_value(citer,0, out val);
1522 var fn = (string) val;
1524 if ( Path.get_dirname (fn) == dname) {
1526 this.el.set_value(citer, 3, bval ); // checked
1532 if (cg.sources.contains(fn)) {
1533 cg.sources.remove(fn);
1536 if (!cg.sources.contains(fn)) {
1546 public void load () {
1551 var def = _this.project.compilegroups.get("_default_");
1552 var items = def.sources;
1560 for(var i =0 ; i < items.size; i++) {
1562 var files = _this.project.files(items.get(i));
1563 if (files.size < 1) {
1567 this.el.append(out citer);
1569 this.el.set_value(citer, 0, items.get(i) ); // title
1570 this.el.set_value(citer, 1, "<span foreground=\"green\" font_weight=\"bold\">" +
1571 GLib.Markup.escape_text(items.get(i)) + "</span>"
1573 print("ADD item %s", items.get(i));
1574 this.el.set_value(citer, 2, "dir"); // type
1575 this.el.set_value(citer, 3, false ); // checked
1579 for(var j =0 ; j < files.size; j++) {
1580 this.el.append(out citer);
1581 print("ADD item %s", files.get(j));
1582 this.el.set_value(citer, 0, files.get(j) ); // title
1583 this.el.set_value(citer, 1, GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title
1584 this.el.set_value(citer, 2, "file"); // type
1585 this.el.set_value(citer, 3, false ); // checked
1590 //this.el.set_value(citer, 1, items.get(i) );
1592 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1595 public void update () {
1600 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1601 this.el.iter_nth_child(out citer,null,i);
1604 this.el.get_value(citer,0, out val);
1605 var fn = (string) val;
1608 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1612 this.el.set_value(citer, 3, active ); // checked
1618 public class Xcls_TreeViewColumn45 : Object
1620 public Gtk.TreeViewColumn el;
1621 private ValaProjectSettings _this;
1627 public Xcls_TreeViewColumn45(ValaProjectSettings _owner )
1630 this.el = new Gtk.TreeViewColumn();
1634 // set gobject values
1635 this.el.title = "name";
1636 this.el.resizable = true;
1637 var child_0 = new Xcls_files_render( _this );
1639 this.el.pack_start ( child_0.el , false );
1643 this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1645 /* this.el.add_attribute(_this.files_render.el , "markup", 2 );
1649 // user defined functions
1651 public class Xcls_files_render : Object
1653 public Gtk.CellRendererText el;
1654 private ValaProjectSettings _this;
1660 public Xcls_files_render(ValaProjectSettings _owner )
1663 _this.files_render = this;
1664 this.el = new Gtk.CellRendererText();
1668 // set gobject values
1671 // user defined functions
1673 public class Xcls_TreeViewColumn47 : Object
1675 public Gtk.TreeViewColumn el;
1676 private ValaProjectSettings _this;
1682 public Xcls_TreeViewColumn47(ValaProjectSettings _owner )
1685 this.el = new Gtk.TreeViewColumn();
1689 // set gobject values
1690 this.el.title = "use";
1691 this.el.resizable = false;
1692 this.el.fixed_width = 50;
1693 var child_0 = new Xcls_files_render_use( _this );
1695 this.el.pack_start ( child_0.el , false );
1700 this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1704 // user defined functions
1706 public class Xcls_files_render_use : Object
1708 public Gtk.CellRendererToggle el;
1709 private ValaProjectSettings _this;
1715 public Xcls_files_render_use(ValaProjectSettings _owner )
1718 _this.files_render_use = this;
1719 this.el = new Gtk.CellRendererToggle();
1723 // set gobject values
1724 this.el.activatable = true;
1727 this.el.toggled.connect( ( path_string) => {
1731 var m = _this.files_tree_store.el;
1733 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1734 m.get_iter (out iter, path);
1736 m.get_value(iter, 3, out val);
1737 m.set_value(iter, 3, ((bool) val) ? false :true);
1741 m.get_value(iter, 2, out ftval);
1742 var ftype = (string)ftval;
1746 m.get_value(iter, 0, out fval);
1747 var fn = (string)fval;
1750 var cg = _this.set_vbox.cgroup;
1751 // what's the sleected target?
1752 // update the list..
1753 // if ftype is a dir == then toggle all the bellow.
1755 if (ftype == "dir") {
1756 _this.files_tree_store.updateDir(fn, ((bool) val) ? false :true);
1759 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1764 cg.sources.remove(fn);
1772 // user defined functions