1 static ValaProjectSettingsPopover _ValaProjectSettingsPopover;
3 public class ValaProjectSettingsPopover : Object
6 private ValaProjectSettingsPopover _this;
8 public static ValaProjectSettingsPopover singleton()
10 if (_ValaProjectSettingsPopover == null) {
11 _ValaProjectSettingsPopover= new ValaProjectSettingsPopover();
13 return _ValaProjectSettingsPopover;
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 default_packages_tree;
19 public Xcls_default_packages_tree_store default_packages_tree_store;
20 public Xcls_packages_render packages_render;
21 public Xcls_packages_render_use packages_render_use;
22 public Xcls_default_directory_tree default_directory_tree;
23 public Xcls_default_directory_tree_store default_directory_tree_store;
24 public Xcls_directory_render directory_render;
25 public Xcls_default_directory_menu default_directory_menu;
26 public Xcls_targets_tree_menu targets_tree_menu;
27 public Xcls_targets_tree targets_tree;
28 public Xcls_targets_tree_store targets_tree_store;
29 public Xcls_targets_render targets_render;
30 public Xcls_set_vbox set_vbox;
31 public Xcls_build_pack_target build_pack_target;
32 public Xcls_build_compile_flags build_compile_flags;
33 public Xcls_build_execute_args build_execute_args;
34 public Xcls_files_tree files_tree;
35 public Xcls_files_tree_store files_tree_store;
36 public Xcls_files_render files_render;
37 public Xcls_files_render_use files_render_use;
38 public Xcls_save_btn save_btn;
41 public Xcls_MainWindow window;
42 public Project.Gtk project;
46 public ValaProjectSettingsPopover()
49 this.el = new Gtk.Popover( null );
57 this.el.border_width = 0;
59 this.el.position = Gtk.PositionType.RIGHT;
60 var child_0 = new Xcls_Box2( _this );
62 this.el.add ( child_0.el );
65 this.el.closed.connect( ( ) => {
72 this.el.hide.connect( () => {
80 // user defined functions
81 public void show (Gtk.Widget btn, Project.Gtk project) {
83 //print("ValaProjectSettings show\n");
85 this.project= project;
87 this.compile_flags.el.text = _this.project.compilegroups.get("_default_").compile_flags;
89 this.default_directory_tree_store.load();
90 this.default_packages_tree_store.load();
91 this.targets_tree_store.load();
92 this.files_tree_store.load();
95 this.el.set_modal(true);
96 this.el.set_relative_to(btn);
98 this.el.set_position(Gtk.PositionType.RIGHT);
101 // print("SHOWALL - POPIP\n");
102 this.el.set_size_request(800,500);
104 //this.view.el.grab_focus();
107 public void save () {
108 this.project.writeConfig();
110 public class Xcls_Box2 : Object
113 private ValaProjectSettingsPopover _this;
119 public Xcls_Box2(ValaProjectSettingsPopover _owner )
122 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
126 // set gobject values
127 this.el.hexpand = true;
128 this.el.vexpand = true;
129 var child_0 = new Xcls_HeaderBar3( _this );
131 this.el.add ( child_0.el );
132 var child_1 = new Xcls_Notebook4( _this );
134 this.el.pack_start ( child_1.el , true,true,0 );
135 var child_2 = new Xcls_ButtonBox53( _this );
137 this.el.add ( child_2.el );
140 // user defined functions
142 public class Xcls_HeaderBar3 : Object
144 public Gtk.HeaderBar el;
145 private ValaProjectSettingsPopover _this;
151 public Xcls_HeaderBar3(ValaProjectSettingsPopover _owner )
154 this.el = new Gtk.HeaderBar();
158 // set gobject values
159 this.el.title = "Change Vala Project Compile settings";
162 // user defined functions
165 public class Xcls_Notebook4 : Object
167 public Gtk.Notebook el;
168 private ValaProjectSettingsPopover _this;
174 public Xcls_Notebook4(ValaProjectSettingsPopover _owner )
177 this.el = new Gtk.Notebook();
181 // set gobject values
182 var child_0 = new Xcls_label_global( _this );
184 var child_1 = new Xcls_label_targets( _this );
186 var child_2 = new Xcls_Box7( _this );
188 this.el.append_page ( child_2.el , _this.label_global.el );
189 var child_3 = new Xcls_Paned28( _this );
191 this.el.append_page ( child_3.el , _this.label_targets.el );
194 // user defined functions
196 public class Xcls_label_global : Object
199 private ValaProjectSettingsPopover _this;
205 public Xcls_label_global(ValaProjectSettingsPopover _owner )
208 _this.label_global = this;
209 this.el = new Gtk.Label( "Global" );
213 // set gobject values
216 // user defined functions
219 public class Xcls_label_targets : Object
222 private ValaProjectSettingsPopover _this;
228 public Xcls_label_targets(ValaProjectSettingsPopover _owner )
231 _this.label_targets = this;
232 this.el = new Gtk.Label( "Targets" );
236 // set gobject values
239 // user defined functions
242 public class Xcls_Box7 : Object
245 private ValaProjectSettingsPopover _this;
251 public Xcls_Box7(ValaProjectSettingsPopover _owner )
254 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
258 // set gobject values
259 this.el.homogeneous = false;
260 var child_0 = new Xcls_Label8( _this );
262 this.el.pack_start ( child_0.el , false,false,0 );
263 var child_1 = new Xcls_compile_flags( _this );
265 this.el.pack_start ( child_1.el , false,false,0 );
266 var child_2 = new Xcls_Paned10( _this );
268 this.el.pack_start ( child_2.el , true,true,0 );
271 // user defined functions
273 public class Xcls_Label8 : Object
276 private ValaProjectSettingsPopover _this;
282 public Xcls_Label8(ValaProjectSettingsPopover _owner )
285 this.el = new Gtk.Label( "compile flags" );
289 // set gobject values
292 // user defined functions
295 public class Xcls_compile_flags : Object
298 private ValaProjectSettingsPopover _this;
304 public Xcls_compile_flags(ValaProjectSettingsPopover _owner )
307 _this.compile_flags = this;
308 this.el = new Gtk.Entry();
312 // set gobject values
313 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
316 this.el.changed.connect( () => {
318 _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
319 _this.project.writeConfig();
320 // _this.project.save();
325 // user defined functions
328 public class Xcls_Paned10 : Object
331 private ValaProjectSettingsPopover _this;
337 public Xcls_Paned10(ValaProjectSettingsPopover _owner )
340 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
344 // set gobject values
345 this.el.position = 300;
346 var child_0 = new Xcls_ScrolledWindow11( _this );
348 this.el.add ( child_0.el );
349 var child_1 = new Xcls_ScrolledWindow18( _this );
351 this.el.add2 ( child_1.el );
354 // user defined functions
356 public class Xcls_ScrolledWindow11 : Object
358 public Gtk.ScrolledWindow el;
359 private ValaProjectSettingsPopover _this;
365 public Xcls_ScrolledWindow11(ValaProjectSettingsPopover _owner )
368 this.el = new Gtk.ScrolledWindow( null, null );
372 // set gobject values
373 this.el.hexpand = true;
374 var child_0 = new Xcls_default_packages_tree( _this );
376 this.el.add ( child_0.el );
379 // user defined functions
381 public class Xcls_default_packages_tree : Object
383 public Gtk.TreeView el;
384 private ValaProjectSettingsPopover _this;
390 public Xcls_default_packages_tree(ValaProjectSettingsPopover _owner )
393 _this.default_packages_tree = this;
394 this.el = new Gtk.TreeView();
398 // set gobject values
399 this.el.headers_visible = true;
400 var child_0 = new Xcls_default_packages_tree_store( _this );
402 this.el.set_model ( child_0.el );
403 var child_1 = new Xcls_TreeViewColumn14( _this );
405 this.el.append_column ( child_1.el );
406 var child_2 = new Xcls_TreeViewColumn16( _this );
408 this.el.append_column ( child_2.el );
411 // user defined functions
413 public class Xcls_default_packages_tree_store : Object
415 public Gtk.ListStore el;
416 private ValaProjectSettingsPopover _this;
422 public Xcls_default_packages_tree_store(ValaProjectSettingsPopover _owner )
425 _this.default_packages_tree_store = this;
426 this.el = new Gtk.ListStore.newv( { typeof(string), // 0 key type
431 // set gobject values
434 // user defined functions
435 public void load () {
437 var def = _this.project.compilegroups.get("_default_");
438 var items = def.packages;
441 var pal = (Palete.Gtk) _this.project.palete;
442 var pkgs = pal.packages(_this.project);
443 GLib.debug("ValaProjectSettings:packages load %d\n", pkgs.size);
447 for(var i =0 ; i < pkgs.size; i++) {
448 this.el.append(out citer);
450 this.el.set_value(citer, 0, pkgs.get(i) ); // title
451 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
453 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
458 public class Xcls_TreeViewColumn14 : Object
460 public Gtk.TreeViewColumn el;
461 private ValaProjectSettingsPopover _this;
467 public Xcls_TreeViewColumn14(ValaProjectSettingsPopover _owner )
470 this.el = new Gtk.TreeViewColumn();
474 // set gobject values
475 this.el.title = "package name";
476 this.el.expand = true;
477 this.el.resizable = true;
478 var child_0 = new Xcls_packages_render( _this );
480 this.el.pack_start ( child_0.el , false );
484 this.el.add_attribute(_this.packages_render.el , "text", 0 );
487 // user defined functions
489 public class Xcls_packages_render : Object
491 public Gtk.CellRendererText el;
492 private ValaProjectSettingsPopover _this;
498 public Xcls_packages_render(ValaProjectSettingsPopover _owner )
501 _this.packages_render = this;
502 this.el = new Gtk.CellRendererText();
506 // set gobject values
509 // user defined functions
513 public class Xcls_TreeViewColumn16 : Object
515 public Gtk.TreeViewColumn el;
516 private ValaProjectSettingsPopover _this;
522 public Xcls_TreeViewColumn16(ValaProjectSettingsPopover _owner )
525 this.el = new Gtk.TreeViewColumn();
529 // set gobject values
530 this.el.title = "use";
531 this.el.resizable = false;
532 this.el.fixed_width = 50;
533 var child_0 = new Xcls_packages_render_use( _this );
535 this.el.pack_start ( child_0.el , false );
540 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
544 // user defined functions
546 public class Xcls_packages_render_use : Object
548 public Gtk.CellRendererToggle el;
549 private ValaProjectSettingsPopover _this;
555 public Xcls_packages_render_use(ValaProjectSettingsPopover _owner )
558 _this.packages_render_use = this;
559 this.el = new Gtk.CellRendererToggle();
563 // set gobject values
564 this.el.activatable = true;
567 this.el.toggled.connect( ( path_string) => {
568 var m = _this.default_packages_tree_store.el;
570 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
571 m.get_iter (out iter, path);
573 m.get_value(iter, 1, out val);
574 m.set_value(iter, 1, ((bool) val) ? false :true);
576 m.get_value(iter, 0, out fval);
577 var fn = (string)fval;
579 var def = _this.project.compilegroups.get("_default_");
580 var items = def.packages;
591 // user defined functions
597 public class Xcls_ScrolledWindow18 : Object
599 public Gtk.ScrolledWindow el;
600 private ValaProjectSettingsPopover _this;
606 public Xcls_ScrolledWindow18(ValaProjectSettingsPopover _owner )
609 this.el = new Gtk.ScrolledWindow( null, null );
613 // set gobject values
614 this.el.hexpand = true;
615 var child_0 = new Xcls_default_directory_tree( _this );
617 this.el.add ( child_0.el );
618 var child_1 = new Xcls_default_directory_menu( _this );
620 this.el.add( child_1.el );
623 // user defined functions
625 public class Xcls_default_directory_tree : Object
627 public Gtk.TreeView el;
628 private ValaProjectSettingsPopover _this;
634 public Xcls_default_directory_tree(ValaProjectSettingsPopover _owner )
637 _this.default_directory_tree = this;
638 this.el = new Gtk.TreeView();
642 // set gobject values
643 this.el.headers_visible = true;
644 var child_0 = new Xcls_default_directory_tree_store( _this );
646 this.el.set_model ( child_0.el );
647 var child_1 = new Xcls_TreeViewColumn21( _this );
649 this.el.append_column ( child_1.el );
652 this.el.button_press_event.connect( ( ev) => {
653 //console.log("button press?");
656 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
657 //print("click" + ev.type);
661 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
665 // this.el.get_selection().select_path(res);
667 //if (!this.get('/LeftTreeMenu').el) {
668 // this.get('/LeftTreeMenu').init();
671 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
672 _this.default_directory_menu.el.show_all();
673 _this.default_directory_menu.el.popup_at_pointer(ev);
674 // print("click:" + res.path.to_string());
679 // user defined functions
681 public class Xcls_default_directory_tree_store : Object
683 public Gtk.ListStore el;
684 private ValaProjectSettingsPopover _this;
690 public Xcls_default_directory_tree_store(ValaProjectSettingsPopover _owner )
693 _this.default_directory_tree_store = this;
694 this.el = new Gtk.ListStore.newv( { typeof(string)
699 // set gobject values
702 // user defined functions
703 public void load () {
708 var def = _this.project.compilegroups.get("_default_");
709 var items = def.sources;
714 for(var i =0 ; i < items.size; i++) {
715 this.el.append(out citer);
717 this.el.set_value(citer, 0, items.get(i) ); // title
718 //this.el.set_value(citer, 1, items.get(i) );
720 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
725 public class Xcls_TreeViewColumn21 : Object
727 public Gtk.TreeViewColumn el;
728 private ValaProjectSettingsPopover _this;
734 public Xcls_TreeViewColumn21(ValaProjectSettingsPopover _owner )
737 this.el = new Gtk.TreeViewColumn();
741 // set gobject values
742 this.el.title = "Available Directories (right click to add)";
743 this.el.resizable = true;
744 var child_0 = new Xcls_directory_render( _this );
746 this.el.pack_start ( child_0.el , false );
750 this.el.add_attribute(_this.directory_render.el , "text", 0 );
753 // user defined functions
755 public class Xcls_directory_render : Object
757 public Gtk.CellRendererText el;
758 private ValaProjectSettingsPopover _this;
764 public Xcls_directory_render(ValaProjectSettingsPopover _owner )
767 _this.directory_render = this;
768 this.el = new Gtk.CellRendererText();
772 // set gobject values
775 // user defined functions
780 public class Xcls_default_directory_menu : Object
783 private ValaProjectSettingsPopover _this;
789 public Xcls_default_directory_menu(ValaProjectSettingsPopover _owner )
792 _this.default_directory_menu = this;
793 this.el = new Gtk.Menu();
797 // set gobject values
798 var child_0 = new Xcls_MenuItem24( _this );
800 this.el.add ( child_0.el );
801 var child_1 = new Xcls_MenuItem25( _this );
803 this.el.add ( child_1.el );
804 var child_2 = new Xcls_SeparatorMenuItem26( _this );
806 this.el.add ( child_2.el );
807 var child_3 = new Xcls_MenuItem27( _this );
809 this.el.add ( child_3.el );
812 // user defined functions
814 public class Xcls_MenuItem24 : Object
816 public Gtk.MenuItem el;
817 private ValaProjectSettingsPopover _this;
823 public Xcls_MenuItem24(ValaProjectSettingsPopover _owner )
826 this.el = new Gtk.MenuItem();
830 // set gobject values
831 this.el.label = "Add Directory";
835 this.el.activate.connect( () => {
837 var chooser = new Gtk.FileChooserDialog (
838 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
840 Gtk.ResponseType.CANCEL,
842 Gtk.ResponseType.ACCEPT);
843 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
848 // add the directory..
849 var fn = _this.project.relPath(chooser.get_filename());
850 _this.project.compilegroups.get("_default_").sources.add(fn);
851 _this.default_directory_tree_store.load();
855 // user defined functions
858 public class Xcls_MenuItem25 : Object
860 public Gtk.MenuItem el;
861 private ValaProjectSettingsPopover _this;
867 public Xcls_MenuItem25(ValaProjectSettingsPopover _owner )
870 this.el = new Gtk.MenuItem();
874 // set gobject values
875 this.el.label = "Add File";
879 this.el.activate.connect( () => {
881 var chooser = new Gtk.FileChooserDialog (
882 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
884 Gtk.ResponseType.CANCEL,
886 Gtk.ResponseType.ACCEPT);
887 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
892 // add the directory..
893 var fn = _this.project.relPath(chooser.get_filename());
894 _this.project.compilegroups.get("_default_").sources.add(fn);
895 _this.default_directory_tree_store.load();
899 // user defined functions
902 public class Xcls_SeparatorMenuItem26 : Object
904 public Gtk.SeparatorMenuItem el;
905 private ValaProjectSettingsPopover _this;
911 public Xcls_SeparatorMenuItem26(ValaProjectSettingsPopover _owner )
914 this.el = new Gtk.SeparatorMenuItem();
918 // set gobject values
922 // user defined functions
925 public class Xcls_MenuItem27 : Object
927 public Gtk.MenuItem el;
928 private ValaProjectSettingsPopover _this;
934 public Xcls_MenuItem27(ValaProjectSettingsPopover _owner )
937 this.el = new Gtk.MenuItem();
941 // set gobject values
942 this.el.label = "Remove File/Directory";
946 this.el.activate.connect( () => {
951 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
952 GLib.debug("nothing selected\n");
957 // add the directory..
961 mod.get_value(iter,0, out val);
962 var fn = (string) val;
964 GLib.debug("remove: %s\n", fn);
965 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
966 GLib.debug("remove failed");
968 _this.default_directory_tree_store.load();
972 // user defined functions
979 public class Xcls_Paned28 : Object
982 private ValaProjectSettingsPopover _this;
988 public Xcls_Paned28(ValaProjectSettingsPopover _owner )
991 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
995 // set gobject values
996 this.el.position = 300;
997 var child_0 = new Xcls_ScrolledWindow29( _this );
999 this.el.add1 ( child_0.el );
1000 var child_1 = new Xcls_set_vbox( _this );
1002 this.el.add2 ( child_1.el );
1005 // user defined functions
1007 public class Xcls_ScrolledWindow29 : Object
1009 public Gtk.ScrolledWindow el;
1010 private ValaProjectSettingsPopover _this;
1016 public Xcls_ScrolledWindow29(ValaProjectSettingsPopover _owner )
1019 this.el = new Gtk.ScrolledWindow( null, null );
1023 // set gobject values
1024 var child_0 = new Xcls_targets_tree_menu( _this );
1026 this.el.add ( child_0.el );
1027 var child_1 = new Xcls_targets_tree( _this );
1029 this.el.add ( child_1.el );
1034 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1039 // user defined functions
1041 public class Xcls_targets_tree_menu : Object
1044 private ValaProjectSettingsPopover _this;
1050 public Xcls_targets_tree_menu(ValaProjectSettingsPopover _owner )
1053 _this.targets_tree_menu = this;
1054 this.el = new Gtk.Menu();
1058 // set gobject values
1059 var child_0 = new Xcls_MenuItem31( _this );
1061 this.el.add ( child_0.el );
1062 var child_1 = new Xcls_SeparatorMenuItem32( _this );
1064 this.el.add ( child_1.el );
1065 var child_2 = new Xcls_MenuItem33( _this );
1067 this.el.add ( child_2.el );
1070 // user defined functions
1072 public class Xcls_MenuItem31 : Object
1074 public Gtk.MenuItem el;
1075 private ValaProjectSettingsPopover _this;
1081 public Xcls_MenuItem31(ValaProjectSettingsPopover _owner )
1084 this.el = new Gtk.MenuItem();
1088 // set gobject values
1089 this.el.label = "Add Compile Target";
1093 this.el.activate.connect( () => {
1095 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1099 // add the directory..
1101 _this.project.compilegroups.set("NEW GROUP", new Project.GtkValaSettings("NEW GROUP"));
1102 _this.targets_tree_store.load();
1106 // user defined functions
1109 public class Xcls_SeparatorMenuItem32 : Object
1111 public Gtk.SeparatorMenuItem el;
1112 private ValaProjectSettingsPopover _this;
1118 public Xcls_SeparatorMenuItem32(ValaProjectSettingsPopover _owner )
1121 this.el = new Gtk.SeparatorMenuItem();
1125 // set gobject values
1129 // user defined functions
1132 public class Xcls_MenuItem33 : Object
1134 public Gtk.MenuItem el;
1135 private ValaProjectSettingsPopover _this;
1141 public Xcls_MenuItem33(ValaProjectSettingsPopover _owner )
1144 this.el = new Gtk.MenuItem();
1148 // set gobject values
1149 this.el.label = "Remove Target";
1153 this.el.activate.connect( () => {
1158 if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
1159 GLib.debug("nothing selected\n");
1164 // add the directory..
1168 mod.get_value(iter,0, out val);
1169 var fn = (string) val;
1171 GLib.debug("remove: %s\n", fn);
1172 if (!_this.project.compilegroups.unset(fn)) {
1173 GLib.debug("remove failed");
1175 _this.targets_tree_store.load();
1179 // user defined functions
1183 public class Xcls_targets_tree : Object
1185 public Gtk.TreeView el;
1186 private ValaProjectSettingsPopover _this;
1190 public string cursor;
1193 public Xcls_targets_tree(ValaProjectSettingsPopover _owner )
1196 _this.targets_tree = this;
1197 this.el = new Gtk.TreeView();
1201 // set gobject values
1202 var child_0 = new Xcls_targets_tree_store( _this );
1204 this.el.set_model ( child_0.el );
1205 var child_1 = new Xcls_TreeViewColumn36( _this );
1207 this.el.append_column ( child_1.el );
1210 this.el.button_press_event.connect( ( ev) => {
1211 //console.log("button press?");
1214 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
1215 //print("click" + ev.type);
1219 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
1223 // this.el.get_selection().select_path(res);
1225 //if (!this.get('/LeftTreeMenu').el) {
1226 // this.get('/LeftTreeMenu').init();
1229 _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());
1230 _this.targets_tree_menu.el.show_all();
1231 _this.targets_tree_menu.el.popup_at_pointer(ev);
1232 // print("click:" + res.path.to_string());
1235 this.el.cursor_changed.connect( ( ) => {
1237 if (this.cursor != "") {
1238 // save the values..
1241 // load the new values.
1246 if (!this.el.get_selection().get_selected(out mod, out iter)) {
1247 GLib.debug("nothing selected\n");
1248 // should disable the right hand side..
1249 _this.set_vbox.el.hide();
1252 _this.set_vbox.el.show();
1254 // add the directory..
1258 mod.get_value(iter,0, out val);
1259 var fn = (string) val;
1262 var cg = _this.project.compilegroups.get(fn);
1264 _this.build_pack_target.el.set_text(cg.target_bin);
1265 _this.build_compile_flags.el.set_text(cg.compile_flags);
1266 _this.build_execute_args.el.set_text(cg.execute_args);
1268 _this.set_vbox.cgroup = cg;
1269 _this.files_tree_store.update();
1277 // user defined functions
1279 public class Xcls_targets_tree_store : Object
1281 public Gtk.ListStore el;
1282 private ValaProjectSettingsPopover _this;
1288 public Xcls_targets_tree_store(ValaProjectSettingsPopover _owner )
1291 _this.targets_tree_store = this;
1292 this.el = new Gtk.ListStore.newv( { typeof(string), // 0 key type
1293 typeof(string) // ??
1298 // set gobject values
1301 // user defined functions
1302 public void load () {
1307 var cg = _this.project.compilegroups;
1309 _this.targets_tree.cursor = "";
1311 var iter = cg.map_iterator();
1312 while(iter.next()) {
1313 var key = iter.get_key();
1314 if (key == "_default_") {
1318 this.el.append(out citer);
1320 this.el.set_value(citer, 0, key ); // title
1321 //this.el.set_value(citer, 1, items.get(i) );
1323 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1324 _this.set_vbox.el.hide();
1328 public class Xcls_TreeViewColumn36 : Object
1330 public Gtk.TreeViewColumn el;
1331 private ValaProjectSettingsPopover _this;
1337 public Xcls_TreeViewColumn36(ValaProjectSettingsPopover _owner )
1340 this.el = new Gtk.TreeViewColumn();
1344 // set gobject values
1345 this.el.title = "name";
1346 this.el.resizable = true;
1347 var child_0 = new Xcls_targets_render( _this );
1349 this.el.pack_start ( child_0.el , false );
1354 this.el.add_attribute(_this.targets_render.el , "text", 0 );
1358 // user defined functions
1360 public class Xcls_targets_render : Object
1362 public Gtk.CellRendererText el;
1363 private ValaProjectSettingsPopover _this;
1369 public Xcls_targets_render(ValaProjectSettingsPopover _owner )
1372 _this.targets_render = this;
1373 this.el = new Gtk.CellRendererText();
1377 // set gobject values
1378 this.el.editable = true;
1381 this.el.edited.connect( (path, newtext) => {
1384 _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));
1386 _this.targets_tree_store.el.get_value(iter,0, out gval);
1387 var oldval = (string)gval;
1388 if (oldval == newtext) {
1391 var cg = _this.project.compilegroups.get(oldval);
1393 _this.project.compilegroups.unset(oldval);
1394 _this.project.compilegroups.set(newtext, cg);
1395 _this.targets_tree_store.load();
1399 // user defined functions
1405 public class Xcls_set_vbox : Object
1408 private ValaProjectSettingsPopover _this;
1412 public Project.GtkValaSettings cgroup;
1415 public Xcls_set_vbox(ValaProjectSettingsPopover _owner )
1418 _this.set_vbox = this;
1419 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1424 // set gobject values
1425 this.el.homogeneous = false;
1426 var child_0 = new Xcls_Label39( _this );
1428 this.el.pack_start ( child_0.el , false,false,0 );
1429 var child_1 = new Xcls_build_pack_target( _this );
1431 this.el.pack_start ( child_1.el , false,false,0 );
1432 var child_2 = new Xcls_Label41( _this );
1434 this.el.pack_start ( child_2.el , false,false,0 );
1435 var child_3 = new Xcls_build_compile_flags( _this );
1437 this.el.pack_start ( child_3.el , false,false,0 );
1438 var child_4 = new Xcls_Label43( _this );
1440 this.el.pack_start ( child_4.el , false,false,0 );
1441 var child_5 = new Xcls_build_execute_args( _this );
1443 this.el.pack_start ( child_5.el , false,false,0 );
1444 var child_6 = new Xcls_Label45( _this );
1446 this.el.pack_start ( child_6.el , false,false,0 );
1447 var child_7 = new Xcls_ScrolledWindow46( _this );
1449 this.el.pack_start ( child_7.el , true,true,0 );
1452 // user defined functions
1454 public class Xcls_Label39 : Object
1456 public Gtk.Label el;
1457 private ValaProjectSettingsPopover _this;
1463 public Xcls_Label39(ValaProjectSettingsPopover _owner )
1466 this.el = new Gtk.Label( "target filename" );
1470 // set gobject values
1473 // user defined functions
1476 public class Xcls_build_pack_target : Object
1478 public Gtk.Entry el;
1479 private ValaProjectSettingsPopover _this;
1485 public Xcls_build_pack_target(ValaProjectSettingsPopover _owner )
1488 _this.build_pack_target = this;
1489 this.el = new Gtk.Entry();
1493 // set gobject values
1496 this.el.changed.connect( () => {
1497 if (_this.targets_tree.cursor.length < 1) {
1500 _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;
1504 // user defined functions
1507 public class Xcls_Label41 : Object
1509 public Gtk.Label el;
1510 private ValaProjectSettingsPopover _this;
1516 public Xcls_Label41(ValaProjectSettingsPopover _owner )
1519 this.el = new Gtk.Label( "compile flags" );
1523 // set gobject values
1526 // user defined functions
1529 public class Xcls_build_compile_flags : Object
1531 public Gtk.Entry el;
1532 private ValaProjectSettingsPopover _this;
1538 public Xcls_build_compile_flags(ValaProjectSettingsPopover _owner )
1541 _this.build_compile_flags = this;
1542 this.el = new Gtk.Entry();
1546 // set gobject values
1549 this.el.changed.connect( () => {
1550 if (_this.targets_tree.cursor.length < 1) {
1553 _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
1557 // user defined functions
1560 public class Xcls_Label43 : Object
1562 public Gtk.Label el;
1563 private ValaProjectSettingsPopover _this;
1569 public Xcls_Label43(ValaProjectSettingsPopover _owner )
1572 this.el = new Gtk.Label( "test argments - when run after a build" );
1576 // set gobject values
1579 // user defined functions
1582 public class Xcls_build_execute_args : Object
1584 public Gtk.Entry el;
1585 private ValaProjectSettingsPopover _this;
1591 public Xcls_build_execute_args(ValaProjectSettingsPopover _owner )
1594 _this.build_execute_args = this;
1595 this.el = new Gtk.Entry();
1599 // set gobject values
1600 this.el.placeholder_text = "eg. -f somefile -g ";
1603 this.el.changed.connect( () => {
1604 if (_this.targets_tree.cursor.length < 1) {
1607 _this.project.compilegroups.get(_this.targets_tree.cursor).execute_args = this.el.text;
1611 // user defined functions
1614 public class Xcls_Label45 : Object
1616 public Gtk.Label el;
1617 private ValaProjectSettingsPopover _this;
1623 public Xcls_Label45(ValaProjectSettingsPopover _owner )
1626 this.el = new Gtk.Label( "Files to compile" );
1630 // set gobject values
1633 // user defined functions
1636 public class Xcls_ScrolledWindow46 : Object
1638 public Gtk.ScrolledWindow el;
1639 private ValaProjectSettingsPopover _this;
1645 public Xcls_ScrolledWindow46(ValaProjectSettingsPopover _owner )
1648 this.el = new Gtk.ScrolledWindow( null, null );
1652 // set gobject values
1653 var child_0 = new Xcls_files_tree( _this );
1655 this.el.add ( child_0.el );
1658 // user defined functions
1660 public class Xcls_files_tree : Object
1662 public Gtk.TreeView el;
1663 private ValaProjectSettingsPopover _this;
1669 public Xcls_files_tree(ValaProjectSettingsPopover _owner )
1672 _this.files_tree = this;
1673 this.el = new Gtk.TreeView();
1677 // set gobject values
1678 var child_0 = new Xcls_files_tree_store( _this );
1680 this.el.set_model ( child_0.el );
1681 var child_1 = new Xcls_TreeViewColumn49( _this );
1683 this.el.append_column ( child_1.el );
1684 var child_2 = new Xcls_TreeViewColumn51( _this );
1686 this.el.append_column ( child_2.el );
1689 // user defined functions
1691 public class Xcls_files_tree_store : Object
1693 public Gtk.ListStore el;
1694 private ValaProjectSettingsPopover _this;
1700 public Xcls_files_tree_store(ValaProjectSettingsPopover _owner )
1703 _this.files_tree_store = this;
1704 this.el = new Gtk.ListStore.newv( { typeof(string), // 0 file name
1705 typeof(string), // 0 basename
1706 typeof(string), // type (dir orfile)
1707 typeof(bool) // is checked.
1712 // set gobject values
1715 // user defined functions
1716 public void update () {
1721 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1722 this.el.iter_nth_child(out citer,null,i);
1725 this.el.get_value(citer,0, out val);
1726 var fn = (string) val;
1729 if (_this.set_vbox.cgroup.sources.contains(fn)) {
1733 this.el.set_value(citer, 3, active ); // checked
1736 _this.set_vbox.el.set_sensitive(true);
1738 public void updateDir (string dname, bool bval) {
1742 var cg = _this.set_vbox.cgroup;
1743 for(var i =0 ; i < this.el.iter_n_children(null); i++) {
1744 this.el.iter_nth_child(out citer,null,i);
1747 this.el.get_value(citer,0, out val);
1748 var fn = (string) val;
1750 if ( Path.get_dirname (fn) == dname) {
1752 this.el.set_value(citer, 3, bval ); // checked
1758 if (cg.sources.contains(fn)) {
1759 cg.sources.remove(fn);
1762 if (!cg.sources.contains(fn)) {
1772 public void load () {
1777 var def = _this.project.compilegroups.get("_default_");
1778 var items = def.sources;
1786 for(var i =0 ; i < items.size; i++) {
1788 var files = _this.project.filesForCompile(items.get(i), false);
1789 if (files.size < 1) {
1793 this.el.append(out citer);
1795 this.el.set_value(citer, 0, items.get(i) ); // title
1796 this.el.set_value(citer, 1, "<span foreground=\"green\" font_weight=\"bold\">" +
1797 GLib.Markup.escape_text(items.get(i)) + "</span>"
1799 GLib.debug("ADD item %s", items.get(i));
1800 this.el.set_value(citer, 2, "dir"); // type
1801 this.el.set_value(citer, 3, false ); // checked
1805 for(var j =0 ; j < files.size; j++) {
1806 this.el.append(out citer);
1807 GLib.debug("ADD item %s", files.get(j));
1808 this.el.set_value(citer, 0, files.get(j) ); // title
1809 this.el.set_value(citer, 1, GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title
1810 this.el.set_value(citer, 2, "file"); // type
1811 this.el.set_value(citer, 3, false ); // checked
1816 //this.el.set_value(citer, 1, items.get(i) );
1818 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
1819 if (_this.set_vbox.cgroup == null) {
1820 _this.set_vbox.el.set_sensitive(false);
1826 public class Xcls_TreeViewColumn49 : Object
1828 public Gtk.TreeViewColumn el;
1829 private ValaProjectSettingsPopover _this;
1835 public Xcls_TreeViewColumn49(ValaProjectSettingsPopover _owner )
1838 this.el = new Gtk.TreeViewColumn();
1842 // set gobject values
1843 this.el.title = "name";
1844 this.el.resizable = true;
1845 var child_0 = new Xcls_files_render( _this );
1847 this.el.pack_start ( child_0.el , false );
1851 this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
1853 /* this.el.add_attribute(_this.files_render.el , "markup", 2 );
1857 // user defined functions
1859 public class Xcls_files_render : Object
1861 public Gtk.CellRendererText el;
1862 private ValaProjectSettingsPopover _this;
1868 public Xcls_files_render(ValaProjectSettingsPopover _owner )
1871 _this.files_render = this;
1872 this.el = new Gtk.CellRendererText();
1876 // set gobject values
1879 // user defined functions
1883 public class Xcls_TreeViewColumn51 : Object
1885 public Gtk.TreeViewColumn el;
1886 private ValaProjectSettingsPopover _this;
1892 public Xcls_TreeViewColumn51(ValaProjectSettingsPopover _owner )
1895 this.el = new Gtk.TreeViewColumn();
1899 // set gobject values
1900 this.el.title = "use";
1901 this.el.resizable = false;
1902 this.el.fixed_width = 50;
1903 var child_0 = new Xcls_files_render_use( _this );
1905 this.el.pack_start ( child_0.el , false );
1910 this.el.add_attribute(_this.files_render_use.el , "active", 3 );
1914 // user defined functions
1916 public class Xcls_files_render_use : Object
1918 public Gtk.CellRendererToggle el;
1919 private ValaProjectSettingsPopover _this;
1925 public Xcls_files_render_use(ValaProjectSettingsPopover _owner )
1928 _this.files_render_use = this;
1929 this.el = new Gtk.CellRendererToggle();
1933 // set gobject values
1934 this.el.activatable = true;
1937 this.el.toggled.connect( ( path_string) => {
1941 var m = _this.files_tree_store.el;
1943 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
1944 m.get_iter (out iter, path);
1946 m.get_value(iter, 3, out val);
1947 m.set_value(iter, 3, ((bool) val) ? false :true);
1951 m.get_value(iter, 2, out ftval);
1952 var ftype = (string)ftval;
1956 m.get_value(iter, 0, out fval);
1957 var fn = (string)fval;
1960 var cg = _this.set_vbox.cgroup;
1961 // what's the sleected target?
1962 // update the list..
1963 // if ftype is a dir == then toggle all the bellow.
1965 if (ftype == "dir") {
1966 _this.files_tree_store.updateDir(fn, ((bool) val) ? false :true);
1969 // if ftype is a file .. see if all the files in that directory are check and check the dir.
1974 cg.sources.remove(fn);
1982 // user defined functions
1991 public class Xcls_ButtonBox53 : Object
1993 public Gtk.ButtonBox el;
1994 private ValaProjectSettingsPopover _this;
2000 public Xcls_ButtonBox53(ValaProjectSettingsPopover _owner )
2003 this.el = new Gtk.ButtonBox( Gtk.Orientation.HORIZONTAL );
2007 // set gobject values
2008 this.el.margin_end = 4;
2009 this.el.margin_start = 4;
2010 this.el.margin_bottom = 4;
2011 this.el.margin_top = 4;
2012 var child_0 = new Xcls_Button54( _this );
2014 this.el.add ( child_0.el );
2015 var child_1 = new Xcls_save_btn( _this );
2017 this.el.add ( child_1.el );
2020 // user defined functions
2022 public class Xcls_Button54 : Object
2024 public Gtk.Button el;
2025 private ValaProjectSettingsPopover _this;
2031 public Xcls_Button54(ValaProjectSettingsPopover _owner )
2034 this.el = new Gtk.Button();
2038 // set gobject values
2039 this.el.label = "Cancel";
2042 this.el.clicked.connect( () => {
2049 // user defined functions
2052 public class Xcls_save_btn : Object
2054 public Gtk.Button el;
2055 private ValaProjectSettingsPopover _this;
2061 public Xcls_save_btn(ValaProjectSettingsPopover _owner )
2064 _this.save_btn = this;
2065 this.el = new Gtk.Button();
2069 // set gobject values
2070 this.el.label = "Save";
2073 this.el.clicked.connect( ( ) => {
2076 _this.project.writeConfig();
2082 // hopefull this will work with bjs files..
2089 // user defined functions