1 static ValaProjectSettings _ValaProjectSettings;
3 public class ValaProjectSettings : Object
6 private ValaProjectSettings _this;
8 public static ValaProjectSettings singleton()
10 if (_ValaProjectSettings == null) {
11 _ValaProjectSettings= new ValaProjectSettings();
13 return _ValaProjectSettings;
15 public Xcls_label_global label_global;
16 public Xcls_label_targets label_targets;
17 public Xcls_compile_flags compile_flags;
18 public Xcls_default_packages_tree_store default_packages_tree_store;
19 public Xcls_packages_render packages_render;
20 public Xcls_packages_render_use packages_render_use;
21 public Xcls_default_directory_tree default_directory_tree;
22 public Xcls_default_directory_tree_store default_directory_tree_store;
23 public Xcls_directory_render directory_render;
24 public Xcls_default_directory_menu default_directory_menu;
25 public Xcls_targets_tree_menu targets_tree_menu;
26 public Xcls_targets_tree targets_tree;
27 public Xcls_targets_tree_store targets_tree_store;
28 public Xcls_targets_render targets_render;
29 public Xcls_set_vbox set_vbox;
30 public Xcls_build_pack_target build_pack_target;
31 public Xcls_build_compile_flags build_compile_flags;
32 public Xcls_files_tree_store files_tree_store;
33 public Xcls_files_render files_render;
34 public Xcls_files_render_use files_render_use;
37 public Project.Gtk project;
38 public Xcls_MainWindow window;
41 public ValaProjectSettings()
44 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
51 this.el.hexpand = true;
52 var child_0 = new Xcls_Notebook2( _this );
54 this.el.pack_start ( child_0.el , true,true,0 );
57 // user defined functions
58 public void show (Project.Gtk project) {
61 print("ValaProjectSettings show\n");
63 this.project= project;
65 this.compile_flags.el.text = _this.project.compilegroups.get("_default_").compile_flags;
67 this.default_directory_tree_store.load();
68 this.default_packages_tree_store.load();
69 this.targets_tree_store.load();
70 this.files_tree_store.load();
74 this.project.writeConfig();
76 public class Xcls_Notebook2 : Object
78 public Gtk.Notebook el;
79 private ValaProjectSettings _this;
85 public Xcls_Notebook2(ValaProjectSettings _owner )
88 this.el = new Gtk.Notebook();
93 var child_0 = new Xcls_label_global( _this );
95 var child_1 = new Xcls_label_targets( _this );
97 var child_2 = new Xcls_Box5( _this );
99 this.el.append_page ( child_2.el , _this.label_global.el );
100 var child_3 = new Xcls_Paned26( _this );
102 this.el.append_page ( child_3.el , _this.label_targets.el );
105 // user defined functions
107 public class Xcls_label_global : Object
110 private ValaProjectSettings _this;
116 public Xcls_label_global(ValaProjectSettings _owner )
119 _this.label_global = this;
120 this.el = new Gtk.Label( "Global" );
124 // set gobject values
127 // user defined functions
130 public class Xcls_label_targets : Object
133 private ValaProjectSettings _this;
139 public Xcls_label_targets(ValaProjectSettings _owner )
142 _this.label_targets = this;
143 this.el = new Gtk.Label( "Targets" );
147 // set gobject values
150 // user defined functions
153 public class Xcls_Box5 : Object
156 private ValaProjectSettings _this;
162 public Xcls_Box5(ValaProjectSettings _owner )
165 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
169 // set gobject values
170 this.el.homogeneous = false;
171 var child_0 = new Xcls_Label6( _this );
173 this.el.pack_start ( child_0.el , false,false,0 );
174 var child_1 = new Xcls_compile_flags( _this );
176 this.el.pack_start ( child_1.el , false,false,0 );
177 var child_2 = new Xcls_Paned8( _this );
179 this.el.pack_start ( child_2.el , true,true,0 );
182 // user defined functions
184 public class Xcls_Label6 : Object
187 private ValaProjectSettings _this;
193 public Xcls_Label6(ValaProjectSettings _owner )
196 this.el = new Gtk.Label( "compile flags" );
200 // set gobject values
203 // user defined functions
206 public class Xcls_compile_flags : Object
209 private ValaProjectSettings _this;
215 public Xcls_compile_flags(ValaProjectSettings _owner )
218 _this.compile_flags = this;
219 this.el = new Gtk.Entry();
223 // set gobject values
224 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
227 this.el.changed.connect( () => {
229 _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
230 _this.project.writeConfig();
231 // _this.project.save();
236 // user defined functions
239 public class Xcls_Paned8 : Object
242 private ValaProjectSettings _this;
248 public Xcls_Paned8(ValaProjectSettings _owner )
251 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
255 // set gobject values
256 var child_0 = new Xcls_ScrolledWindow9( _this );
258 this.el.add ( child_0.el );
259 var child_1 = new Xcls_ScrolledWindow16( _this );
261 this.el.add2 ( child_1.el );
264 // user defined functions
266 public class Xcls_ScrolledWindow9 : Object
268 public Gtk.ScrolledWindow el;
269 private ValaProjectSettings _this;
275 public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
278 this.el = new Gtk.ScrolledWindow( null, null );
282 // set gobject values
283 this.el.hexpand = true;
284 var child_0 = new Xcls_default_packages_tree( _this );
286 this.el.add ( child_0.el );
289 // user defined functions
291 public class Xcls_default_packages_tree : Object
293 public Gtk.TreeView el;
294 private ValaProjectSettings _this;
300 public Xcls_default_packages_tree(ValaProjectSettings _owner )
303 this.el = new Gtk.TreeView();
307 // set gobject values
308 this.el.headers_visible = true;
309 var child_0 = new Xcls_default_packages_tree_store( _this );
311 this.el.set_model ( child_0.el );
312 var child_1 = new Xcls_TreeViewColumn12( _this );
314 this.el.append_column ( child_1.el );
315 var child_2 = new Xcls_TreeViewColumn14( _this );
317 this.el.append_column ( child_2.el );
320 // user defined functions
322 public class Xcls_default_packages_tree_store : Object
324 public Gtk.ListStore el;
325 private ValaProjectSettings _this;
331 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
334 _this.default_packages_tree_store = this;
335 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
340 // set gobject values
343 // user defined functions
344 public void load () {
346 var def = _this.project.compilegroups.get("_default_");
347 var items = def.packages;
350 var pal = (Palete.Gtk) Palete.factory("Gtk");
351 var pkgs = pal.packages(_this.project);
352 print("ValaProjectSettings:packages load %d\n", pkgs.size);
356 for(var i =0 ; i < pkgs.size; i++) {
357 this.el.append(out citer);
359 this.el.set_value(citer, 0, pkgs.get(i) ); // title
360 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
362 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
367 public class Xcls_TreeViewColumn12 : Object
369 public Gtk.TreeViewColumn el;
370 private ValaProjectSettings _this;
376 public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
379 this.el = new Gtk.TreeViewColumn();
383 // set gobject values
384 this.el.title = "package name";
385 this.el.expand = true;
386 this.el.resizable = true;
387 var child_0 = new Xcls_packages_render( _this );
389 this.el.pack_start ( child_0.el , false );
393 this.el.add_attribute(_this.packages_render.el , "text", 0 );
396 // user defined functions
398 public class Xcls_packages_render : Object
400 public Gtk.CellRendererText el;
401 private ValaProjectSettings _this;
407 public Xcls_packages_render(ValaProjectSettings _owner )
410 _this.packages_render = this;
411 this.el = new Gtk.CellRendererText();
415 // set gobject values
418 // user defined functions
422 public class Xcls_TreeViewColumn14 : Object
424 public Gtk.TreeViewColumn el;
425 private ValaProjectSettings _this;
431 public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
434 this.el = new Gtk.TreeViewColumn();
438 // set gobject values
439 this.el.title = "use";
440 this.el.resizable = false;
441 this.el.fixed_width = 50;
442 var child_0 = new Xcls_packages_render_use( _this );
444 this.el.pack_start ( child_0.el , false );
449 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
453 // user defined functions
455 public class Xcls_packages_render_use : Object
457 public Gtk.CellRendererToggle el;
458 private ValaProjectSettings _this;
464 public Xcls_packages_render_use(ValaProjectSettings _owner )
467 _this.packages_render_use = this;
468 this.el = new Gtk.CellRendererToggle();
472 // set gobject values
473 this.el.activatable = true;
476 this.el.toggled.connect( ( path_string) => {
477 var m = _this.default_packages_tree_store.el;
479 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
480 m.get_iter (out iter, path);
482 m.get_value(iter, 1, out val);
483 m.set_value(iter, 1, ((bool) val) ? false :true);
485 m.get_value(iter, 0, out fval);
486 var fn = (string)fval;
488 var def = _this.project.compilegroups.get("_default_");
489 var items = def.packages;
500 // user defined functions
506 public class Xcls_ScrolledWindow16 : Object
508 public Gtk.ScrolledWindow el;
509 private ValaProjectSettings _this;
515 public Xcls_ScrolledWindow16(ValaProjectSettings _owner )
518 this.el = new Gtk.ScrolledWindow( null, null );
522 // set gobject values
523 this.el.hexpand = true;
524 var child_0 = new Xcls_default_directory_tree( _this );
526 this.el.add ( child_0.el );
527 var child_1 = new Xcls_default_directory_menu( _this );
531 // user defined functions
533 public class Xcls_default_directory_tree : Object
535 public Gtk.TreeView el;
536 private ValaProjectSettings _this;
542 public Xcls_default_directory_tree(ValaProjectSettings _owner )
545 _this.default_directory_tree = this;
546 this.el = new Gtk.TreeView();
550 // set gobject values
551 this.el.headers_visible = true;
552 var child_0 = new Xcls_default_directory_tree_store( _this );
554 this.el.set_model ( child_0.el );
555 var child_1 = new Xcls_TreeViewColumn19( _this );
557 this.el.append_column ( child_1.el );
560 this.el.button_press_event.connect( ( ev) => {
561 //console.log("button press?");
564 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
565 //print("click" + ev.type);
569 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
573 // this.el.get_selection().select_path(res);
575 //if (!this.get('/LeftTreeMenu').el) {
576 // this.get('/LeftTreeMenu').init();
579 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
580 _this.default_directory_menu.el.show_all();
581 _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);
582 // print("click:" + res.path.to_string());
587 // user defined functions
589 public class Xcls_default_directory_tree_store : Object
591 public Gtk.ListStore el;
592 private ValaProjectSettings _this;
598 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
601 _this.default_directory_tree_store = this;
602 this.el = new Gtk.ListStore( 1, typeof(string)
607 // set gobject values
610 // user defined functions
611 public void load () {
616 var def = _this.project.compilegroups.get("_default_");
617 var items = def.sources;
622 for(var i =0 ; i < items.size; i++) {
623 this.el.append(out citer);
625 this.el.set_value(citer, 0, items.get(i) ); // title
626 //this.el.set_value(citer, 1, items.get(i) );
628 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
633 public class Xcls_TreeViewColumn19 : Object
635 public Gtk.TreeViewColumn el;
636 private ValaProjectSettings _this;
642 public Xcls_TreeViewColumn19(ValaProjectSettings _owner )
645 this.el = new Gtk.TreeViewColumn();
649 // set gobject values
650 this.el.title = "Available Directories (right click to add)";
651 this.el.resizable = true;
652 var child_0 = new Xcls_directory_render( _this );
654 this.el.pack_start ( child_0.el , false );
658 this.el.add_attribute(_this.directory_render.el , "text", 0 );
661 // user defined functions
663 public class Xcls_directory_render : Object
665 public Gtk.CellRendererText el;
666 private ValaProjectSettings _this;
672 public Xcls_directory_render(ValaProjectSettings _owner )
675 _this.directory_render = this;
676 this.el = new Gtk.CellRendererText();
680 // set gobject values
683 // user defined functions
688 public class Xcls_default_directory_menu : Object
691 private ValaProjectSettings _this;
697 public Xcls_default_directory_menu(ValaProjectSettings _owner )
700 _this.default_directory_menu = this;
701 this.el = new Gtk.Menu();
705 // set gobject values
706 var child_0 = new Xcls_MenuItem22( _this );
708 this.el.add ( child_0.el );
709 var child_1 = new Xcls_MenuItem23( _this );
711 this.el.add ( child_1.el );
712 var child_2 = new Xcls_SeparatorMenuItem24( _this );
714 this.el.add ( child_2.el );
715 var child_3 = new Xcls_MenuItem25( _this );
717 this.el.add ( child_3.el );
720 // user defined functions
722 public class Xcls_MenuItem22 : Object
724 public Gtk.MenuItem el;
725 private ValaProjectSettings _this;
731 public Xcls_MenuItem22(ValaProjectSettings _owner )
734 this.el = new Gtk.MenuItem();
738 // set gobject values
739 this.el.label = "Add Directory";
742 this.el.activate.connect( () => {
744 var chooser = new Gtk.FileChooserDialog (
745 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
747 Gtk.ResponseType.CANCEL,
749 Gtk.ResponseType.ACCEPT);
750 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
755 // add the directory..
756 var fn = _this.project.relPath(chooser.get_filename());
757 _this.project.compilegroups.get("_default_").sources.add(fn);
758 _this.default_directory_tree_store.load();
762 // user defined functions
765 public class Xcls_MenuItem23 : Object
767 public Gtk.MenuItem el;
768 private ValaProjectSettings _this;
774 public Xcls_MenuItem23(ValaProjectSettings _owner )
777 this.el = new Gtk.MenuItem();
781 // set gobject values
782 this.el.label = "Add File";
785 this.el.activate.connect( () => {
787 var chooser = new Gtk.FileChooserDialog (
788 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
790 Gtk.ResponseType.CANCEL,
792 Gtk.ResponseType.ACCEPT);
793 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
798 // add the directory..
799 var fn = _this.project.relPath(chooser.get_filename());
800 _this.project.compilegroups.get("_default_").sources.add(fn);
801 _this.default_directory_tree_store.load();
805 // user defined functions
808 public class Xcls_SeparatorMenuItem24 : Object
810 public Gtk.SeparatorMenuItem el;
811 private ValaProjectSettings _this;
817 public Xcls_SeparatorMenuItem24(ValaProjectSettings _owner )
820 this.el = new Gtk.SeparatorMenuItem();
824 // set gobject values
827 // user defined functions
830 public class Xcls_MenuItem25 : Object
832 public Gtk.MenuItem el;
833 private ValaProjectSettings _this;
839 public Xcls_MenuItem25(ValaProjectSettings _owner )
842 this.el = new Gtk.MenuItem();
846 // set gobject values
847 this.el.label = "Remove File/Directory";
850 this.el.activate.connect( () => {
855 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
856 print("nothing selected\n");
861 // add the directory..
865 mod.get_value(iter,0, out val);
866 var fn = (string) val;
868 print("remove: %s\n", fn);
869 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
870 print("remove failed");
872 _this.default_directory_tree_store.load();
876 // user defined functions
883 public class Xcls_Paned26 : Object
886 private ValaProjectSettings _this;
892 public Xcls_Paned26(ValaProjectSettings _owner )
895 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
899 // set gobject values
900 this.el.position = 300;
901 var child_0 = new Xcls_ScrolledWindow27( _this );
903 this.el.add1 ( child_0.el );
904 var child_1 = new Xcls_set_vbox( _this );
906 this.el.add2 ( child_1.el );
909 // user defined functions
911 public class Xcls_ScrolledWindow27 : Object
913 public Gtk.ScrolledWindow el;
914 private ValaProjectSettings _this;
920 public Xcls_ScrolledWindow27(ValaProjectSettings _owner )
923 this.el = new Gtk.ScrolledWindow( null, null );
927 // set gobject values
928 var child_0 = new Xcls_targets_tree_menu( _this );
930 this.el.add ( child_0.el );
931 var child_1 = new Xcls_targets_tree( _this );
933 this.el.add ( child_1.el );
938 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
943 // user defined functions
945 public class Xcls_targets_tree_menu : Object
948 private ValaProjectSettings _this;
954 public Xcls_targets_tree_menu(ValaProjectSettings _owner )
957 _this.targets_tree_menu = this;
958 this.el = new Gtk.Menu();
962 // set gobject values
963 var child_0 = new Xcls_MenuItem29( _this );
965 this.el.add ( child_0.el );
966 var child_1 = new Xcls_SeparatorMenuItem30( _this );
968 this.el.add ( child_1.el );
969 var child_2 = new Xcls_MenuItem31( _this );
971 this.el.add ( child_2.el );
974 // user defined functions
976 public class Xcls_MenuItem29 : Object
978 public Gtk.MenuItem el;
979 private ValaProjectSettings _this;
985 public Xcls_MenuItem29(ValaProjectSettings _owner )
988 this.el = new Gtk.MenuItem();
992 // set gobject values
993 this.el.label = "Add Compile Target";
996 this.el.activate.connect( () => {
998 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1002 // add the directory..
1004 _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
1005 _this.targets_tree_store.load();
1009 // user defined functions
1012 public class Xcls_SeparatorMenuItem30 : Object
1014 public Gtk.SeparatorMenuItem el;
1015 private ValaProjectSettings _this;
1021 public Xcls_SeparatorMenuItem30(ValaProjectSettings _owner )
1024 this.el = new Gtk.SeparatorMenuItem();
1028 // set gobject values
1031 // user defined functions
1034 public class Xcls_MenuItem31 : Object
1036 public Gtk.MenuItem el;
1037 private ValaProjectSettings _this;
1043 public Xcls_MenuItem31(ValaProjectSettings _owner )
1046 this.el = new Gtk.MenuItem();
1050 // set gobject values
1051 this.el.label = "Remove Target";
1054 this.el.activate.connect( () => {
1059 if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1060 print("nothing selected\n");
1065 // add the directory..
1069 mod.get_value(iter,0, out val);
1070 var fn = (string) val;
1072 print("remove: %s\n", fn);
1073 if (!_this.project.compilegroups.unset(fn)) {
1074 print("remove failed");
1076 _this.targets_tree_store.load();
1080 // user defined functions
1084 public class Xcls_targets_tree : Object
1086 public Gtk.TreeView el;
1087 private ValaProjectSettings _this;
1091 public string cursor;
1094 public Xcls_targets_tree(ValaProjectSettings _owner )
1097 _this.targets_tree = this;
1098 this.el = new Gtk.TreeView();
1102 // set gobject values
1103 var child_0 = new Xcls_targets_tree_store( _this );
1105 this.el.set_model ( child_0.el );
1106 var child_1 = new Xcls_TreeViewColumn34( _this );
1108 this.el.append_column ( child_1.el );
1111 this.el.button_press_event.connect( ( ev) => {
1112 //console.log("button press?");
1115 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
1116 //print("click" + ev.type);
1120 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1124 // this.el.get_selection().select_path(res);
1126 //if (!this.get('/LeftTreeMenu').el) {
1127 // this.get('/LeftTreeMenu').init();
1130 _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1131 _this.targets_tree_menu.el.show_all();
1132 _this.targets_tree_menu.el.popup(null, null, null, 3, ev.time);
1133 // print("click:" + res.path.to_string());
1136 this.el.cursor_changed.connect( ( ) => {
1138 if (this.cursor != "") {
1139 // save the values..
1142 // load the new values.
1147 if (!this.el.get_selection().get_selected(out mod, out iter)) {
1148 print("nothing selected\n");
1149 // should disable the right hand side..
1150 _this.set_vbox.el.hide();
1153 _this.set_vbox.el.show();
1155 // add the directory..
1159 mod.get_value(iter,0, out val);
1160 var fn = (string) val;
1163 var cg = _this.project.compilegroups.get(fn);
1165 _this.build_pack_target.el.set_text(cg.target_bin);
1166 _this.build_compile_flags.el.set_text(cg.compile_flags);
1167 _this.set_vbox.cgroup = cg;
1168 _this.files_tree_store.update();
1176 // user defined functions
1178 public class Xcls_targets_tree_store : Object
1180 public Gtk.ListStore el;
1181 private ValaProjectSettings _this;
1187 public Xcls_targets_tree_store(ValaProjectSettings _owner )
1190 _this.targets_tree_store = this;
1191 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1192 typeof(string) // ??
1197 // set gobject values
1200 // user defined functions
1201 public void load () {
1206 var cg = _this.project.compilegroups;
1208 _this.targets_tree.cursor = "";
1210 var iter = cg.map_iterator();
1211 while(iter.next()) {
1212 var key = iter.get_key();
1213 if (key == "_default_") {
1217 this.el.append(out citer);
1219 this.el.set_value(citer, 0, key ); // title
1220 //this.el.set_value(citer, 1, items.get(i) );
1222 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1223 _this.set_vbox.el.hide();
1227 public class Xcls_TreeViewColumn34 : Object
1229 public Gtk.TreeViewColumn el;
1230 private ValaProjectSettings _this;
1236 public Xcls_TreeViewColumn34(ValaProjectSettings _owner )
1239 this.el = new Gtk.TreeViewColumn();
1243 // set gobject values
1244 this.el.title = "name";
1245 this.el.resizable = true;
1246 var child_0 = new Xcls_targets_render( _this );
1248 this.el.pack_start ( child_0.el , false );
1253 this.el.add_attribute(_this.targets_render.el , "text", 0 );
1257 // user defined functions
1259 public class Xcls_targets_render : Object
1261 public Gtk.CellRendererText el;
1262 private ValaProjectSettings _this;
1268 public Xcls_targets_render(ValaProjectSettings _owner )
1271 _this.targets_render = this;
1272 this.el = new Gtk.CellRendererText();
1276 // set gobject values
1277 this.el.editable = true;
1280 this.el.edited.connect( (path, newtext) => {
1283 _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1285 _this.targets_tree_store.el.get_value(iter,0, out gval);
1286 var oldval = (string)gval;
1287 if (oldval == newtext) {
1290 var cg = _this.project.compilegroups.get(oldval);
1292 _this.project.compilegroups.unset(oldval);
1293 _this.project.compilegroups.set(newtext, cg);
1294 _this.targets_tree_store.load();
1298 // user defined functions
1304 public class Xcls_set_vbox : Object
1307 private ValaProjectSettings _this;
1311 public Project.GtkValaSettings cgroup;
1314 public Xcls_set_vbox(ValaProjectSettings _owner )
1317 _this.set_vbox = this;
1318 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1323 // set gobject values
1324 this.el.homogeneous = false;
1325 var child_0 = new Xcls_Label37( _this );
1327 this.el.pack_start ( child_0.el , false,false,0 );
1328 var child_1 = new Xcls_build_pack_target( _this );
1330 this.el.pack_start ( child_1.el , false,false,0 );
1331 var child_2 = new Xcls_Label39( _this );
1333 this.el.pack_start ( child_2.el , false,false,0 );
1334 var child_3 = new Xcls_build_compile_flags( _this );
1336 this.el.pack_start ( child_3.el , false,false,0 );
1337 var child_4 = new Xcls_Label41( _this );
1339 this.el.pack_start ( child_4.el , false,false,0 );
1340 var child_5 = new Xcls_ScrolledWindow42( _this );
1342 this.el.pack_start ( child_5.el , true,true,0 );
1345 // user defined functions
1347 public class Xcls_Label37 : Object
1349 public Gtk.Label el;
1350 private ValaProjectSettings _this;
1356 public Xcls_Label37(ValaProjectSettings _owner )
1359 this.el = new Gtk.Label( "target filename" );
1363 // set gobject values
1366 // user defined functions
1369 public class Xcls_build_pack_target : Object
1371 public Gtk.Entry el;
1372 private ValaProjectSettings _this;
1378 public Xcls_build_pack_target(ValaProjectSettings _owner )
1381 _this.build_pack_target = this;
1382 this.el = new Gtk.Entry();
1386 // set gobject values
1389 this.el.changed.connect( () => {
1390 if (_this.targets_tree.cursor.length < 1) {
1393 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1397 // user defined functions
1400 public class Xcls_Label39 : Object
1402 public Gtk.Label el;
1403 private ValaProjectSettings _this;
1409 public Xcls_Label39(ValaProjectSettings _owner )
1412 this.el = new Gtk.Label( "compile flags" );
1416 // set gobject values
1419 // user defined functions
1422 public class Xcls_build_compile_flags : Object
1424 public Gtk.Entry el;
1425 private ValaProjectSettings _this;
1431 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1434 _this.build_compile_flags = this;
1435 this.el = new Gtk.Entry();
1439 // set gobject values
1442 this.el.changed.connect( () => {
1443 if (_this.targets_tree.cursor.length < 1) {
1446 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1450 // user defined functions
1453 public class Xcls_Label41 : Object
1455 public Gtk.Label el;
1456 private ValaProjectSettings _this;
1462 public Xcls_Label41(ValaProjectSettings _owner )
1465 this.el = new Gtk.Label( "Files to compile" );
1469 // set gobject values
1472 // user defined functions
1475 public class Xcls_ScrolledWindow42 : Object
1477 public Gtk.ScrolledWindow el;
1478 private ValaProjectSettings _this;
1484 public Xcls_ScrolledWindow42(ValaProjectSettings _owner )
1487 this.el = new Gtk.ScrolledWindow( null, null );
1491 // set gobject values
1492 var child_0 = new Xcls_files_tree( _this );
1494 this.el.add ( child_0.el );
1497 // user defined functions
1499 public class Xcls_files_tree : Object
1501 public Gtk.TreeView el;
1502 private ValaProjectSettings _this;
1508 public Xcls_files_tree(ValaProjectSettings _owner )
1511 this.el = new Gtk.TreeView();
1515 // set gobject values
1516 var child_0 = new Xcls_files_tree_store( _this );
1518 this.el.set_model ( child_0.el );
1519 var child_1 = new Xcls_TreeViewColumn45( _this );
1521 this.el.append_column ( child_1.el );
1522 var child_2 = new Xcls_TreeViewColumn47( _this );
1524 this.el.append_column ( child_2.el );
1527 // user defined functions
1529 public class Xcls_files_tree_store : Object
1531 public Gtk.ListStore el;
1532 private ValaProjectSettings _this;
1538 public Xcls_files_tree_store(ValaProjectSettings _owner )
1541 _this.files_tree_store = this;
1542 this.el = new Gtk.ListStore( 4, typeof(string), // 0 file name
1543 typeof(string), // 0 basename
1544 typeof(string), // type (dir orfile)
1545 typeof(bool) // is checked.
1550 // set gobject values
1553 // user defined functions
1554 public void updateDir (string dname, bool bval) {
1558 var cg = _this.set_vbox.cgroup;
1559 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1560 this.el.iter_nth_child(out citer,null,i);
1563 this.el.get_value(citer,0, out val);
1564 var fn = (string) val;
1566 if ( Path.get_dirname (fn) == dname) {
1568 this.el.set_value(citer, 3, bval ); // checked
1574 if (cg.sources.contains(fn)) {
1575 cg.sources.remove(fn);
1578 if (!cg.sources.contains(fn)) {
1588 public void load () {
1593 var def = _this.project.compilegroups.get("_default_");
1594 var items = def.sources;
1602 for(var i =0 ; i < items.size; i++) {
1604 var files = _this.project.filesForCompile(items.get(i), false);
1605 if (files.size < 1) {
1609 this.el.append(out citer);
1611 this.el.set_value(citer, 0, items.get(i) ); // title
1612 this.el.set_value(citer, 1, "<span foreground=\"green\" font_weight=\"bold\">" +
1613 GLib.Markup.escape_text(items.get(i)) + "</span>"
1615 print("ADD item %s", items.get(i));
1616 this.el.set_value(citer, 2, "dir"); // type
1617 this.el.set_value(citer, 3, false ); // checked
1621 for(var j =0 ; j < files.size; j++) {
1622 this.el.append(out citer);
1623 print("ADD item %s", files.get(j));
1624 this.el.set_value(citer, 0, files.get(j) ); // title
1625 this.el.set_value(citer, 1, GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title
1626 this.el.set_value(citer, 2, "file"); // type
1627 this.el.set_value(citer, 3, false ); // checked
1632 //this.el.set_value(citer, 1, items.get(i) );
1634 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1637 public void update () {
1642 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1643 this.el.iter_nth_child(out citer,null,i);
1646 this.el.get_value(citer,0, out val);
1647 var fn = (string) val;
1650 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1654 this.el.set_value(citer, 3, active ); // checked
1661 public class Xcls_TreeViewColumn45 : Object
1663 public Gtk.TreeViewColumn el;
1664 private ValaProjectSettings _this;
1670 public Xcls_TreeViewColumn45(ValaProjectSettings _owner )
1673 this.el = new Gtk.TreeViewColumn();
1677 // set gobject values
1678 this.el.title = "name";
1679 this.el.resizable = true;
1680 var child_0 = new Xcls_files_render( _this );
1682 this.el.pack_start ( child_0.el , false );
1686 this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1688 /* this.el.add_attribute(_this.files_render.el , "markup", 2 );
1692 // user defined functions
1694 public class Xcls_files_render : Object
1696 public Gtk.CellRendererText el;
1697 private ValaProjectSettings _this;
1703 public Xcls_files_render(ValaProjectSettings _owner )
1706 _this.files_render = this;
1707 this.el = new Gtk.CellRendererText();
1711 // set gobject values
1714 // user defined functions
1718 public class Xcls_TreeViewColumn47 : Object
1720 public Gtk.TreeViewColumn el;
1721 private ValaProjectSettings _this;
1727 public Xcls_TreeViewColumn47(ValaProjectSettings _owner )
1730 this.el = new Gtk.TreeViewColumn();
1734 // set gobject values
1735 this.el.title = "use";
1736 this.el.resizable = false;
1737 this.el.fixed_width = 50;
1738 var child_0 = new Xcls_files_render_use( _this );
1740 this.el.pack_start ( child_0.el , false );
1745 this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1749 // user defined functions
1751 public class Xcls_files_render_use : Object
1753 public Gtk.CellRendererToggle el;
1754 private ValaProjectSettings _this;
1760 public Xcls_files_render_use(ValaProjectSettings _owner )
1763 _this.files_render_use = this;
1764 this.el = new Gtk.CellRendererToggle();
1768 // set gobject values
1769 this.el.activatable = true;
1772 this.el.toggled.connect( ( path_string) => {
1776 var m = _this.files_tree_store.el;
1778 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1779 m.get_iter (out iter, path);
1781 m.get_value(iter, 3, out val);
1782 m.set_value(iter, 3, ((bool) val) ? false :true);
1786 m.get_value(iter, 2, out ftval);
1787 var ftype = (string)ftval;
1791 m.get_value(iter, 0, out fval);
1792 var fn = (string)fval;
1795 var cg = _this.set_vbox.cgroup;
1796 // what's the sleected target?
1797 // update the list..
1798 // if ftype is a dir == then toggle all the bellow.
1800 if (ftype == "dir") {
1801 _this.files_tree_store.updateDir(fn, ((bool) val) ? false :true);
1804 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1809 cg.sources.remove(fn);
1817 // user defined functions