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_HPaned27( _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_ScrolledWindow9( _this );
178 this.el.pack_start ( child_3.el , true,true,0 );
179 var child_4 = new Xcls_Label16( _this );
181 this.el.pack_start ( child_4.el , false,false,0 );
182 var child_5 = new Xcls_ScrolledWindow17( _this );
184 this.el.pack_start ( child_5.el , true,true,0 );
187 // user defined functions
189 public class Xcls_Label6 : Object
192 private ValaProjectSettings _this;
198 public Xcls_Label6(ValaProjectSettings _owner )
201 this.el = new Gtk.Label( "compile flags" );
205 // set gobject values
208 // user defined functions
210 public class Xcls_compile_flags : Object
213 private ValaProjectSettings _this;
219 public Xcls_compile_flags(ValaProjectSettings _owner )
222 _this.compile_flags = this;
223 this.el = new Gtk.Entry();
227 // set gobject values
228 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
231 this.el.changed.connect( () => {
233 _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
234 _this.project.writeConfig();
235 // _this.project.save();
240 // user defined functions
242 public class Xcls_Label8 : Object
245 private ValaProjectSettings _this;
251 public Xcls_Label8(ValaProjectSettings _owner )
254 this.el = new Gtk.Label( "packages" );
258 // set gobject values
261 // user defined functions
263 public class Xcls_ScrolledWindow9 : Object
265 public Gtk.ScrolledWindow el;
266 private ValaProjectSettings _this;
272 public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
275 this.el = new Gtk.ScrolledWindow( null, null );
279 // set gobject values
280 var child_0 = new Xcls_default_packages_tree( _this );
282 this.el.add ( child_0.el );
285 // user defined functions
287 public class Xcls_default_packages_tree : Object
289 public Gtk.TreeView el;
290 private ValaProjectSettings _this;
296 public Xcls_default_packages_tree(ValaProjectSettings _owner )
299 this.el = new Gtk.TreeView();
303 // set gobject values
304 this.el.headers_visible = false;
305 var child_0 = new Xcls_default_packages_tree_store( _this );
307 this.el.set_model ( child_0.el );
308 var child_1 = new Xcls_TreeViewColumn12( _this );
310 this.el.append_column ( child_1.el );
311 var child_2 = new Xcls_TreeViewColumn14( _this );
313 this.el.append_column ( child_2.el );
316 // user defined functions
318 public class Xcls_default_packages_tree_store : Object
320 public Gtk.ListStore el;
321 private ValaProjectSettings _this;
327 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
330 _this.default_packages_tree_store = this;
331 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
336 // set gobject values
339 // user defined functions
340 public void load () {
342 var def = _this.project.compilegroups.get("_default_");
343 var items = def.packages;
346 var pal = (Palete.Gtk) Palete.factory("Gtk");
347 var pkgs = pal.packages(_this.project);
348 print("ValaProjectSettings:packages load %d\n", pkgs.size);
352 for(var i =0 ; i < pkgs.size; i++) {
353 this.el.append(out citer);
355 this.el.set_value(citer, 0, pkgs.get(i) ); // title
356 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
358 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
362 public class Xcls_TreeViewColumn12 : Object
364 public Gtk.TreeViewColumn el;
365 private ValaProjectSettings _this;
371 public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
374 this.el = new Gtk.TreeViewColumn();
378 // set gobject values
379 this.el.title = "name";
380 this.el.expand = true;
381 this.el.resizable = true;
382 var child_0 = new Xcls_packages_render( _this );
384 this.el.pack_start ( child_0.el , false );
388 this.el.add_attribute(_this.packages_render.el , "text", 0 );
391 // user defined functions
393 public class Xcls_packages_render : Object
395 public Gtk.CellRendererText el;
396 private ValaProjectSettings _this;
402 public Xcls_packages_render(ValaProjectSettings _owner )
405 _this.packages_render = this;
406 this.el = new Gtk.CellRendererText();
410 // set gobject values
413 // user defined functions
415 public class Xcls_TreeViewColumn14 : Object
417 public Gtk.TreeViewColumn el;
418 private ValaProjectSettings _this;
424 public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
427 this.el = new Gtk.TreeViewColumn();
431 // set gobject values
432 this.el.title = "use";
433 this.el.resizable = false;
434 this.el.fixed_width = 50;
435 var child_0 = new Xcls_packages_render_use( _this );
437 this.el.pack_start ( child_0.el , false );
442 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
446 // user defined functions
448 public class Xcls_packages_render_use : Object
450 public Gtk.CellRendererToggle el;
451 private ValaProjectSettings _this;
457 public Xcls_packages_render_use(ValaProjectSettings _owner )
460 _this.packages_render_use = this;
461 this.el = new Gtk.CellRendererToggle();
465 // set gobject values
466 this.el.activatable = true;
469 this.el.toggled.connect( ( path_string) => {
470 var m = _this.default_packages_tree_store.el;
472 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
473 m.get_iter (out iter, path);
475 m.get_value(iter, 1, out val);
476 m.set_value(iter, 1, ((bool) val) ? false :true);
478 m.get_value(iter, 0, out fval);
479 var fn = (string)fval;
481 var def = _this.project.compilegroups.get("_default_");
482 var items = def.packages;
493 // user defined functions
495 public class Xcls_Label16 : Object
498 private ValaProjectSettings _this;
504 public Xcls_Label16(ValaProjectSettings _owner )
507 this.el = new Gtk.Label( "Available Directories" );
511 // set gobject values
514 // user defined functions
516 public class Xcls_ScrolledWindow17 : Object
518 public Gtk.ScrolledWindow el;
519 private ValaProjectSettings _this;
525 public Xcls_ScrolledWindow17(ValaProjectSettings _owner )
528 this.el = new Gtk.ScrolledWindow( null, null );
532 // set gobject values
533 var child_0 = new Xcls_default_directory_tree( _this );
535 this.el.add ( child_0.el );
536 var child_1 = new Xcls_default_directory_menu( _this );
540 // user defined functions
542 public class Xcls_default_directory_tree : Object
544 public Gtk.TreeView el;
545 private ValaProjectSettings _this;
551 public Xcls_default_directory_tree(ValaProjectSettings _owner )
554 _this.default_directory_tree = this;
555 this.el = new Gtk.TreeView();
559 // set gobject values
560 this.el.headers_visible = false;
561 var child_0 = new Xcls_default_directory_tree_store( _this );
563 this.el.set_model ( child_0.el );
564 var child_1 = new Xcls_TreeViewColumn20( _this );
566 this.el.append_column ( child_1.el );
569 this.el.button_press_event.connect( ( ev) => {
570 //console.log("button press?");
573 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
574 //print("click" + ev.type);
578 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
582 // this.el.get_selection().select_path(res);
584 //if (!this.get('/LeftTreeMenu').el) {
585 // this.get('/LeftTreeMenu').init();
588 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
589 _this.default_directory_menu.el.show_all();
590 _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);
591 // print("click:" + res.path.to_string());
596 // user defined functions
598 public class Xcls_default_directory_tree_store : Object
600 public Gtk.ListStore el;
601 private ValaProjectSettings _this;
607 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
610 _this.default_directory_tree_store = this;
611 this.el = new Gtk.ListStore( 1, typeof(string)
616 // set gobject values
619 // user defined functions
620 public void load () {
625 var def = _this.project.compilegroups.get("_default_");
626 var items = def.sources;
631 for(var i =0 ; i < items.size; i++) {
632 this.el.append(out citer);
634 this.el.set_value(citer, 0, items.get(i) ); // title
635 //this.el.set_value(citer, 1, items.get(i) );
637 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
641 public class Xcls_TreeViewColumn20 : Object
643 public Gtk.TreeViewColumn el;
644 private ValaProjectSettings _this;
650 public Xcls_TreeViewColumn20(ValaProjectSettings _owner )
653 this.el = new Gtk.TreeViewColumn();
657 // set gobject values
658 this.el.title = "name";
659 this.el.resizable = true;
660 var child_0 = new Xcls_directory_render( _this );
662 this.el.pack_start ( child_0.el , false );
666 this.el.add_attribute(_this.directory_render.el , "text", 0 );
669 // user defined functions
671 public class Xcls_directory_render : Object
673 public Gtk.CellRendererText el;
674 private ValaProjectSettings _this;
680 public Xcls_directory_render(ValaProjectSettings _owner )
683 _this.directory_render = this;
684 this.el = new Gtk.CellRendererText();
688 // set gobject values
691 // user defined functions
693 public class Xcls_default_directory_menu : Object
696 private ValaProjectSettings _this;
702 public Xcls_default_directory_menu(ValaProjectSettings _owner )
705 _this.default_directory_menu = this;
706 this.el = new Gtk.Menu();
710 // set gobject values
711 var child_0 = new Xcls_MenuItem23( _this );
713 this.el.add ( child_0.el );
714 var child_1 = new Xcls_MenuItem24( _this );
716 this.el.add ( child_1.el );
717 var child_2 = new Xcls_SeparatorMenuItem25( _this );
719 this.el.add ( child_2.el );
720 var child_3 = new Xcls_MenuItem26( _this );
722 this.el.add ( child_3.el );
725 // user defined functions
727 public class Xcls_MenuItem23 : Object
729 public Gtk.MenuItem el;
730 private ValaProjectSettings _this;
736 public Xcls_MenuItem23(ValaProjectSettings _owner )
739 this.el = new Gtk.MenuItem();
743 // set gobject values
744 this.el.label = "Add Directory";
747 this.el.activate.connect( () => {
749 var chooser = new Gtk.FileChooserDialog (
750 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
752 Gtk.ResponseType.CANCEL,
754 Gtk.ResponseType.ACCEPT);
755 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
760 // add the directory..
761 var fn = _this.project.relPath(chooser.get_filename());
762 _this.project.compilegroups.get("_default_").sources.add(fn);
763 _this.default_directory_tree_store.load();
767 // user defined functions
769 public class Xcls_MenuItem24 : Object
771 public Gtk.MenuItem el;
772 private ValaProjectSettings _this;
778 public Xcls_MenuItem24(ValaProjectSettings _owner )
781 this.el = new Gtk.MenuItem();
785 // set gobject values
786 this.el.label = "Add File";
789 this.el.activate.connect( () => {
791 var chooser = new Gtk.FileChooserDialog (
792 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
794 Gtk.ResponseType.CANCEL,
796 Gtk.ResponseType.ACCEPT);
797 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
802 // add the directory..
803 var fn = _this.project.relPath(chooser.get_filename());
804 _this.project.compilegroups.get("_default_").sources.add(fn);
805 _this.default_directory_tree_store.load();
809 // user defined functions
811 public class Xcls_SeparatorMenuItem25 : Object
813 public Gtk.SeparatorMenuItem el;
814 private ValaProjectSettings _this;
820 public Xcls_SeparatorMenuItem25(ValaProjectSettings _owner )
823 this.el = new Gtk.SeparatorMenuItem();
827 // set gobject values
830 // user defined functions
832 public class Xcls_MenuItem26 : Object
834 public Gtk.MenuItem el;
835 private ValaProjectSettings _this;
841 public Xcls_MenuItem26(ValaProjectSettings _owner )
844 this.el = new Gtk.MenuItem();
848 // set gobject values
849 this.el.label = "Remove File/Directory";
852 this.el.activate.connect( () => {
857 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
858 print("nothing selected\n");
863 // add the directory..
867 mod.get_value(iter,0, out val);
868 var fn = (string) val;
870 print("remove: %s\n", fn);
871 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
872 print("remove failed");
874 _this.default_directory_tree_store.load();
878 // user defined functions
880 public class Xcls_HPaned27 : Object
882 public Gtk.HPaned el;
883 private ValaProjectSettings _this;
889 public Xcls_HPaned27(ValaProjectSettings _owner )
892 this.el = new Gtk.HPaned();
896 // set gobject values
897 this.el.position = 300;
898 var child_0 = new Xcls_ScrolledWindow28( _this );
900 this.el.add1 ( child_0.el );
901 var child_1 = new Xcls_set_vbox( _this );
903 this.el.add2 ( child_1.el );
906 // user defined functions
908 public class Xcls_ScrolledWindow28 : Object
910 public Gtk.ScrolledWindow el;
911 private ValaProjectSettings _this;
917 public Xcls_ScrolledWindow28(ValaProjectSettings _owner )
920 this.el = new Gtk.ScrolledWindow( null, null );
924 // set gobject values
925 var child_0 = new Xcls_targets_tree_menu( _this );
927 this.el.add ( child_0.el );
928 var child_1 = new Xcls_targets_tree( _this );
930 this.el.add ( child_1.el );
935 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
940 // user defined functions
942 public class Xcls_targets_tree_menu : Object
945 private ValaProjectSettings _this;
951 public Xcls_targets_tree_menu(ValaProjectSettings _owner )
954 _this.targets_tree_menu = this;
955 this.el = new Gtk.Menu();
959 // set gobject values
960 var child_0 = new Xcls_MenuItem30( _this );
962 this.el.add ( child_0.el );
963 var child_1 = new Xcls_SeparatorMenuItem31( _this );
965 this.el.add ( child_1.el );
966 var child_2 = new Xcls_MenuItem32( _this );
968 this.el.add ( child_2.el );
971 // user defined functions
973 public class Xcls_MenuItem30 : Object
975 public Gtk.MenuItem el;
976 private ValaProjectSettings _this;
982 public Xcls_MenuItem30(ValaProjectSettings _owner )
985 this.el = new Gtk.MenuItem();
989 // set gobject values
990 this.el.label = "Add Compile Target";
993 this.el.activate.connect( () => {
995 if (_this.project.compilegroups.has_key("NEW GROUP")) {
999 // add the directory..
1001 _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
1002 _this.targets_tree_store.load();
1006 // user defined functions
1008 public class Xcls_SeparatorMenuItem31 : Object
1010 public Gtk.SeparatorMenuItem el;
1011 private ValaProjectSettings _this;
1017 public Xcls_SeparatorMenuItem31(ValaProjectSettings _owner )
1020 this.el = new Gtk.SeparatorMenuItem();
1024 // set gobject values
1027 // user defined functions
1029 public class Xcls_MenuItem32 : Object
1031 public Gtk.MenuItem el;
1032 private ValaProjectSettings _this;
1038 public Xcls_MenuItem32(ValaProjectSettings _owner )
1041 this.el = new Gtk.MenuItem();
1045 // set gobject values
1046 this.el.label = "Remove Target";
1049 this.el.activate.connect( () => {
1054 if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1055 print("nothing selected\n");
1060 // add the directory..
1064 mod.get_value(iter,0, out val);
1065 var fn = (string) val;
1067 print("remove: %s\n", fn);
1068 if (!_this.project.compilegroups.unset(fn)) {
1069 print("remove failed");
1071 _this.targets_tree_store.load();
1075 // user defined functions
1077 public class Xcls_targets_tree : Object
1079 public Gtk.TreeView el;
1080 private ValaProjectSettings _this;
1084 public string cursor;
1087 public Xcls_targets_tree(ValaProjectSettings _owner )
1090 _this.targets_tree = this;
1091 this.el = new Gtk.TreeView();
1095 // set gobject values
1096 var child_0 = new Xcls_targets_tree_store( _this );
1098 this.el.set_model ( child_0.el );
1099 var child_1 = new Xcls_TreeViewColumn35( _this );
1101 this.el.append_column ( child_1.el );
1104 this.el.button_press_event.connect( ( ev) => {
1105 //console.log("button press?");
1108 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
1109 //print("click" + ev.type);
1113 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1117 // this.el.get_selection().select_path(res);
1119 //if (!this.get('/LeftTreeMenu').el) {
1120 // this.get('/LeftTreeMenu').init();
1123 _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1124 _this.targets_tree_menu.el.show_all();
1125 _this.targets_tree_menu.el.popup(null, null, null, 3, ev.time);
1126 // print("click:" + res.path.to_string());
1129 this.el.cursor_changed.connect( ( ) => {
1131 if (this.cursor != "") {
1132 // save the values..
1135 // load the new values.
1140 if (!this.el.get_selection().get_selected(out mod, out iter)) {
1141 print("nothing selected\n");
1142 // should disable the right hand side..
1143 _this.set_vbox.el.hide();
1146 _this.set_vbox.el.show();
1148 // add the directory..
1152 mod.get_value(iter,0, out val);
1153 var fn = (string) val;
1156 var cg = _this.project.compilegroups.get(fn);
1158 _this.build_pack_target.el.set_text(cg.target_bin);
1159 _this.build_compile_flags.el.set_text(cg.compile_flags);
1160 _this.set_vbox.cgroup = cg;
1161 _this.files_tree_store.update();
1169 // user defined functions
1171 public class Xcls_targets_tree_store : Object
1173 public Gtk.ListStore el;
1174 private ValaProjectSettings _this;
1180 public Xcls_targets_tree_store(ValaProjectSettings _owner )
1183 _this.targets_tree_store = this;
1184 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1185 typeof(string) // ??
1190 // set gobject values
1193 // user defined functions
1194 public void load () {
1199 var cg = _this.project.compilegroups;
1201 _this.targets_tree.cursor = "";
1203 var iter = cg.map_iterator();
1204 while(iter.next()) {
1205 var key = iter.get_key();
1206 if (key == "_default_") {
1210 this.el.append(out citer);
1212 this.el.set_value(citer, 0, key ); // title
1213 //this.el.set_value(citer, 1, items.get(i) );
1215 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1216 _this.set_vbox.el.hide();
1219 public class Xcls_TreeViewColumn35 : Object
1221 public Gtk.TreeViewColumn el;
1222 private ValaProjectSettings _this;
1228 public Xcls_TreeViewColumn35(ValaProjectSettings _owner )
1231 this.el = new Gtk.TreeViewColumn();
1235 // set gobject values
1236 this.el.title = "name";
1237 this.el.resizable = true;
1238 var child_0 = new Xcls_targets_render( _this );
1240 this.el.pack_start ( child_0.el , false );
1245 this.el.add_attribute(_this.targets_render.el , "text", 0 );
1249 // user defined functions
1251 public class Xcls_targets_render : Object
1253 public Gtk.CellRendererText el;
1254 private ValaProjectSettings _this;
1260 public Xcls_targets_render(ValaProjectSettings _owner )
1263 _this.targets_render = this;
1264 this.el = new Gtk.CellRendererText();
1268 // set gobject values
1269 this.el.editable = true;
1272 this.el.edited.connect( (path, newtext) => {
1275 _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1277 _this.targets_tree_store.el.get_value(iter,0, out gval);
1278 var oldval = (string)gval;
1279 if (oldval == newtext) {
1282 var cg = _this.project.compilegroups.get(oldval);
1284 _this.project.compilegroups.unset(oldval);
1285 _this.project.compilegroups.set(newtext, cg);
1286 _this.targets_tree_store.load();
1290 // user defined functions
1292 public class Xcls_set_vbox : Object
1295 private ValaProjectSettings _this;
1299 public Project.GtkValaSettings cgroup;
1302 public Xcls_set_vbox(ValaProjectSettings _owner )
1305 _this.set_vbox = this;
1306 this.el = new Gtk.VBox( false, 0 );
1311 // set gobject values
1312 var child_0 = new Xcls_Label38( _this );
1314 this.el.pack_start ( child_0.el , false,false,0 );
1315 var child_1 = new Xcls_build_pack_target( _this );
1317 this.el.pack_start ( child_1.el , false,false,0 );
1318 var child_2 = new Xcls_Label40( _this );
1320 this.el.pack_start ( child_2.el , false,false,0 );
1321 var child_3 = new Xcls_build_compile_flags( _this );
1323 this.el.pack_start ( child_3.el , false,false,0 );
1324 var child_4 = new Xcls_Label42( _this );
1326 this.el.pack_start ( child_4.el , false,false,0 );
1327 var child_5 = new Xcls_ScrolledWindow43( _this );
1329 this.el.pack_start ( child_5.el , true,true,0 );
1332 // user defined functions
1334 public class Xcls_Label38 : Object
1336 public Gtk.Label el;
1337 private ValaProjectSettings _this;
1343 public Xcls_Label38(ValaProjectSettings _owner )
1346 this.el = new Gtk.Label( "target filename" );
1350 // set gobject values
1353 // user defined functions
1355 public class Xcls_build_pack_target : Object
1357 public Gtk.Entry el;
1358 private ValaProjectSettings _this;
1364 public Xcls_build_pack_target(ValaProjectSettings _owner )
1367 _this.build_pack_target = this;
1368 this.el = new Gtk.Entry();
1372 // set gobject values
1375 this.el.changed.connect( () => {
1376 if (_this.targets_tree.cursor.length < 1) {
1379 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1383 // user defined functions
1385 public class Xcls_Label40 : Object
1387 public Gtk.Label el;
1388 private ValaProjectSettings _this;
1394 public Xcls_Label40(ValaProjectSettings _owner )
1397 this.el = new Gtk.Label( "compile flags" );
1401 // set gobject values
1404 // user defined functions
1406 public class Xcls_build_compile_flags : Object
1408 public Gtk.Entry el;
1409 private ValaProjectSettings _this;
1415 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1418 _this.build_compile_flags = this;
1419 this.el = new Gtk.Entry();
1423 // set gobject values
1426 this.el.changed.connect( () => {
1427 if (_this.targets_tree.cursor.length < 1) {
1430 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1434 // user defined functions
1436 public class Xcls_Label42 : Object
1438 public Gtk.Label el;
1439 private ValaProjectSettings _this;
1445 public Xcls_Label42(ValaProjectSettings _owner )
1448 this.el = new Gtk.Label( "Files to compile" );
1452 // set gobject values
1455 // user defined functions
1457 public class Xcls_ScrolledWindow43 : Object
1459 public Gtk.ScrolledWindow el;
1460 private ValaProjectSettings _this;
1466 public Xcls_ScrolledWindow43(ValaProjectSettings _owner )
1469 this.el = new Gtk.ScrolledWindow( null, null );
1473 // set gobject values
1474 var child_0 = new Xcls_files_tree( _this );
1476 this.el.add ( child_0.el );
1479 // user defined functions
1481 public class Xcls_files_tree : Object
1483 public Gtk.TreeView el;
1484 private ValaProjectSettings _this;
1490 public Xcls_files_tree(ValaProjectSettings _owner )
1493 this.el = new Gtk.TreeView();
1497 // set gobject values
1498 var child_0 = new Xcls_files_tree_store( _this );
1500 this.el.set_model ( child_0.el );
1501 var child_1 = new Xcls_TreeViewColumn46( _this );
1503 this.el.append_column ( child_1.el );
1504 var child_2 = new Xcls_TreeViewColumn48( _this );
1506 this.el.append_column ( child_2.el );
1509 // user defined functions
1511 public class Xcls_files_tree_store : Object
1513 public Gtk.ListStore el;
1514 private ValaProjectSettings _this;
1520 public Xcls_files_tree_store(ValaProjectSettings _owner )
1523 _this.files_tree_store = this;
1524 this.el = new Gtk.ListStore( 4, typeof(string), // 0 file name
1525 typeof(string), // 0 basename
1526 typeof(string), // type (dir orfile)
1527 typeof(bool) // is checked.
1532 // set gobject values
1535 // user defined functions
1536 public void updateDir (string dname, bool bval) {
1540 var cg = _this.set_vbox.cgroup;
1541 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1542 this.el.iter_nth_child(out citer,null,i);
1545 this.el.get_value(citer,0, out val);
1546 var fn = (string) val;
1548 if ( Path.get_dirname (fn) == dname) {
1550 this.el.set_value(citer, 3, bval ); // checked
1556 if (cg.sources.contains(fn)) {
1557 cg.sources.remove(fn);
1560 if (!cg.sources.contains(fn)) {
1570 public void load () {
1575 var def = _this.project.compilegroups.get("_default_");
1576 var items = def.sources;
1584 for(var i =0 ; i < items.size; i++) {
1586 var files = _this.project.files(items.get(i));
1587 if (files.size < 1) {
1591 this.el.append(out citer);
1593 this.el.set_value(citer, 0, items.get(i) ); // title
1594 this.el.set_value(citer, 1, "<span foreground=\"green\" font_weight=\"bold\">" +
1595 GLib.Markup.escape_text(items.get(i)) + "</span>"
1597 print("ADD item %s", items.get(i));
1598 this.el.set_value(citer, 2, "dir"); // type
1599 this.el.set_value(citer, 3, false ); // checked
1603 for(var j =0 ; j < files.size; j++) {
1604 this.el.append(out citer);
1605 print("ADD item %s", files.get(j));
1606 this.el.set_value(citer, 0, files.get(j) ); // title
1607 this.el.set_value(citer, 1, GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title
1608 this.el.set_value(citer, 2, "file"); // type
1609 this.el.set_value(citer, 3, false ); // checked
1614 //this.el.set_value(citer, 1, items.get(i) );
1616 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1619 public void update () {
1624 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1625 this.el.iter_nth_child(out citer,null,i);
1628 this.el.get_value(citer,0, out val);
1629 var fn = (string) val;
1632 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1636 this.el.set_value(citer, 3, active ); // checked
1642 public class Xcls_TreeViewColumn46 : Object
1644 public Gtk.TreeViewColumn el;
1645 private ValaProjectSettings _this;
1651 public Xcls_TreeViewColumn46(ValaProjectSettings _owner )
1654 this.el = new Gtk.TreeViewColumn();
1658 // set gobject values
1659 this.el.title = "name";
1660 this.el.resizable = true;
1661 var child_0 = new Xcls_files_render( _this );
1663 this.el.pack_start ( child_0.el , false );
1667 this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1669 /* this.el.add_attribute(_this.files_render.el , "markup", 2 );
1673 // user defined functions
1675 public class Xcls_files_render : Object
1677 public Gtk.CellRendererText el;
1678 private ValaProjectSettings _this;
1684 public Xcls_files_render(ValaProjectSettings _owner )
1687 _this.files_render = this;
1688 this.el = new Gtk.CellRendererText();
1692 // set gobject values
1695 // user defined functions
1697 public class Xcls_TreeViewColumn48 : Object
1699 public Gtk.TreeViewColumn el;
1700 private ValaProjectSettings _this;
1706 public Xcls_TreeViewColumn48(ValaProjectSettings _owner )
1709 this.el = new Gtk.TreeViewColumn();
1713 // set gobject values
1714 this.el.title = "use";
1715 this.el.resizable = false;
1716 this.el.fixed_width = 50;
1717 var child_0 = new Xcls_files_render_use( _this );
1719 this.el.pack_start ( child_0.el , false );
1724 this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1728 // user defined functions
1730 public class Xcls_files_render_use : Object
1732 public Gtk.CellRendererToggle el;
1733 private ValaProjectSettings _this;
1739 public Xcls_files_render_use(ValaProjectSettings _owner )
1742 _this.files_render_use = this;
1743 this.el = new Gtk.CellRendererToggle();
1747 // set gobject values
1748 this.el.activatable = true;
1751 this.el.toggled.connect( ( path_string) => {
1755 var m = _this.files_tree_store.el;
1757 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1758 m.get_iter (out iter, path);
1760 m.get_value(iter, 3, out val);
1761 m.set_value(iter, 3, ((bool) val) ? false :true);
1765 m.get_value(iter, 2, out ftval);
1766 var ftype = (string)ftval;
1770 m.get_value(iter, 0, out fval);
1771 var fn = (string)fval;
1774 var cg = _this.set_vbox.cgroup;
1775 // what's the sleected target?
1776 // update the list..
1777 // if ftype is a dir == then toggle all the bellow.
1779 if (ftype == "dir") {
1780 _this.files_tree_store.updateDir(fn, ((bool) val) ? false :true);
1783 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1788 cg.sources.remove(fn);
1796 // user defined functions