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 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_Box5( _this );
98 this.el.append_page ( child_2.el , _this.label_global.el );
99 var child_3 = new Xcls_Paned26( _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
129 public class Xcls_label_targets : Object
132 private ValaProjectSettings _this;
138 public Xcls_label_targets(ValaProjectSettings _owner )
141 _this.label_targets = this;
142 this.el = new Gtk.Label( "Targets" );
146 // set gobject values
149 // user defined functions
152 public class Xcls_Box5 : Object
155 private ValaProjectSettings _this;
161 public Xcls_Box5(ValaProjectSettings _owner )
164 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
168 // set gobject values
169 this.el.homogeneous = false;
170 var child_0 = new Xcls_Label6( _this );
172 this.el.pack_start ( child_0.el , false,false,0 );
173 var child_1 = new Xcls_compile_flags( _this );
175 this.el.pack_start ( child_1.el , false,false,0 );
176 var child_2 = new Xcls_Box8( _this );
178 this.el.pack_start ( child_2.el , true,true,0 );
181 // user defined functions
183 public class Xcls_Label6 : Object
186 private ValaProjectSettings _this;
192 public Xcls_Label6(ValaProjectSettings _owner )
195 this.el = new Gtk.Label( "compile flags" );
199 // set gobject values
202 // user defined functions
205 public class Xcls_compile_flags : Object
208 private ValaProjectSettings _this;
214 public Xcls_compile_flags(ValaProjectSettings _owner )
217 _this.compile_flags = this;
218 this.el = new Gtk.Entry();
222 // set gobject values
223 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
226 this.el.changed.connect( () => {
228 _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
229 _this.project.writeConfig();
230 // _this.project.save();
235 // user defined functions
238 public class Xcls_Box8 : Object
241 private ValaProjectSettings _this;
247 public Xcls_Box8(ValaProjectSettings _owner )
250 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
254 // set gobject values
255 var child_0 = new Xcls_ScrolledWindow9( _this );
257 this.el.add ( child_0.el );
258 var child_1 = new Xcls_ScrolledWindow16( _this );
260 this.el.add ( child_1.el );
263 // user defined functions
265 public class Xcls_ScrolledWindow9 : Object
267 public Gtk.ScrolledWindow el;
268 private ValaProjectSettings _this;
274 public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
277 this.el = new Gtk.ScrolledWindow( null, null );
281 // set gobject values
282 var child_0 = new Xcls_default_packages_tree( _this );
284 this.el.add ( child_0.el );
287 // user defined functions
289 public class Xcls_default_packages_tree : Object
291 public Gtk.TreeView el;
292 private ValaProjectSettings _this;
298 public Xcls_default_packages_tree(ValaProjectSettings _owner )
301 this.el = new Gtk.TreeView();
305 // set gobject values
306 this.el.headers_visible = true;
307 var child_0 = new Xcls_default_packages_tree_store( _this );
309 this.el.set_model ( child_0.el );
310 var child_1 = new Xcls_TreeViewColumn12( _this );
312 this.el.append_column ( child_1.el );
313 var child_2 = new Xcls_TreeViewColumn14( _this );
315 this.el.append_column ( child_2.el );
318 // user defined functions
320 public class Xcls_default_packages_tree_store : Object
322 public Gtk.ListStore el;
323 private ValaProjectSettings _this;
329 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
332 _this.default_packages_tree_store = this;
333 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
338 // set gobject values
341 // user defined functions
342 public void load () {
344 var def = _this.project.compilegroups.get("_default_");
345 var items = def.packages;
348 var pal = (Palete.Gtk) Palete.factory("Gtk");
349 var pkgs = pal.packages(_this.project);
350 print("ValaProjectSettings:packages load %d\n", pkgs.size);
354 for(var i =0 ; i < pkgs.size; i++) {
355 this.el.append(out citer);
357 this.el.set_value(citer, 0, pkgs.get(i) ); // title
358 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
360 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
365 public class Xcls_TreeViewColumn12 : Object
367 public Gtk.TreeViewColumn el;
368 private ValaProjectSettings _this;
374 public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
377 this.el = new Gtk.TreeViewColumn();
381 // set gobject values
382 this.el.title = "package name";
383 this.el.expand = true;
384 this.el.resizable = true;
385 var child_0 = new Xcls_packages_render( _this );
387 this.el.pack_start ( child_0.el , false );
391 this.el.add_attribute(_this.packages_render.el , "text", 0 );
394 // user defined functions
396 public class Xcls_packages_render : Object
398 public Gtk.CellRendererText el;
399 private ValaProjectSettings _this;
405 public Xcls_packages_render(ValaProjectSettings _owner )
408 _this.packages_render = this;
409 this.el = new Gtk.CellRendererText();
413 // set gobject values
416 // user defined functions
420 public class Xcls_TreeViewColumn14 : Object
422 public Gtk.TreeViewColumn el;
423 private ValaProjectSettings _this;
429 public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
432 this.el = new Gtk.TreeViewColumn();
436 // set gobject values
437 this.el.title = "use";
438 this.el.resizable = false;
439 this.el.fixed_width = 50;
440 var child_0 = new Xcls_packages_render_use( _this );
442 this.el.pack_start ( child_0.el , false );
447 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
451 // user defined functions
453 public class Xcls_packages_render_use : Object
455 public Gtk.CellRendererToggle el;
456 private ValaProjectSettings _this;
462 public Xcls_packages_render_use(ValaProjectSettings _owner )
465 _this.packages_render_use = this;
466 this.el = new Gtk.CellRendererToggle();
470 // set gobject values
471 this.el.activatable = true;
474 this.el.toggled.connect( ( path_string) => {
475 var m = _this.default_packages_tree_store.el;
477 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
478 m.get_iter (out iter, path);
480 m.get_value(iter, 1, out val);
481 m.set_value(iter, 1, ((bool) val) ? false :true);
483 m.get_value(iter, 0, out fval);
484 var fn = (string)fval;
486 var def = _this.project.compilegroups.get("_default_");
487 var items = def.packages;
498 // user defined functions
504 public class Xcls_ScrolledWindow16 : Object
506 public Gtk.ScrolledWindow el;
507 private ValaProjectSettings _this;
513 public Xcls_ScrolledWindow16(ValaProjectSettings _owner )
516 this.el = new Gtk.ScrolledWindow( null, null );
520 // set gobject values
521 var child_0 = new Xcls_default_directory_tree( _this );
523 this.el.add ( child_0.el );
524 var child_1 = new Xcls_default_directory_menu( _this );
528 // user defined functions
530 public class Xcls_default_directory_tree : Object
532 public Gtk.TreeView el;
533 private ValaProjectSettings _this;
539 public Xcls_default_directory_tree(ValaProjectSettings _owner )
542 _this.default_directory_tree = this;
543 this.el = new Gtk.TreeView();
547 // set gobject values
548 this.el.headers_visible = true;
549 var child_0 = new Xcls_default_directory_tree_store( _this );
551 this.el.set_model ( child_0.el );
552 var child_1 = new Xcls_TreeViewColumn19( _this );
554 this.el.append_column ( child_1.el );
557 this.el.button_press_event.connect( ( ev) => {
558 //console.log("button press?");
561 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
562 //print("click" + ev.type);
566 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
570 // this.el.get_selection().select_path(res);
572 //if (!this.get('/LeftTreeMenu').el) {
573 // this.get('/LeftTreeMenu').init();
576 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
577 _this.default_directory_menu.el.show_all();
578 _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);
579 // print("click:" + res.path.to_string());
584 // user defined functions
586 public class Xcls_default_directory_tree_store : Object
588 public Gtk.ListStore el;
589 private ValaProjectSettings _this;
595 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
598 _this.default_directory_tree_store = this;
599 this.el = new Gtk.ListStore( 1, typeof(string)
604 // set gobject values
607 // user defined functions
608 public void load () {
613 var def = _this.project.compilegroups.get("_default_");
614 var items = def.sources;
619 for(var i =0 ; i < items.size; i++) {
620 this.el.append(out citer);
622 this.el.set_value(citer, 0, items.get(i) ); // title
623 //this.el.set_value(citer, 1, items.get(i) );
625 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
630 public class Xcls_TreeViewColumn19 : Object
632 public Gtk.TreeViewColumn el;
633 private ValaProjectSettings _this;
639 public Xcls_TreeViewColumn19(ValaProjectSettings _owner )
642 this.el = new Gtk.TreeViewColumn();
646 // set gobject values
647 this.el.title = "Available Directories (right click to add)";
648 this.el.resizable = true;
649 var child_0 = new Xcls_directory_render( _this );
651 this.el.pack_start ( child_0.el , false );
655 this.el.add_attribute(_this.directory_render.el , "text", 0 );
658 // user defined functions
660 public class Xcls_directory_render : Object
662 public Gtk.CellRendererText el;
663 private ValaProjectSettings _this;
669 public Xcls_directory_render(ValaProjectSettings _owner )
672 _this.directory_render = this;
673 this.el = new Gtk.CellRendererText();
677 // set gobject values
680 // user defined functions
685 public class Xcls_default_directory_menu : Object
688 private ValaProjectSettings _this;
694 public Xcls_default_directory_menu(ValaProjectSettings _owner )
697 _this.default_directory_menu = this;
698 this.el = new Gtk.Menu();
702 // set gobject values
703 var child_0 = new Xcls_MenuItem22( _this );
705 this.el.add ( child_0.el );
706 var child_1 = new Xcls_MenuItem23( _this );
708 this.el.add ( child_1.el );
709 var child_2 = new Xcls_SeparatorMenuItem24( _this );
711 this.el.add ( child_2.el );
712 var child_3 = new Xcls_MenuItem25( _this );
714 this.el.add ( child_3.el );
717 // user defined functions
719 public class Xcls_MenuItem22 : Object
721 public Gtk.MenuItem el;
722 private ValaProjectSettings _this;
728 public Xcls_MenuItem22(ValaProjectSettings _owner )
731 this.el = new Gtk.MenuItem();
735 // set gobject values
736 this.el.label = "Add Directory";
739 this.el.activate.connect( () => {
741 var chooser = new Gtk.FileChooserDialog (
742 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
744 Gtk.ResponseType.CANCEL,
746 Gtk.ResponseType.ACCEPT);
747 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
752 // add the directory..
753 var fn = _this.project.relPath(chooser.get_filename());
754 _this.project.compilegroups.get("_default_").sources.add(fn);
755 _this.default_directory_tree_store.load();
759 // user defined functions
762 public class Xcls_MenuItem23 : Object
764 public Gtk.MenuItem el;
765 private ValaProjectSettings _this;
771 public Xcls_MenuItem23(ValaProjectSettings _owner )
774 this.el = new Gtk.MenuItem();
778 // set gobject values
779 this.el.label = "Add File";
782 this.el.activate.connect( () => {
784 var chooser = new Gtk.FileChooserDialog (
785 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
787 Gtk.ResponseType.CANCEL,
789 Gtk.ResponseType.ACCEPT);
790 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
795 // add the directory..
796 var fn = _this.project.relPath(chooser.get_filename());
797 _this.project.compilegroups.get("_default_").sources.add(fn);
798 _this.default_directory_tree_store.load();
802 // user defined functions
805 public class Xcls_SeparatorMenuItem24 : Object
807 public Gtk.SeparatorMenuItem el;
808 private ValaProjectSettings _this;
814 public Xcls_SeparatorMenuItem24(ValaProjectSettings _owner )
817 this.el = new Gtk.SeparatorMenuItem();
821 // set gobject values
824 // user defined functions
827 public class Xcls_MenuItem25 : Object
829 public Gtk.MenuItem el;
830 private ValaProjectSettings _this;
836 public Xcls_MenuItem25(ValaProjectSettings _owner )
839 this.el = new Gtk.MenuItem();
843 // set gobject values
844 this.el.label = "Remove File/Directory";
847 this.el.activate.connect( () => {
852 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
853 print("nothing selected\n");
858 // add the directory..
862 mod.get_value(iter,0, out val);
863 var fn = (string) val;
865 print("remove: %s\n", fn);
866 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
867 print("remove failed");
869 _this.default_directory_tree_store.load();
873 // user defined functions
880 public class Xcls_Paned26 : Object
883 private ValaProjectSettings _this;
889 public Xcls_Paned26(ValaProjectSettings _owner )
892 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
896 // set gobject values
897 this.el.position = 300;
898 var child_0 = new Xcls_ScrolledWindow27( _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_ScrolledWindow27 : Object
910 public Gtk.ScrolledWindow el;
911 private ValaProjectSettings _this;
917 public Xcls_ScrolledWindow27(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_MenuItem29( _this );
962 this.el.add ( child_0.el );
963 var child_1 = new Xcls_SeparatorMenuItem30( _this );
965 this.el.add ( child_1.el );
966 var child_2 = new Xcls_MenuItem31( _this );
968 this.el.add ( child_2.el );
971 // user defined functions
973 public class Xcls_MenuItem29 : Object
975 public Gtk.MenuItem el;
976 private ValaProjectSettings _this;
982 public Xcls_MenuItem29(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
1009 public class Xcls_SeparatorMenuItem30 : Object
1011 public Gtk.SeparatorMenuItem el;
1012 private ValaProjectSettings _this;
1018 public Xcls_SeparatorMenuItem30(ValaProjectSettings _owner )
1021 this.el = new Gtk.SeparatorMenuItem();
1025 // set gobject values
1028 // user defined functions
1031 public class Xcls_MenuItem31 : Object
1033 public Gtk.MenuItem el;
1034 private ValaProjectSettings _this;
1040 public Xcls_MenuItem31(ValaProjectSettings _owner )
1043 this.el = new Gtk.MenuItem();
1047 // set gobject values
1048 this.el.label = "Remove Target";
1051 this.el.activate.connect( () => {
1056 if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1057 print("nothing selected\n");
1062 // add the directory..
1066 mod.get_value(iter,0, out val);
1067 var fn = (string) val;
1069 print("remove: %s\n", fn);
1070 if (!_this.project.compilegroups.unset(fn)) {
1071 print("remove failed");
1073 _this.targets_tree_store.load();
1077 // user defined functions
1081 public class Xcls_targets_tree : Object
1083 public Gtk.TreeView el;
1084 private ValaProjectSettings _this;
1088 public string cursor;
1091 public Xcls_targets_tree(ValaProjectSettings _owner )
1094 _this.targets_tree = this;
1095 this.el = new Gtk.TreeView();
1099 // set gobject values
1100 var child_0 = new Xcls_targets_tree_store( _this );
1102 this.el.set_model ( child_0.el );
1103 var child_1 = new Xcls_TreeViewColumn34( _this );
1105 this.el.append_column ( child_1.el );
1108 this.el.button_press_event.connect( ( ev) => {
1109 //console.log("button press?");
1112 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
1113 //print("click" + ev.type);
1117 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1121 // this.el.get_selection().select_path(res);
1123 //if (!this.get('/LeftTreeMenu').el) {
1124 // this.get('/LeftTreeMenu').init();
1127 _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1128 _this.targets_tree_menu.el.show_all();
1129 _this.targets_tree_menu.el.popup(null, null, null, 3, ev.time);
1130 // print("click:" + res.path.to_string());
1133 this.el.cursor_changed.connect( ( ) => {
1135 if (this.cursor != "") {
1136 // save the values..
1139 // load the new values.
1144 if (!this.el.get_selection().get_selected(out mod, out iter)) {
1145 print("nothing selected\n");
1146 // should disable the right hand side..
1147 _this.set_vbox.el.hide();
1150 _this.set_vbox.el.show();
1152 // add the directory..
1156 mod.get_value(iter,0, out val);
1157 var fn = (string) val;
1160 var cg = _this.project.compilegroups.get(fn);
1162 _this.build_pack_target.el.set_text(cg.target_bin);
1163 _this.build_compile_flags.el.set_text(cg.compile_flags);
1164 _this.set_vbox.cgroup = cg;
1165 _this.files_tree_store.update();
1173 // user defined functions
1175 public class Xcls_targets_tree_store : Object
1177 public Gtk.ListStore el;
1178 private ValaProjectSettings _this;
1184 public Xcls_targets_tree_store(ValaProjectSettings _owner )
1187 _this.targets_tree_store = this;
1188 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1189 typeof(string) // ??
1194 // set gobject values
1197 // user defined functions
1198 public void load () {
1203 var cg = _this.project.compilegroups;
1205 _this.targets_tree.cursor = "";
1207 var iter = cg.map_iterator();
1208 while(iter.next()) {
1209 var key = iter.get_key();
1210 if (key == "_default_") {
1214 this.el.append(out citer);
1216 this.el.set_value(citer, 0, key ); // title
1217 //this.el.set_value(citer, 1, items.get(i) );
1219 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1220 _this.set_vbox.el.hide();
1224 public class Xcls_TreeViewColumn34 : Object
1226 public Gtk.TreeViewColumn el;
1227 private ValaProjectSettings _this;
1233 public Xcls_TreeViewColumn34(ValaProjectSettings _owner )
1236 this.el = new Gtk.TreeViewColumn();
1240 // set gobject values
1241 this.el.title = "name";
1242 this.el.resizable = true;
1243 var child_0 = new Xcls_targets_render( _this );
1245 this.el.pack_start ( child_0.el , false );
1250 this.el.add_attribute(_this.targets_render.el , "text", 0 );
1254 // user defined functions
1256 public class Xcls_targets_render : Object
1258 public Gtk.CellRendererText el;
1259 private ValaProjectSettings _this;
1265 public Xcls_targets_render(ValaProjectSettings _owner )
1268 _this.targets_render = this;
1269 this.el = new Gtk.CellRendererText();
1273 // set gobject values
1274 this.el.editable = true;
1277 this.el.edited.connect( (path, newtext) => {
1280 _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1282 _this.targets_tree_store.el.get_value(iter,0, out gval);
1283 var oldval = (string)gval;
1284 if (oldval == newtext) {
1287 var cg = _this.project.compilegroups.get(oldval);
1289 _this.project.compilegroups.unset(oldval);
1290 _this.project.compilegroups.set(newtext, cg);
1291 _this.targets_tree_store.load();
1295 // user defined functions
1301 public class Xcls_set_vbox : Object
1304 private ValaProjectSettings _this;
1308 public Project.GtkValaSettings cgroup;
1311 public Xcls_set_vbox(ValaProjectSettings _owner )
1314 _this.set_vbox = this;
1315 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1320 // set gobject values
1321 this.el.homogeneous = false;
1322 var child_0 = new Xcls_Label37( _this );
1324 this.el.pack_start ( child_0.el , false,false,0 );
1325 var child_1 = new Xcls_build_pack_target( _this );
1327 this.el.pack_start ( child_1.el , false,false,0 );
1328 var child_2 = new Xcls_Label39( _this );
1330 this.el.pack_start ( child_2.el , false,false,0 );
1331 var child_3 = new Xcls_build_compile_flags( _this );
1333 this.el.pack_start ( child_3.el , false,false,0 );
1334 var child_4 = new Xcls_Label41( _this );
1336 this.el.pack_start ( child_4.el , false,false,0 );
1337 var child_5 = new Xcls_ScrolledWindow42( _this );
1339 this.el.pack_start ( child_5.el , true,true,0 );
1342 // user defined functions
1344 public class Xcls_Label37 : Object
1346 public Gtk.Label el;
1347 private ValaProjectSettings _this;
1353 public Xcls_Label37(ValaProjectSettings _owner )
1356 this.el = new Gtk.Label( "target filename" );
1360 // set gobject values
1363 // user defined functions
1366 public class Xcls_build_pack_target : Object
1368 public Gtk.Entry el;
1369 private ValaProjectSettings _this;
1375 public Xcls_build_pack_target(ValaProjectSettings _owner )
1378 _this.build_pack_target = this;
1379 this.el = new Gtk.Entry();
1383 // set gobject values
1386 this.el.changed.connect( () => {
1387 if (_this.targets_tree.cursor.length < 1) {
1390 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1394 // user defined functions
1397 public class Xcls_Label39 : Object
1399 public Gtk.Label el;
1400 private ValaProjectSettings _this;
1406 public Xcls_Label39(ValaProjectSettings _owner )
1409 this.el = new Gtk.Label( "compile flags" );
1413 // set gobject values
1416 // user defined functions
1419 public class Xcls_build_compile_flags : Object
1421 public Gtk.Entry el;
1422 private ValaProjectSettings _this;
1428 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1431 _this.build_compile_flags = this;
1432 this.el = new Gtk.Entry();
1436 // set gobject values
1439 this.el.changed.connect( () => {
1440 if (_this.targets_tree.cursor.length < 1) {
1443 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1447 // user defined functions
1450 public class Xcls_Label41 : Object
1452 public Gtk.Label el;
1453 private ValaProjectSettings _this;
1459 public Xcls_Label41(ValaProjectSettings _owner )
1462 this.el = new Gtk.Label( "Files to compile" );
1466 // set gobject values
1469 // user defined functions
1472 public class Xcls_ScrolledWindow42 : Object
1474 public Gtk.ScrolledWindow el;
1475 private ValaProjectSettings _this;
1481 public Xcls_ScrolledWindow42(ValaProjectSettings _owner )
1484 this.el = new Gtk.ScrolledWindow( null, null );
1488 // set gobject values
1489 var child_0 = new Xcls_files_tree( _this );
1491 this.el.add ( child_0.el );
1494 // user defined functions
1496 public class Xcls_files_tree : Object
1498 public Gtk.TreeView el;
1499 private ValaProjectSettings _this;
1505 public Xcls_files_tree(ValaProjectSettings _owner )
1508 this.el = new Gtk.TreeView();
1512 // set gobject values
1513 var child_0 = new Xcls_files_tree_store( _this );
1515 this.el.set_model ( child_0.el );
1516 var child_1 = new Xcls_TreeViewColumn45( _this );
1518 this.el.append_column ( child_1.el );
1519 var child_2 = new Xcls_TreeViewColumn47( _this );
1521 this.el.append_column ( child_2.el );
1524 // user defined functions
1526 public class Xcls_files_tree_store : Object
1528 public Gtk.ListStore el;
1529 private ValaProjectSettings _this;
1535 public Xcls_files_tree_store(ValaProjectSettings _owner )
1538 _this.files_tree_store = this;
1539 this.el = new Gtk.ListStore( 4, typeof(string), // 0 file name
1540 typeof(string), // 0 basename
1541 typeof(string), // type (dir orfile)
1542 typeof(bool) // is checked.
1547 // set gobject values
1550 // user defined functions
1551 public void updateDir (string dname, bool bval) {
1555 var cg = _this.set_vbox.cgroup;
1556 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1557 this.el.iter_nth_child(out citer,null,i);
1560 this.el.get_value(citer,0, out val);
1561 var fn = (string) val;
1563 if ( Path.get_dirname (fn) == dname) {
1565 this.el.set_value(citer, 3, bval ); // checked
1571 if (cg.sources.contains(fn)) {
1572 cg.sources.remove(fn);
1575 if (!cg.sources.contains(fn)) {
1585 public void load () {
1590 var def = _this.project.compilegroups.get("_default_");
1591 var items = def.sources;
1599 for(var i =0 ; i < items.size; i++) {
1601 var files = _this.project.files(items.get(i));
1602 if (files.size < 1) {
1606 this.el.append(out citer);
1608 this.el.set_value(citer, 0, items.get(i) ); // title
1609 this.el.set_value(citer, 1, "<span foreground=\"green\" font_weight=\"bold\">" +
1610 GLib.Markup.escape_text(items.get(i)) + "</span>"
1612 print("ADD item %s", items.get(i));
1613 this.el.set_value(citer, 2, "dir"); // type
1614 this.el.set_value(citer, 3, false ); // checked
1618 for(var j =0 ; j < files.size; j++) {
1619 this.el.append(out citer);
1620 print("ADD item %s", files.get(j));
1621 this.el.set_value(citer, 0, files.get(j) ); // title
1622 this.el.set_value(citer, 1, GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title
1623 this.el.set_value(citer, 2, "file"); // type
1624 this.el.set_value(citer, 3, false ); // checked
1629 //this.el.set_value(citer, 1, items.get(i) );
1631 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1634 public void update () {
1639 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1640 this.el.iter_nth_child(out citer,null,i);
1643 this.el.get_value(citer,0, out val);
1644 var fn = (string) val;
1647 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1651 this.el.set_value(citer, 3, active ); // checked
1658 public class Xcls_TreeViewColumn45 : Object
1660 public Gtk.TreeViewColumn el;
1661 private ValaProjectSettings _this;
1667 public Xcls_TreeViewColumn45(ValaProjectSettings _owner )
1670 this.el = new Gtk.TreeViewColumn();
1674 // set gobject values
1675 this.el.title = "name";
1676 this.el.resizable = true;
1677 var child_0 = new Xcls_files_render( _this );
1679 this.el.pack_start ( child_0.el , false );
1683 this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1685 /* this.el.add_attribute(_this.files_render.el , "markup", 2 );
1689 // user defined functions
1691 public class Xcls_files_render : Object
1693 public Gtk.CellRendererText el;
1694 private ValaProjectSettings _this;
1700 public Xcls_files_render(ValaProjectSettings _owner )
1703 _this.files_render = this;
1704 this.el = new Gtk.CellRendererText();
1708 // set gobject values
1711 // user defined functions
1715 public class Xcls_TreeViewColumn47 : Object
1717 public Gtk.TreeViewColumn el;
1718 private ValaProjectSettings _this;
1724 public Xcls_TreeViewColumn47(ValaProjectSettings _owner )
1727 this.el = new Gtk.TreeViewColumn();
1731 // set gobject values
1732 this.el.title = "use";
1733 this.el.resizable = false;
1734 this.el.fixed_width = 50;
1735 var child_0 = new Xcls_files_render_use( _this );
1737 this.el.pack_start ( child_0.el , false );
1742 this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1746 // user defined functions
1748 public class Xcls_files_render_use : Object
1750 public Gtk.CellRendererToggle el;
1751 private ValaProjectSettings _this;
1757 public Xcls_files_render_use(ValaProjectSettings _owner )
1760 _this.files_render_use = this;
1761 this.el = new Gtk.CellRendererToggle();
1765 // set gobject values
1766 this.el.activatable = true;
1769 this.el.toggled.connect( ( path_string) => {
1773 var m = _this.files_tree_store.el;
1775 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1776 m.get_iter (out iter, path);
1778 m.get_value(iter, 3, out val);
1779 m.set_value(iter, 3, ((bool) val) ? false :true);
1783 m.get_value(iter, 2, out ftval);
1784 var ftype = (string)ftval;
1788 m.get_value(iter, 0, out fval);
1789 var fn = (string)fval;
1792 var cg = _this.set_vbox.cgroup;
1793 // what's the sleected target?
1794 // update the list..
1795 // if ftype is a dir == then toggle all the bellow.
1797 if (ftype == "dir") {
1798 _this.files_tree_store.updateDir(fn, ((bool) val) ? false :true);
1801 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1806 cg.sources.remove(fn);
1814 // user defined functions