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_HPaned28( _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_Label8( _this );
175 this.el.pack_start ( child_2.el , false,false,0 );
176 var child_3 = new Xcls_HBox9( _this );
178 this.el.pack_start ( child_3.el , true,true,0 );
179 var child_4 = new Xcls_ScrolledWindow10( _this );
181 this.el.pack_start ( child_4.el , true,true,0 );
182 var child_5 = new Xcls_Label17( _this );
184 this.el.pack_start ( child_5.el , false,false,0 );
185 var child_6 = new Xcls_ScrolledWindow18( _this );
187 this.el.pack_start ( child_6.el , true,true,0 );
190 // user defined functions
192 public class Xcls_Label6 : Object
195 private ValaProjectSettings _this;
201 public Xcls_Label6(ValaProjectSettings _owner )
204 this.el = new Gtk.Label( "compile flags" );
208 // set gobject values
211 // user defined functions
213 public class Xcls_compile_flags : Object
216 private ValaProjectSettings _this;
222 public Xcls_compile_flags(ValaProjectSettings _owner )
225 _this.compile_flags = this;
226 this.el = new Gtk.Entry();
230 // set gobject values
231 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
234 this.el.changed.connect( () => {
236 _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
237 _this.project.writeConfig();
238 // _this.project.save();
243 // user defined functions
245 public class Xcls_Label8 : Object
248 private ValaProjectSettings _this;
254 public Xcls_Label8(ValaProjectSettings _owner )
257 this.el = new Gtk.Label( "packages" );
261 // set gobject values
264 // user defined functions
266 public class Xcls_HBox9 : Object
269 private ValaProjectSettings _this;
275 public Xcls_HBox9(ValaProjectSettings _owner )
278 this.el = new Gtk.HBox( true, 0 );
282 // set gobject values
285 // user defined functions
287 public class Xcls_ScrolledWindow10 : Object
289 public Gtk.ScrolledWindow el;
290 private ValaProjectSettings _this;
296 public Xcls_ScrolledWindow10(ValaProjectSettings _owner )
299 this.el = new Gtk.ScrolledWindow( null, null );
303 // set gobject values
304 var child_0 = new Xcls_default_packages_tree( _this );
306 this.el.add ( child_0.el );
309 // user defined functions
311 public class Xcls_default_packages_tree : Object
313 public Gtk.TreeView el;
314 private ValaProjectSettings _this;
320 public Xcls_default_packages_tree(ValaProjectSettings _owner )
323 this.el = new Gtk.TreeView();
327 // set gobject values
328 this.el.headers_visible = false;
329 var child_0 = new Xcls_default_packages_tree_store( _this );
331 this.el.set_model ( child_0.el );
332 var child_1 = new Xcls_TreeViewColumn13( _this );
334 this.el.append_column ( child_1.el );
335 var child_2 = new Xcls_TreeViewColumn15( _this );
337 this.el.append_column ( child_2.el );
340 // user defined functions
342 public class Xcls_default_packages_tree_store : Object
344 public Gtk.ListStore el;
345 private ValaProjectSettings _this;
351 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
354 _this.default_packages_tree_store = this;
355 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
360 // set gobject values
363 // user defined functions
364 public void load () {
366 var def = _this.project.compilegroups.get("_default_");
367 var items = def.packages;
370 var pal = (Palete.Gtk) Palete.factory("Gtk");
371 var pkgs = pal.packages(_this.project);
372 print("ValaProjectSettings:packages load %d\n", pkgs.size);
376 for(var i =0 ; i < pkgs.size; i++) {
377 this.el.append(out citer);
379 this.el.set_value(citer, 0, pkgs.get(i) ); // title
380 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
382 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
386 public class Xcls_TreeViewColumn13 : Object
388 public Gtk.TreeViewColumn el;
389 private ValaProjectSettings _this;
395 public Xcls_TreeViewColumn13(ValaProjectSettings _owner )
398 this.el = new Gtk.TreeViewColumn();
402 // set gobject values
403 this.el.title = "name";
404 this.el.expand = true;
405 this.el.resizable = true;
406 var child_0 = new Xcls_packages_render( _this );
408 this.el.pack_start ( child_0.el , false );
412 this.el.add_attribute(_this.packages_render.el , "text", 0 );
415 // user defined functions
417 public class Xcls_packages_render : Object
419 public Gtk.CellRendererText el;
420 private ValaProjectSettings _this;
426 public Xcls_packages_render(ValaProjectSettings _owner )
429 _this.packages_render = this;
430 this.el = new Gtk.CellRendererText();
434 // set gobject values
437 // user defined functions
439 public class Xcls_TreeViewColumn15 : Object
441 public Gtk.TreeViewColumn el;
442 private ValaProjectSettings _this;
448 public Xcls_TreeViewColumn15(ValaProjectSettings _owner )
451 this.el = new Gtk.TreeViewColumn();
455 // set gobject values
456 this.el.title = "use";
457 this.el.resizable = false;
458 this.el.fixed_width = 50;
459 var child_0 = new Xcls_packages_render_use( _this );
461 this.el.pack_start ( child_0.el , false );
466 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
470 // user defined functions
472 public class Xcls_packages_render_use : Object
474 public Gtk.CellRendererToggle el;
475 private ValaProjectSettings _this;
481 public Xcls_packages_render_use(ValaProjectSettings _owner )
484 _this.packages_render_use = this;
485 this.el = new Gtk.CellRendererToggle();
489 // set gobject values
490 this.el.activatable = true;
493 this.el.toggled.connect( ( path_string) => {
494 var m = _this.default_packages_tree_store.el;
496 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
497 m.get_iter (out iter, path);
499 m.get_value(iter, 1, out val);
500 m.set_value(iter, 1, ((bool) val) ? false :true);
502 m.get_value(iter, 0, out fval);
503 var fn = (string)fval;
505 var def = _this.project.compilegroups.get("_default_");
506 var items = def.packages;
517 // user defined functions
519 public class Xcls_Label17 : Object
522 private ValaProjectSettings _this;
528 public Xcls_Label17(ValaProjectSettings _owner )
531 this.el = new Gtk.Label( "Available Directories" );
535 // set gobject values
538 // user defined functions
540 public class Xcls_ScrolledWindow18 : Object
542 public Gtk.ScrolledWindow el;
543 private ValaProjectSettings _this;
549 public Xcls_ScrolledWindow18(ValaProjectSettings _owner )
552 this.el = new Gtk.ScrolledWindow( null, null );
556 // set gobject values
557 var child_0 = new Xcls_default_directory_tree( _this );
559 this.el.add ( child_0.el );
560 var child_1 = new Xcls_default_directory_menu( _this );
564 // user defined functions
566 public class Xcls_default_directory_tree : Object
568 public Gtk.TreeView el;
569 private ValaProjectSettings _this;
575 public Xcls_default_directory_tree(ValaProjectSettings _owner )
578 _this.default_directory_tree = this;
579 this.el = new Gtk.TreeView();
583 // set gobject values
584 this.el.headers_visible = false;
585 var child_0 = new Xcls_default_directory_tree_store( _this );
587 this.el.set_model ( child_0.el );
588 var child_1 = new Xcls_TreeViewColumn21( _this );
590 this.el.append_column ( child_1.el );
593 this.el.button_press_event.connect( ( ev) => {
594 //console.log("button press?");
597 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
598 //print("click" + ev.type);
602 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
606 // this.el.get_selection().select_path(res);
608 //if (!this.get('/LeftTreeMenu').el) {
609 // this.get('/LeftTreeMenu').init();
612 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
613 _this.default_directory_menu.el.show_all();
614 _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);
615 // print("click:" + res.path.to_string());
620 // user defined functions
622 public class Xcls_default_directory_tree_store : Object
624 public Gtk.ListStore el;
625 private ValaProjectSettings _this;
631 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
634 _this.default_directory_tree_store = this;
635 this.el = new Gtk.ListStore( 1, typeof(string)
640 // set gobject values
643 // user defined functions
644 public void load () {
649 var def = _this.project.compilegroups.get("_default_");
650 var items = def.sources;
655 for(var i =0 ; i < items.size; i++) {
656 this.el.append(out citer);
658 this.el.set_value(citer, 0, items.get(i) ); // title
659 //this.el.set_value(citer, 1, items.get(i) );
661 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
665 public class Xcls_TreeViewColumn21 : Object
667 public Gtk.TreeViewColumn el;
668 private ValaProjectSettings _this;
674 public Xcls_TreeViewColumn21(ValaProjectSettings _owner )
677 this.el = new Gtk.TreeViewColumn();
681 // set gobject values
682 this.el.title = "name";
683 this.el.resizable = true;
684 var child_0 = new Xcls_directory_render( _this );
686 this.el.pack_start ( child_0.el , false );
690 this.el.add_attribute(_this.directory_render.el , "text", 0 );
693 // user defined functions
695 public class Xcls_directory_render : Object
697 public Gtk.CellRendererText el;
698 private ValaProjectSettings _this;
704 public Xcls_directory_render(ValaProjectSettings _owner )
707 _this.directory_render = this;
708 this.el = new Gtk.CellRendererText();
712 // set gobject values
715 // user defined functions
717 public class Xcls_default_directory_menu : Object
720 private ValaProjectSettings _this;
726 public Xcls_default_directory_menu(ValaProjectSettings _owner )
729 _this.default_directory_menu = this;
730 this.el = new Gtk.Menu();
734 // set gobject values
735 var child_0 = new Xcls_MenuItem24( _this );
737 this.el.add ( child_0.el );
738 var child_1 = new Xcls_MenuItem25( _this );
740 this.el.add ( child_1.el );
741 var child_2 = new Xcls_SeparatorMenuItem26( _this );
743 this.el.add ( child_2.el );
744 var child_3 = new Xcls_MenuItem27( _this );
746 this.el.add ( child_3.el );
749 // user defined functions
751 public class Xcls_MenuItem24 : Object
753 public Gtk.MenuItem el;
754 private ValaProjectSettings _this;
760 public Xcls_MenuItem24(ValaProjectSettings _owner )
763 this.el = new Gtk.MenuItem();
767 // set gobject values
768 this.el.label = "Add Directory";
771 this.el.activate.connect( () => {
773 var chooser = new Gtk.FileChooserDialog (
774 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
776 Gtk.ResponseType.CANCEL,
778 Gtk.ResponseType.ACCEPT);
779 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
784 // add the directory..
785 var fn = _this.project.relPath(chooser.get_filename());
786 _this.project.compilegroups.get("_default_").sources.add(fn);
787 _this.default_directory_tree_store.load();
791 // user defined functions
793 public class Xcls_MenuItem25 : Object
795 public Gtk.MenuItem el;
796 private ValaProjectSettings _this;
802 public Xcls_MenuItem25(ValaProjectSettings _owner )
805 this.el = new Gtk.MenuItem();
809 // set gobject values
810 this.el.label = "Add File";
813 this.el.activate.connect( () => {
815 var chooser = new Gtk.FileChooserDialog (
816 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
818 Gtk.ResponseType.CANCEL,
820 Gtk.ResponseType.ACCEPT);
821 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
826 // add the directory..
827 var fn = _this.project.relPath(chooser.get_filename());
828 _this.project.compilegroups.get("_default_").sources.add(fn);
829 _this.default_directory_tree_store.load();
833 // user defined functions
835 public class Xcls_SeparatorMenuItem26 : Object
837 public Gtk.SeparatorMenuItem el;
838 private ValaProjectSettings _this;
844 public Xcls_SeparatorMenuItem26(ValaProjectSettings _owner )
847 this.el = new Gtk.SeparatorMenuItem();
851 // set gobject values
854 // user defined functions
856 public class Xcls_MenuItem27 : Object
858 public Gtk.MenuItem el;
859 private ValaProjectSettings _this;
865 public Xcls_MenuItem27(ValaProjectSettings _owner )
868 this.el = new Gtk.MenuItem();
872 // set gobject values
873 this.el.label = "Remove File/Directory";
876 this.el.activate.connect( () => {
881 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
882 print("nothing selected\n");
887 // add the directory..
891 mod.get_value(iter,0, out val);
892 var fn = (string) val;
894 print("remove: %s\n", fn);
895 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
896 print("remove failed");
898 _this.default_directory_tree_store.load();
902 // user defined functions
904 public class Xcls_HPaned28 : Object
906 public Gtk.HPaned el;
907 private ValaProjectSettings _this;
913 public Xcls_HPaned28(ValaProjectSettings _owner )
916 this.el = new Gtk.HPaned();
920 // set gobject values
921 this.el.position = 300;
922 var child_0 = new Xcls_ScrolledWindow29( _this );
924 this.el.add1 ( child_0.el );
925 var child_1 = new Xcls_set_vbox( _this );
927 this.el.add2 ( child_1.el );
930 // user defined functions
932 public class Xcls_ScrolledWindow29 : Object
934 public Gtk.ScrolledWindow el;
935 private ValaProjectSettings _this;
941 public Xcls_ScrolledWindow29(ValaProjectSettings _owner )
944 this.el = new Gtk.ScrolledWindow( null, null );
948 // set gobject values
949 var child_0 = new Xcls_targets_tree_menu( _this );
951 this.el.add ( child_0.el );
952 var child_1 = new Xcls_targets_tree( _this );
954 this.el.add ( child_1.el );
959 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
964 // user defined functions
966 public class Xcls_targets_tree_menu : Object
969 private ValaProjectSettings _this;
975 public Xcls_targets_tree_menu(ValaProjectSettings _owner )
978 _this.targets_tree_menu = this;
979 this.el = new Gtk.Menu();
983 // set gobject values
984 var child_0 = new Xcls_MenuItem31( _this );
986 this.el.add ( child_0.el );
987 var child_1 = new Xcls_SeparatorMenuItem32( _this );
989 this.el.add ( child_1.el );
990 var child_2 = new Xcls_MenuItem33( _this );
992 this.el.add ( child_2.el );
995 // user defined functions
997 public class Xcls_MenuItem31 : Object
999 public Gtk.MenuItem el;
1000 private ValaProjectSettings _this;
1006 public Xcls_MenuItem31(ValaProjectSettings _owner )
1009 this.el = new Gtk.MenuItem();
1013 // set gobject values
1014 this.el.label = "Add Compile Target";
1017 this.el.activate.connect( () => {
1019 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1023 // add the directory..
1025 _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
1026 _this.targets_tree_store.load();
1030 // user defined functions
1032 public class Xcls_SeparatorMenuItem32 : Object
1034 public Gtk.SeparatorMenuItem el;
1035 private ValaProjectSettings _this;
1041 public Xcls_SeparatorMenuItem32(ValaProjectSettings _owner )
1044 this.el = new Gtk.SeparatorMenuItem();
1048 // set gobject values
1051 // user defined functions
1053 public class Xcls_MenuItem33 : Object
1055 public Gtk.MenuItem el;
1056 private ValaProjectSettings _this;
1062 public Xcls_MenuItem33(ValaProjectSettings _owner )
1065 this.el = new Gtk.MenuItem();
1069 // set gobject values
1070 this.el.label = "Remove Target";
1073 this.el.activate.connect( () => {
1078 if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1079 print("nothing selected\n");
1084 // add the directory..
1088 mod.get_value(iter,0, out val);
1089 var fn = (string) val;
1091 print("remove: %s\n", fn);
1092 if (!_this.project.compilegroups.unset(fn)) {
1093 print("remove failed");
1095 _this.targets_tree_store.load();
1099 // user defined functions
1101 public class Xcls_targets_tree : Object
1103 public Gtk.TreeView el;
1104 private ValaProjectSettings _this;
1108 public string cursor;
1111 public Xcls_targets_tree(ValaProjectSettings _owner )
1114 _this.targets_tree = this;
1115 this.el = new Gtk.TreeView();
1119 // set gobject values
1120 var child_0 = new Xcls_targets_tree_store( _this );
1122 this.el.set_model ( child_0.el );
1123 var child_1 = new Xcls_TreeViewColumn36( _this );
1125 this.el.append_column ( child_1.el );
1128 this.el.button_press_event.connect( ( ev) => {
1129 //console.log("button press?");
1132 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
1133 //print("click" + ev.type);
1137 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1141 // this.el.get_selection().select_path(res);
1143 //if (!this.get('/LeftTreeMenu').el) {
1144 // this.get('/LeftTreeMenu').init();
1147 _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1148 _this.targets_tree_menu.el.show_all();
1149 _this.targets_tree_menu.el.popup(null, null, null, 3, ev.time);
1150 // print("click:" + res.path.to_string());
1153 this.el.cursor_changed.connect( ( ) => {
1155 if (this.cursor != "") {
1156 // save the values..
1159 // load the new values.
1164 if (!this.el.get_selection().get_selected(out mod, out iter)) {
1165 print("nothing selected\n");
1166 // should disable the right hand side..
1167 _this.set_vbox.el.hide();
1170 _this.set_vbox.el.show();
1172 // add the directory..
1176 mod.get_value(iter,0, out val);
1177 var fn = (string) val;
1180 var cg = _this.project.compilegroups.get(fn);
1182 _this.build_pack_target.el.set_text(cg.target_bin);
1183 _this.build_compile_flags.el.set_text(cg.compile_flags);
1184 _this.set_vbox.cgroup = cg;
1185 _this.files_tree_store.update();
1193 // user defined functions
1195 public class Xcls_targets_tree_store : Object
1197 public Gtk.ListStore el;
1198 private ValaProjectSettings _this;
1204 public Xcls_targets_tree_store(ValaProjectSettings _owner )
1207 _this.targets_tree_store = this;
1208 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1209 typeof(string) // ??
1214 // set gobject values
1217 // user defined functions
1218 public void load () {
1223 var cg = _this.project.compilegroups;
1225 _this.targets_tree.cursor = "";
1227 var iter = cg.map_iterator();
1228 while(iter.next()) {
1229 var key = iter.get_key();
1230 if (key == "_default_") {
1234 this.el.append(out citer);
1236 this.el.set_value(citer, 0, key ); // title
1237 //this.el.set_value(citer, 1, items.get(i) );
1239 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1240 _this.set_vbox.el.hide();
1243 public class Xcls_TreeViewColumn36 : Object
1245 public Gtk.TreeViewColumn el;
1246 private ValaProjectSettings _this;
1252 public Xcls_TreeViewColumn36(ValaProjectSettings _owner )
1255 this.el = new Gtk.TreeViewColumn();
1259 // set gobject values
1260 this.el.title = "name";
1261 this.el.resizable = true;
1262 var child_0 = new Xcls_targets_render( _this );
1264 this.el.pack_start ( child_0.el , false );
1269 this.el.add_attribute(_this.targets_render.el , "text", 0 );
1273 // user defined functions
1275 public class Xcls_targets_render : Object
1277 public Gtk.CellRendererText el;
1278 private ValaProjectSettings _this;
1284 public Xcls_targets_render(ValaProjectSettings _owner )
1287 _this.targets_render = this;
1288 this.el = new Gtk.CellRendererText();
1292 // set gobject values
1293 this.el.editable = true;
1296 this.el.edited.connect( (path, newtext) => {
1299 _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1301 _this.targets_tree_store.el.get_value(iter,0, out gval);
1302 var oldval = (string)gval;
1303 if (oldval == newtext) {
1306 var cg = _this.project.compilegroups.get(oldval);
1308 _this.project.compilegroups.unset(oldval);
1309 _this.project.compilegroups.set(newtext, cg);
1310 _this.targets_tree_store.load();
1314 // user defined functions
1316 public class Xcls_set_vbox : Object
1319 private ValaProjectSettings _this;
1323 public Project.GtkValaSettings cgroup;
1326 public Xcls_set_vbox(ValaProjectSettings _owner )
1329 _this.set_vbox = this;
1330 this.el = new Gtk.VBox( false, 0 );
1335 // set gobject values
1336 var child_0 = new Xcls_Label39( _this );
1338 this.el.pack_start ( child_0.el , false,false,0 );
1339 var child_1 = new Xcls_build_pack_target( _this );
1341 this.el.pack_start ( child_1.el , false,false,0 );
1342 var child_2 = new Xcls_Label41( _this );
1344 this.el.pack_start ( child_2.el , false,false,0 );
1345 var child_3 = new Xcls_build_compile_flags( _this );
1347 this.el.pack_start ( child_3.el , false,false,0 );
1348 var child_4 = new Xcls_Label43( _this );
1350 this.el.pack_start ( child_4.el , false,false,0 );
1351 var child_5 = new Xcls_ScrolledWindow44( _this );
1353 this.el.pack_start ( child_5.el , true,true,0 );
1356 // user defined functions
1358 public class Xcls_Label39 : Object
1360 public Gtk.Label el;
1361 private ValaProjectSettings _this;
1367 public Xcls_Label39(ValaProjectSettings _owner )
1370 this.el = new Gtk.Label( "target filename" );
1374 // set gobject values
1377 // user defined functions
1379 public class Xcls_build_pack_target : Object
1381 public Gtk.Entry el;
1382 private ValaProjectSettings _this;
1388 public Xcls_build_pack_target(ValaProjectSettings _owner )
1391 _this.build_pack_target = this;
1392 this.el = new Gtk.Entry();
1396 // set gobject values
1399 this.el.changed.connect( () => {
1400 if (_this.targets_tree.cursor.length < 1) {
1403 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1407 // user defined functions
1409 public class Xcls_Label41 : Object
1411 public Gtk.Label el;
1412 private ValaProjectSettings _this;
1418 public Xcls_Label41(ValaProjectSettings _owner )
1421 this.el = new Gtk.Label( "compile flags" );
1425 // set gobject values
1428 // user defined functions
1430 public class Xcls_build_compile_flags : Object
1432 public Gtk.Entry el;
1433 private ValaProjectSettings _this;
1439 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1442 _this.build_compile_flags = this;
1443 this.el = new Gtk.Entry();
1447 // set gobject values
1450 this.el.changed.connect( () => {
1451 if (_this.targets_tree.cursor.length < 1) {
1454 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1458 // user defined functions
1460 public class Xcls_Label43 : Object
1462 public Gtk.Label el;
1463 private ValaProjectSettings _this;
1469 public Xcls_Label43(ValaProjectSettings _owner )
1472 this.el = new Gtk.Label( "Files to compile" );
1476 // set gobject values
1479 // user defined functions
1481 public class Xcls_ScrolledWindow44 : Object
1483 public Gtk.ScrolledWindow el;
1484 private ValaProjectSettings _this;
1490 public Xcls_ScrolledWindow44(ValaProjectSettings _owner )
1493 this.el = new Gtk.ScrolledWindow( null, null );
1497 // set gobject values
1498 var child_0 = new Xcls_files_tree( _this );
1500 this.el.add ( child_0.el );
1503 // user defined functions
1505 public class Xcls_files_tree : Object
1507 public Gtk.TreeView el;
1508 private ValaProjectSettings _this;
1514 public Xcls_files_tree(ValaProjectSettings _owner )
1517 this.el = new Gtk.TreeView();
1521 // set gobject values
1522 var child_0 = new Xcls_files_tree_store( _this );
1524 this.el.set_model ( child_0.el );
1525 var child_1 = new Xcls_TreeViewColumn47( _this );
1527 this.el.append_column ( child_1.el );
1528 var child_2 = new Xcls_TreeViewColumn49( _this );
1530 this.el.append_column ( child_2.el );
1533 // user defined functions
1535 public class Xcls_files_tree_store : Object
1537 public Gtk.ListStore el;
1538 private ValaProjectSettings _this;
1544 public Xcls_files_tree_store(ValaProjectSettings _owner )
1547 _this.files_tree_store = this;
1548 this.el = new Gtk.ListStore( 4, typeof(string), // 0 file name
1549 typeof(string), // 0 basename
1550 typeof(string), // type (dir orfile)
1551 typeof(bool) // is checked.
1556 // set gobject values
1559 // user defined functions
1560 public void updateDir (string dname, bool bval) {
1564 var cg = _this.set_vbox.cgroup;
1565 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1566 this.el.iter_nth_child(out citer,null,i);
1569 this.el.get_value(citer,0, out val);
1570 var fn = (string) val;
1572 if ( Path.get_dirname (fn) == dname) {
1574 this.el.set_value(citer, 3, bval ); // checked
1580 if (cg.sources.contains(fn)) {
1581 cg.sources.remove(fn);
1584 if (!cg.sources.contains(fn)) {
1594 public void load () {
1599 var def = _this.project.compilegroups.get("_default_");
1600 var items = def.sources;
1608 for(var i =0 ; i < items.size; i++) {
1610 var files = _this.project.files(items.get(i));
1611 if (files.size < 1) {
1615 this.el.append(out citer);
1617 this.el.set_value(citer, 0, items.get(i) ); // title
1618 this.el.set_value(citer, 1, "<span foreground=\"green\" font_weight=\"bold\">" +
1619 GLib.Markup.escape_text(items.get(i)) + "</span>"
1621 print("ADD item %s", items.get(i));
1622 this.el.set_value(citer, 2, "dir"); // type
1623 this.el.set_value(citer, 3, false ); // checked
1627 for(var j =0 ; j < files.size; j++) {
1628 this.el.append(out citer);
1629 print("ADD item %s", files.get(j));
1630 this.el.set_value(citer, 0, files.get(j) ); // title
1631 this.el.set_value(citer, 1, GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title
1632 this.el.set_value(citer, 2, "file"); // type
1633 this.el.set_value(citer, 3, false ); // checked
1638 //this.el.set_value(citer, 1, items.get(i) );
1640 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1643 public void update () {
1648 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1649 this.el.iter_nth_child(out citer,null,i);
1652 this.el.get_value(citer,0, out val);
1653 var fn = (string) val;
1656 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1660 this.el.set_value(citer, 3, active ); // checked
1666 public class Xcls_TreeViewColumn47 : Object
1668 public Gtk.TreeViewColumn el;
1669 private ValaProjectSettings _this;
1675 public Xcls_TreeViewColumn47(ValaProjectSettings _owner )
1678 this.el = new Gtk.TreeViewColumn();
1682 // set gobject values
1683 this.el.title = "name";
1684 this.el.resizable = true;
1685 var child_0 = new Xcls_files_render( _this );
1687 this.el.pack_start ( child_0.el , false );
1691 this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1693 /* this.el.add_attribute(_this.files_render.el , "markup", 2 );
1697 // user defined functions
1699 public class Xcls_files_render : Object
1701 public Gtk.CellRendererText el;
1702 private ValaProjectSettings _this;
1708 public Xcls_files_render(ValaProjectSettings _owner )
1711 _this.files_render = this;
1712 this.el = new Gtk.CellRendererText();
1716 // set gobject values
1719 // user defined functions
1721 public class Xcls_TreeViewColumn49 : Object
1723 public Gtk.TreeViewColumn el;
1724 private ValaProjectSettings _this;
1730 public Xcls_TreeViewColumn49(ValaProjectSettings _owner )
1733 this.el = new Gtk.TreeViewColumn();
1737 // set gobject values
1738 this.el.title = "use";
1739 this.el.resizable = false;
1740 this.el.fixed_width = 50;
1741 var child_0 = new Xcls_files_render_use( _this );
1743 this.el.pack_start ( child_0.el , false );
1748 this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1752 // user defined functions
1754 public class Xcls_files_render_use : Object
1756 public Gtk.CellRendererToggle el;
1757 private ValaProjectSettings _this;
1763 public Xcls_files_render_use(ValaProjectSettings _owner )
1766 _this.files_render_use = this;
1767 this.el = new Gtk.CellRendererToggle();
1771 // set gobject values
1772 this.el.activatable = true;
1775 this.el.toggled.connect( ( path_string) => {
1779 var m = _this.files_tree_store.el;
1781 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1782 m.get_iter (out iter, path);
1784 m.get_value(iter, 3, out val);
1785 m.set_value(iter, 3, ((bool) val) ? false :true);
1789 m.get_value(iter, 2, out ftval);
1790 var ftype = (string)ftval;
1794 m.get_value(iter, 0, out fval);
1795 var fn = (string)fval;
1798 var cg = _this.set_vbox.cgroup;
1799 // what's the sleected target?
1800 // update the list..
1801 // if ftype is a dir == then toggle all the bellow.
1803 if (ftype == "dir") {
1804 _this.files_tree_store.updateDir(fn, ((bool) val) ? false :true);
1807 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1812 cg.sources.remove(fn);
1820 // user defined functions