1 static ValaProjectSettings _ValaProjectSettings;
3 public class ValaProjectSettings : Object
6 private ValaProjectSettings _this;
8 public static ValaProjectSettings singleton()
10 if (_ValaProjectSettings == null) {
11 _ValaProjectSettings= new ValaProjectSettings();
13 return _ValaProjectSettings;
15 public Xcls_label_global label_global;
16 public Xcls_label_targets label_targets;
17 public Xcls_compile_flags compile_flags;
18 public Xcls_default_packages_tree_store default_packages_tree_store;
19 public Xcls_packages_render packages_render;
20 public Xcls_packages_render_use packages_render_use;
21 public Xcls_default_directory_tree default_directory_tree;
22 public Xcls_default_directory_tree_store default_directory_tree_store;
23 public Xcls_directory_render directory_render;
24 public Xcls_default_directory_menu default_directory_menu;
25 public Xcls_targets_tree_menu targets_tree_menu;
26 public Xcls_targets_tree targets_tree;
27 public Xcls_targets_tree_store targets_tree_store;
28 public Xcls_targets_render targets_render;
29 public Xcls_set_vbox set_vbox;
30 public Xcls_build_pack_target build_pack_target;
31 public Xcls_build_compile_flags build_compile_flags;
32 public Xcls_files_tree_store files_tree_store;
33 public Xcls_files_render files_render;
34 public Xcls_files_render_use files_render_use;
37 public Project.Gtk project;
38 public Xcls_MainWindow window;
41 public ValaProjectSettings()
44 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
51 this.el.hexpand = true;
52 var child_0 = new Xcls_Notebook2( _this );
54 this.el.pack_start ( child_0.el , true,true,0 );
57 // user defined functions
58 public void show (Project.Gtk project) {
61 print("ValaProjectSettings show\n");
63 this.project= project;
65 this.compile_flags.el.text = _this.project.compilegroups.get("_default_").compile_flags;
67 this.default_directory_tree_store.load();
68 this.default_packages_tree_store.load();
69 this.targets_tree_store.load();
70 this.files_tree_store.load();
74 this.project.writeConfig();
76 public class Xcls_Notebook2 : Object
78 public Gtk.Notebook el;
79 private ValaProjectSettings _this;
85 public Xcls_Notebook2(ValaProjectSettings _owner )
88 this.el = new Gtk.Notebook();
93 var child_0 = new Xcls_label_global( _this );
95 var child_1 = new Xcls_label_targets( _this );
97 var child_2 = new Xcls_Box5( _this );
99 this.el.append_page ( child_2.el , _this.label_global.el );
100 var child_3 = new Xcls_Paned26( _this );
102 this.el.append_page ( child_3.el , _this.label_targets.el );
105 // user defined functions
107 public class Xcls_label_global : Object
110 private ValaProjectSettings _this;
116 public Xcls_label_global(ValaProjectSettings _owner )
119 _this.label_global = this;
120 this.el = new Gtk.Label( "Global" );
124 // set gobject values
127 // user defined functions
130 public class Xcls_label_targets : Object
133 private ValaProjectSettings _this;
139 public Xcls_label_targets(ValaProjectSettings _owner )
142 _this.label_targets = this;
143 this.el = new Gtk.Label( "Targets" );
147 // set gobject values
150 // user defined functions
153 public class Xcls_Box5 : Object
156 private ValaProjectSettings _this;
162 public Xcls_Box5(ValaProjectSettings _owner )
165 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
169 // set gobject values
170 this.el.homogeneous = false;
171 var child_0 = new Xcls_Label6( _this );
173 this.el.pack_start ( child_0.el , false,false,0 );
174 var child_1 = new Xcls_compile_flags( _this );
176 this.el.pack_start ( child_1.el , false,false,0 );
177 var child_2 = new Xcls_Paned8( _this );
179 this.el.pack_start ( child_2.el , true,true,0 );
182 // user defined functions
184 public class Xcls_Label6 : Object
187 private ValaProjectSettings _this;
193 public Xcls_Label6(ValaProjectSettings _owner )
196 this.el = new Gtk.Label( "compile flags" );
200 // set gobject values
203 // user defined functions
206 public class Xcls_compile_flags : Object
209 private ValaProjectSettings _this;
215 public Xcls_compile_flags(ValaProjectSettings _owner )
218 _this.compile_flags = this;
219 this.el = new Gtk.Entry();
223 // set gobject values
224 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
227 this.el.changed.connect( () => {
229 _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
230 _this.project.writeConfig();
231 // _this.project.save();
236 // user defined functions
239 public class Xcls_Paned8 : Object
242 private ValaProjectSettings _this;
248 public Xcls_Paned8(ValaProjectSettings _owner )
251 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
255 // set gobject values
256 this.el.position = 300;
257 var child_0 = new Xcls_ScrolledWindow9( _this );
259 this.el.add ( child_0.el );
260 var child_1 = new Xcls_ScrolledWindow16( _this );
262 this.el.add2 ( child_1.el );
265 // user defined functions
267 public class Xcls_ScrolledWindow9 : Object
269 public Gtk.ScrolledWindow el;
270 private ValaProjectSettings _this;
276 public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
279 this.el = new Gtk.ScrolledWindow( null, null );
283 // set gobject values
284 this.el.hexpand = true;
285 var child_0 = new Xcls_default_packages_tree( _this );
287 this.el.add ( child_0.el );
290 // user defined functions
292 public class Xcls_default_packages_tree : Object
294 public Gtk.TreeView el;
295 private ValaProjectSettings _this;
301 public Xcls_default_packages_tree(ValaProjectSettings _owner )
304 this.el = new Gtk.TreeView();
308 // set gobject values
309 this.el.headers_visible = true;
310 var child_0 = new Xcls_default_packages_tree_store( _this );
312 this.el.set_model ( child_0.el );
313 var child_1 = new Xcls_TreeViewColumn12( _this );
315 this.el.append_column ( child_1.el );
316 var child_2 = new Xcls_TreeViewColumn14( _this );
318 this.el.append_column ( child_2.el );
321 // user defined functions
323 public class Xcls_default_packages_tree_store : Object
325 public Gtk.ListStore el;
326 private ValaProjectSettings _this;
332 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
335 _this.default_packages_tree_store = this;
336 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
341 // set gobject values
344 // user defined functions
345 public void load () {
347 var def = _this.project.compilegroups.get("_default_");
348 var items = def.packages;
351 var pal = (Palete.Gtk) Palete.factory("Gtk");
352 var pkgs = pal.packages(_this.project);
353 print("ValaProjectSettings:packages load %d\n", pkgs.size);
357 for(var i =0 ; i < pkgs.size; i++) {
358 this.el.append(out citer);
360 this.el.set_value(citer, 0, pkgs.get(i) ); // title
361 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
363 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
368 public class Xcls_TreeViewColumn12 : Object
370 public Gtk.TreeViewColumn el;
371 private ValaProjectSettings _this;
377 public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
380 this.el = new Gtk.TreeViewColumn();
384 // set gobject values
385 this.el.title = "package name";
386 this.el.expand = true;
387 this.el.resizable = true;
388 var child_0 = new Xcls_packages_render( _this );
390 this.el.pack_start ( child_0.el , false );
394 this.el.add_attribute(_this.packages_render.el , "text", 0 );
397 // user defined functions
399 public class Xcls_packages_render : Object
401 public Gtk.CellRendererText el;
402 private ValaProjectSettings _this;
408 public Xcls_packages_render(ValaProjectSettings _owner )
411 _this.packages_render = this;
412 this.el = new Gtk.CellRendererText();
416 // set gobject values
419 // user defined functions
423 public class Xcls_TreeViewColumn14 : Object
425 public Gtk.TreeViewColumn el;
426 private ValaProjectSettings _this;
432 public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
435 this.el = new Gtk.TreeViewColumn();
439 // set gobject values
440 this.el.title = "use";
441 this.el.resizable = false;
442 this.el.fixed_width = 50;
443 var child_0 = new Xcls_packages_render_use( _this );
445 this.el.pack_start ( child_0.el , false );
450 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
454 // user defined functions
456 public class Xcls_packages_render_use : Object
458 public Gtk.CellRendererToggle el;
459 private ValaProjectSettings _this;
465 public Xcls_packages_render_use(ValaProjectSettings _owner )
468 _this.packages_render_use = this;
469 this.el = new Gtk.CellRendererToggle();
473 // set gobject values
474 this.el.activatable = true;
477 this.el.toggled.connect( ( path_string) => {
478 var m = _this.default_packages_tree_store.el;
480 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
481 m.get_iter (out iter, path);
483 m.get_value(iter, 1, out val);
484 m.set_value(iter, 1, ((bool) val) ? false :true);
486 m.get_value(iter, 0, out fval);
487 var fn = (string)fval;
489 var def = _this.project.compilegroups.get("_default_");
490 var items = def.packages;
501 // user defined functions
507 public class Xcls_ScrolledWindow16 : Object
509 public Gtk.ScrolledWindow el;
510 private ValaProjectSettings _this;
516 public Xcls_ScrolledWindow16(ValaProjectSettings _owner )
519 this.el = new Gtk.ScrolledWindow( null, null );
523 // set gobject values
524 this.el.hexpand = true;
525 var child_0 = new Xcls_default_directory_tree( _this );
527 this.el.add ( child_0.el );
528 var child_1 = new Xcls_default_directory_menu( _this );
532 // user defined functions
534 public class Xcls_default_directory_tree : Object
536 public Gtk.TreeView el;
537 private ValaProjectSettings _this;
543 public Xcls_default_directory_tree(ValaProjectSettings _owner )
546 _this.default_directory_tree = this;
547 this.el = new Gtk.TreeView();
551 // set gobject values
552 this.el.headers_visible = true;
553 var child_0 = new Xcls_default_directory_tree_store( _this );
555 this.el.set_model ( child_0.el );
556 var child_1 = new Xcls_TreeViewColumn19( _this );
558 this.el.append_column ( child_1.el );
561 this.el.button_press_event.connect( ( ev) => {
562 //console.log("button press?");
565 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
566 //print("click" + ev.type);
570 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
574 // this.el.get_selection().select_path(res);
576 //if (!this.get('/LeftTreeMenu').el) {
577 // this.get('/LeftTreeMenu').init();
580 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
581 _this.default_directory_menu.el.show_all();
582 _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);
583 // print("click:" + res.path.to_string());
588 // user defined functions
590 public class Xcls_default_directory_tree_store : Object
592 public Gtk.ListStore el;
593 private ValaProjectSettings _this;
599 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
602 _this.default_directory_tree_store = this;
603 this.el = new Gtk.ListStore( 1, typeof(string)
608 // set gobject values
611 // user defined functions
612 public void load () {
617 var def = _this.project.compilegroups.get("_default_");
618 var items = def.sources;
623 for(var i =0 ; i < items.size; i++) {
624 this.el.append(out citer);
626 this.el.set_value(citer, 0, items.get(i) ); // title
627 //this.el.set_value(citer, 1, items.get(i) );
629 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
634 public class Xcls_TreeViewColumn19 : Object
636 public Gtk.TreeViewColumn el;
637 private ValaProjectSettings _this;
643 public Xcls_TreeViewColumn19(ValaProjectSettings _owner )
646 this.el = new Gtk.TreeViewColumn();
650 // set gobject values
651 this.el.title = "Available Directories (right click to add)";
652 this.el.resizable = true;
653 var child_0 = new Xcls_directory_render( _this );
655 this.el.pack_start ( child_0.el , false );
659 this.el.add_attribute(_this.directory_render.el , "text", 0 );
662 // user defined functions
664 public class Xcls_directory_render : Object
666 public Gtk.CellRendererText el;
667 private ValaProjectSettings _this;
673 public Xcls_directory_render(ValaProjectSettings _owner )
676 _this.directory_render = this;
677 this.el = new Gtk.CellRendererText();
681 // set gobject values
684 // user defined functions
689 public class Xcls_default_directory_menu : Object
692 private ValaProjectSettings _this;
698 public Xcls_default_directory_menu(ValaProjectSettings _owner )
701 _this.default_directory_menu = this;
702 this.el = new Gtk.Menu();
706 // set gobject values
707 var child_0 = new Xcls_MenuItem22( _this );
709 this.el.add ( child_0.el );
710 var child_1 = new Xcls_MenuItem23( _this );
712 this.el.add ( child_1.el );
713 var child_2 = new Xcls_SeparatorMenuItem24( _this );
715 this.el.add ( child_2.el );
716 var child_3 = new Xcls_MenuItem25( _this );
718 this.el.add ( child_3.el );
721 // user defined functions
723 public class Xcls_MenuItem22 : Object
725 public Gtk.MenuItem el;
726 private ValaProjectSettings _this;
732 public Xcls_MenuItem22(ValaProjectSettings _owner )
735 this.el = new Gtk.MenuItem();
739 // set gobject values
740 this.el.label = "Add Directory";
743 this.el.activate.connect( () => {
745 var chooser = new Gtk.FileChooserDialog (
746 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
748 Gtk.ResponseType.CANCEL,
750 Gtk.ResponseType.ACCEPT);
751 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
756 // add the directory..
757 var fn = _this.project.relPath(chooser.get_filename());
758 _this.project.compilegroups.get("_default_").sources.add(fn);
759 _this.default_directory_tree_store.load();
763 // user defined functions
766 public class Xcls_MenuItem23 : Object
768 public Gtk.MenuItem el;
769 private ValaProjectSettings _this;
775 public Xcls_MenuItem23(ValaProjectSettings _owner )
778 this.el = new Gtk.MenuItem();
782 // set gobject values
783 this.el.label = "Add File";
786 this.el.activate.connect( () => {
788 var chooser = new Gtk.FileChooserDialog (
789 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
791 Gtk.ResponseType.CANCEL,
793 Gtk.ResponseType.ACCEPT);
794 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
799 // add the directory..
800 var fn = _this.project.relPath(chooser.get_filename());
801 _this.project.compilegroups.get("_default_").sources.add(fn);
802 _this.default_directory_tree_store.load();
806 // user defined functions
809 public class Xcls_SeparatorMenuItem24 : Object
811 public Gtk.SeparatorMenuItem el;
812 private ValaProjectSettings _this;
818 public Xcls_SeparatorMenuItem24(ValaProjectSettings _owner )
821 this.el = new Gtk.SeparatorMenuItem();
825 // set gobject values
828 // user defined functions
831 public class Xcls_MenuItem25 : Object
833 public Gtk.MenuItem el;
834 private ValaProjectSettings _this;
840 public Xcls_MenuItem25(ValaProjectSettings _owner )
843 this.el = new Gtk.MenuItem();
847 // set gobject values
848 this.el.label = "Remove File/Directory";
851 this.el.activate.connect( () => {
856 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
857 print("nothing selected\n");
862 // add the directory..
866 mod.get_value(iter,0, out val);
867 var fn = (string) val;
869 print("remove: %s\n", fn);
870 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
871 print("remove failed");
873 _this.default_directory_tree_store.load();
877 // user defined functions
884 public class Xcls_Paned26 : Object
887 private ValaProjectSettings _this;
893 public Xcls_Paned26(ValaProjectSettings _owner )
896 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
900 // set gobject values
901 this.el.position = 300;
902 var child_0 = new Xcls_ScrolledWindow27( _this );
904 this.el.add1 ( child_0.el );
905 var child_1 = new Xcls_set_vbox( _this );
907 this.el.add2 ( child_1.el );
910 // user defined functions
912 public class Xcls_ScrolledWindow27 : Object
914 public Gtk.ScrolledWindow el;
915 private ValaProjectSettings _this;
921 public Xcls_ScrolledWindow27(ValaProjectSettings _owner )
924 this.el = new Gtk.ScrolledWindow( null, null );
928 // set gobject values
929 var child_0 = new Xcls_targets_tree_menu( _this );
931 this.el.add ( child_0.el );
932 var child_1 = new Xcls_targets_tree( _this );
934 this.el.add ( child_1.el );
939 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
944 // user defined functions
946 public class Xcls_targets_tree_menu : Object
949 private ValaProjectSettings _this;
955 public Xcls_targets_tree_menu(ValaProjectSettings _owner )
958 _this.targets_tree_menu = this;
959 this.el = new Gtk.Menu();
963 // set gobject values
964 var child_0 = new Xcls_MenuItem29( _this );
966 this.el.add ( child_0.el );
967 var child_1 = new Xcls_SeparatorMenuItem30( _this );
969 this.el.add ( child_1.el );
970 var child_2 = new Xcls_MenuItem31( _this );
972 this.el.add ( child_2.el );
975 // user defined functions
977 public class Xcls_MenuItem29 : Object
979 public Gtk.MenuItem el;
980 private ValaProjectSettings _this;
986 public Xcls_MenuItem29(ValaProjectSettings _owner )
989 this.el = new Gtk.MenuItem();
993 // set gobject values
994 this.el.label = "Add Compile Target";
997 this.el.activate.connect( () => {
999 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1003 // add the directory..
1005 _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
1006 _this.targets_tree_store.load();
1010 // user defined functions
1013 public class Xcls_SeparatorMenuItem30 : Object
1015 public Gtk.SeparatorMenuItem el;
1016 private ValaProjectSettings _this;
1022 public Xcls_SeparatorMenuItem30(ValaProjectSettings _owner )
1025 this.el = new Gtk.SeparatorMenuItem();
1029 // set gobject values
1032 // user defined functions
1035 public class Xcls_MenuItem31 : Object
1037 public Gtk.MenuItem el;
1038 private ValaProjectSettings _this;
1044 public Xcls_MenuItem31(ValaProjectSettings _owner )
1047 this.el = new Gtk.MenuItem();
1051 // set gobject values
1052 this.el.label = "Remove Target";
1055 this.el.activate.connect( () => {
1060 if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1061 print("nothing selected\n");
1066 // add the directory..
1070 mod.get_value(iter,0, out val);
1071 var fn = (string) val;
1073 print("remove: %s\n", fn);
1074 if (!_this.project.compilegroups.unset(fn)) {
1075 print("remove failed");
1077 _this.targets_tree_store.load();
1081 // user defined functions
1085 public class Xcls_targets_tree : Object
1087 public Gtk.TreeView el;
1088 private ValaProjectSettings _this;
1092 public string cursor;
1095 public Xcls_targets_tree(ValaProjectSettings _owner )
1098 _this.targets_tree = this;
1099 this.el = new Gtk.TreeView();
1103 // set gobject values
1104 var child_0 = new Xcls_targets_tree_store( _this );
1106 this.el.set_model ( child_0.el );
1107 var child_1 = new Xcls_TreeViewColumn34( _this );
1109 this.el.append_column ( child_1.el );
1112 this.el.button_press_event.connect( ( ev) => {
1113 //console.log("button press?");
1116 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
1117 //print("click" + ev.type);
1121 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1125 // this.el.get_selection().select_path(res);
1127 //if (!this.get('/LeftTreeMenu').el) {
1128 // this.get('/LeftTreeMenu').init();
1131 _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1132 _this.targets_tree_menu.el.show_all();
1133 _this.targets_tree_menu.el.popup(null, null, null, 3, ev.time);
1134 // print("click:" + res.path.to_string());
1137 this.el.cursor_changed.connect( ( ) => {
1139 if (this.cursor != "") {
1140 // save the values..
1143 // load the new values.
1148 if (!this.el.get_selection().get_selected(out mod, out iter)) {
1149 print("nothing selected\n");
1150 // should disable the right hand side..
1151 _this.set_vbox.el.hide();
1154 _this.set_vbox.el.show();
1156 // add the directory..
1160 mod.get_value(iter,0, out val);
1161 var fn = (string) val;
1164 var cg = _this.project.compilegroups.get(fn);
1166 _this.build_pack_target.el.set_text(cg.target_bin);
1167 _this.build_compile_flags.el.set_text(cg.compile_flags);
1168 _this.set_vbox.cgroup = cg;
1169 _this.files_tree_store.update();
1177 // user defined functions
1179 public class Xcls_targets_tree_store : Object
1181 public Gtk.ListStore el;
1182 private ValaProjectSettings _this;
1188 public Xcls_targets_tree_store(ValaProjectSettings _owner )
1191 _this.targets_tree_store = this;
1192 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1193 typeof(string) // ??
1198 // set gobject values
1201 // user defined functions
1202 public void load () {
1207 var cg = _this.project.compilegroups;
1209 _this.targets_tree.cursor = "";
1211 var iter = cg.map_iterator();
1212 while(iter.next()) {
1213 var key = iter.get_key();
1214 if (key == "_default_") {
1218 this.el.append(out citer);
1220 this.el.set_value(citer, 0, key ); // title
1221 //this.el.set_value(citer, 1, items.get(i) );
1223 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1224 _this.set_vbox.el.hide();
1228 public class Xcls_TreeViewColumn34 : Object
1230 public Gtk.TreeViewColumn el;
1231 private ValaProjectSettings _this;
1237 public Xcls_TreeViewColumn34(ValaProjectSettings _owner )
1240 this.el = new Gtk.TreeViewColumn();
1244 // set gobject values
1245 this.el.title = "name";
1246 this.el.resizable = true;
1247 var child_0 = new Xcls_targets_render( _this );
1249 this.el.pack_start ( child_0.el , false );
1254 this.el.add_attribute(_this.targets_render.el , "text", 0 );
1258 // user defined functions
1260 public class Xcls_targets_render : Object
1262 public Gtk.CellRendererText el;
1263 private ValaProjectSettings _this;
1269 public Xcls_targets_render(ValaProjectSettings _owner )
1272 _this.targets_render = this;
1273 this.el = new Gtk.CellRendererText();
1277 // set gobject values
1278 this.el.editable = true;
1281 this.el.edited.connect( (path, newtext) => {
1284 _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1286 _this.targets_tree_store.el.get_value(iter,0, out gval);
1287 var oldval = (string)gval;
1288 if (oldval == newtext) {
1291 var cg = _this.project.compilegroups.get(oldval);
1293 _this.project.compilegroups.unset(oldval);
1294 _this.project.compilegroups.set(newtext, cg);
1295 _this.targets_tree_store.load();
1299 // user defined functions
1305 public class Xcls_set_vbox : Object
1308 private ValaProjectSettings _this;
1312 public Project.GtkValaSettings cgroup;
1315 public Xcls_set_vbox(ValaProjectSettings _owner )
1318 _this.set_vbox = this;
1319 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1324 // set gobject values
1325 this.el.homogeneous = false;
1326 var child_0 = new Xcls_Label37( _this );
1328 this.el.pack_start ( child_0.el , false,false,0 );
1329 var child_1 = new Xcls_build_pack_target( _this );
1331 this.el.pack_start ( child_1.el , false,false,0 );
1332 var child_2 = new Xcls_Label39( _this );
1334 this.el.pack_start ( child_2.el , false,false,0 );
1335 var child_3 = new Xcls_build_compile_flags( _this );
1337 this.el.pack_start ( child_3.el , false,false,0 );
1338 var child_4 = new Xcls_Label41( _this );
1340 this.el.pack_start ( child_4.el , false,false,0 );
1341 var child_5 = new Xcls_ScrolledWindow42( _this );
1343 this.el.pack_start ( child_5.el , true,true,0 );
1346 // user defined functions
1348 public class Xcls_Label37 : Object
1350 public Gtk.Label el;
1351 private ValaProjectSettings _this;
1357 public Xcls_Label37(ValaProjectSettings _owner )
1360 this.el = new Gtk.Label( "target filename" );
1364 // set gobject values
1367 // user defined functions
1370 public class Xcls_build_pack_target : Object
1372 public Gtk.Entry el;
1373 private ValaProjectSettings _this;
1379 public Xcls_build_pack_target(ValaProjectSettings _owner )
1382 _this.build_pack_target = this;
1383 this.el = new Gtk.Entry();
1387 // set gobject values
1390 this.el.changed.connect( () => {
1391 if (_this.targets_tree.cursor.length < 1) {
1394 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1398 // user defined functions
1401 public class Xcls_Label39 : Object
1403 public Gtk.Label el;
1404 private ValaProjectSettings _this;
1410 public Xcls_Label39(ValaProjectSettings _owner )
1413 this.el = new Gtk.Label( "compile flags" );
1417 // set gobject values
1420 // user defined functions
1423 public class Xcls_build_compile_flags : Object
1425 public Gtk.Entry el;
1426 private ValaProjectSettings _this;
1432 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1435 _this.build_compile_flags = this;
1436 this.el = new Gtk.Entry();
1440 // set gobject values
1443 this.el.changed.connect( () => {
1444 if (_this.targets_tree.cursor.length < 1) {
1447 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1451 // user defined functions
1454 public class Xcls_Label41 : Object
1456 public Gtk.Label el;
1457 private ValaProjectSettings _this;
1463 public Xcls_Label41(ValaProjectSettings _owner )
1466 this.el = new Gtk.Label( "Files to compile" );
1470 // set gobject values
1473 // user defined functions
1476 public class Xcls_ScrolledWindow42 : Object
1478 public Gtk.ScrolledWindow el;
1479 private ValaProjectSettings _this;
1485 public Xcls_ScrolledWindow42(ValaProjectSettings _owner )
1488 this.el = new Gtk.ScrolledWindow( null, null );
1492 // set gobject values
1493 var child_0 = new Xcls_files_tree( _this );
1495 this.el.add ( child_0.el );
1498 // user defined functions
1500 public class Xcls_files_tree : Object
1502 public Gtk.TreeView el;
1503 private ValaProjectSettings _this;
1509 public Xcls_files_tree(ValaProjectSettings _owner )
1512 this.el = new Gtk.TreeView();
1516 // set gobject values
1517 var child_0 = new Xcls_files_tree_store( _this );
1519 this.el.set_model ( child_0.el );
1520 var child_1 = new Xcls_TreeViewColumn45( _this );
1522 this.el.append_column ( child_1.el );
1523 var child_2 = new Xcls_TreeViewColumn47( _this );
1525 this.el.append_column ( child_2.el );
1528 // user defined functions
1530 public class Xcls_files_tree_store : Object
1532 public Gtk.ListStore el;
1533 private ValaProjectSettings _this;
1539 public Xcls_files_tree_store(ValaProjectSettings _owner )
1542 _this.files_tree_store = this;
1543 this.el = new Gtk.ListStore( 4, typeof(string), // 0 file name
1544 typeof(string), // 0 basename
1545 typeof(string), // type (dir orfile)
1546 typeof(bool) // is checked.
1551 // set gobject values
1554 // user defined functions
1555 public void updateDir (string dname, bool bval) {
1559 var cg = _this.set_vbox.cgroup;
1560 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1561 this.el.iter_nth_child(out citer,null,i);
1564 this.el.get_value(citer,0, out val);
1565 var fn = (string) val;
1567 if ( Path.get_dirname (fn) == dname) {
1569 this.el.set_value(citer, 3, bval ); // checked
1575 if (cg.sources.contains(fn)) {
1576 cg.sources.remove(fn);
1579 if (!cg.sources.contains(fn)) {
1589 public void load () {
1594 var def = _this.project.compilegroups.get("_default_");
1595 var items = def.sources;
1603 for(var i =0 ; i < items.size; i++) {
1605 var files = _this.project.filesForCompile(items.get(i), false);
1606 if (files.size < 1) {
1610 this.el.append(out citer);
1612 this.el.set_value(citer, 0, items.get(i) ); // title
1613 this.el.set_value(citer, 1, "<span foreground=\"green\" font_weight=\"bold\">" +
1614 GLib.Markup.escape_text(items.get(i)) + "</span>"
1616 print("ADD item %s", items.get(i));
1617 this.el.set_value(citer, 2, "dir"); // type
1618 this.el.set_value(citer, 3, false ); // checked
1622 for(var j =0 ; j < files.size; j++) {
1623 this.el.append(out citer);
1624 print("ADD item %s", files.get(j));
1625 this.el.set_value(citer, 0, files.get(j) ); // title
1626 this.el.set_value(citer, 1, GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title
1627 this.el.set_value(citer, 2, "file"); // type
1628 this.el.set_value(citer, 3, false ); // checked
1633 //this.el.set_value(citer, 1, items.get(i) );
1635 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1638 public void update () {
1643 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1644 this.el.iter_nth_child(out citer,null,i);
1647 this.el.get_value(citer,0, out val);
1648 var fn = (string) val;
1651 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1655 this.el.set_value(citer, 3, active ); // checked
1662 public class Xcls_TreeViewColumn45 : Object
1664 public Gtk.TreeViewColumn el;
1665 private ValaProjectSettings _this;
1671 public Xcls_TreeViewColumn45(ValaProjectSettings _owner )
1674 this.el = new Gtk.TreeViewColumn();
1678 // set gobject values
1679 this.el.title = "name";
1680 this.el.resizable = true;
1681 var child_0 = new Xcls_files_render( _this );
1683 this.el.pack_start ( child_0.el , false );
1687 this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1689 /* this.el.add_attribute(_this.files_render.el , "markup", 2 );
1693 // user defined functions
1695 public class Xcls_files_render : Object
1697 public Gtk.CellRendererText el;
1698 private ValaProjectSettings _this;
1704 public Xcls_files_render(ValaProjectSettings _owner )
1707 _this.files_render = this;
1708 this.el = new Gtk.CellRendererText();
1712 // set gobject values
1715 // user defined functions
1719 public class Xcls_TreeViewColumn47 : Object
1721 public Gtk.TreeViewColumn el;
1722 private ValaProjectSettings _this;
1728 public Xcls_TreeViewColumn47(ValaProjectSettings _owner )
1731 this.el = new Gtk.TreeViewColumn();
1735 // set gobject values
1736 this.el.title = "use";
1737 this.el.resizable = false;
1738 this.el.fixed_width = 50;
1739 var child_0 = new Xcls_files_render_use( _this );
1741 this.el.pack_start ( child_0.el , false );
1746 this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1750 // user defined functions
1752 public class Xcls_files_render_use : Object
1754 public Gtk.CellRendererToggle el;
1755 private ValaProjectSettings _this;
1761 public Xcls_files_render_use(ValaProjectSettings _owner )
1764 _this.files_render_use = this;
1765 this.el = new Gtk.CellRendererToggle();
1769 // set gobject values
1770 this.el.activatable = true;
1773 this.el.toggled.connect( ( path_string) => {
1777 var m = _this.files_tree_store.el;
1779 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1780 m.get_iter (out iter, path);
1782 m.get_value(iter, 3, out val);
1783 m.set_value(iter, 3, ((bool) val) ? false :true);
1787 m.get_value(iter, 2, out ftval);
1788 var ftype = (string)ftval;
1792 m.get_value(iter, 0, out fval);
1793 var fn = (string)fval;
1796 var cg = _this.set_vbox.cgroup;
1797 // what's the sleected target?
1798 // update the list..
1799 // if ftype is a dir == then toggle all the bellow.
1801 if (ftype == "dir") {
1802 _this.files_tree_store.updateDir(fn, ((bool) val) ? false :true);
1805 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1810 cg.sources.remove(fn);
1818 // user defined functions