2 "build_module" : "builder",
3 "gen_extended" : false,
6 "$ Project.Callback doneObj" : "null",
8 "Project.Gtk project" : "null",
9 "Project.GtkValaSettings? selected_target" : "null",
10 "Xcls_MainWindow window" : "null",
16 "* prop" : "titlebar",
17 "* title" : "Edit Project Details",
21 "* prop" : "title_widget",
22 "string label" : "Change Vala Compile settings",
27 "* pack" : "pack_end",
28 "string icon_name" : "",
29 "string label" : "Create / Recreate Build files (configure.ac / makefile.am etc)",
37 "* pack" : "set_child",
38 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
39 "bool hexpand" : true,
40 "bool vexpand" : true,
44 "bool vexpand" : true,
50 "id" : "label_global",
51 "utf8 label" : "Global",
57 "id" : "label_targets",
58 "utf8 label" : "Targets",
63 "* pack" : "append_page,_this.label_global.el",
64 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
65 "gboolean homogeneous" : false,
69 "Gtk.Align halign" : "Gtk.Align.START",
70 "bool hexpand" : true,
71 "utf8 label" : "compile flags",
76 "id" : "compile_flags",
81 " _this.project.compile_flags = this.el.buffer.text;",
82 " _this.project.save();",
83 "// _this.project.save();",
88 "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR ",
93 "Gtk.PolicyType hscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
94 "Gtk.PolicyType vscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
95 "bool has_frame" : true,
96 "bool hexpand" : true,
97 "bool vexpand" : true,
119 "GLib.Type item_type" : "typeof(Project.VapiSelection)",
121 "xtype" : "ListStore"
129 "* prop" : "expression",
130 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
131 "string property_name" : "sortkey",
132 "xtype" : "PropertyExpression"
135 "xtype" : "StringSorter"
138 "xtype" : "SortListModel"
143 "id" : "vapi_filter",
147 "* prop" : "expression",
148 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
149 "string property_name" : "sortkey",
150 "xtype" : "PropertyExpression"
153 "xtype" : "StringFilter"
156 "xtype" : "FilterListModel"
159 "xtype" : "NoSelection"
163 "* pack" : "append_column",
164 "bool expand" : true,
168 "* prop" : "factory",
173 "\tvar lbl = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
175 "\tvar item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
177 "\titem.bind_property(\"name\",",
179 " GLib.BindingFlags.SYNC_CREATE);",
187 "\t//var j = (JsRender.JsRender) item;",
188 "\tvar gi = (Gtk.ListItem)item;",
190 "\tvar lbl = new Gtk.Label(\"\");",
191 "\tlbl.halign = Gtk.Align.START;",
192 "\tgi.set_child(lbl);",
200 "xtype" : "SignalListItemFactory"
203 "string title" : "Vapi Package",
204 "xtype" : "ColumnViewColumn"
208 "* pack" : "append_column",
212 "* prop" : "factory",
216 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
220 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
221 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
224 "\tvar vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();",
226 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
228 "\tbtn.active = vs.selected; ",
231 " \t// bind image...",
239 "\tvar btn = new Gtk.CheckButton();",
241 "\t((Gtk.ListItem)listitem).set_child(btn);",
243 "\tbtn.toggled.connect(() => {",
245 "\t\tvar jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
246 "\t\tjr.selected = btn.active;",
252 "xtype" : "SignalListItemFactory"
255 "string title" : "use",
256 "xtype" : "ColumnViewColumn"
259 "xtype" : "ColumnView"
262 "xtype" : "ScrolledWindow"
266 "id" : "vapi_search",
271 " _this.vapi_filter.el.set_search(this.el.get_text());",
277 "string placeholder_text" : "Search Libraries (Vapi)",
278 "uint search_delay" : 500,
279 "xtype" : "SearchEntry"
286 "* pack" : "append_page,_this.label_targets.el",
287 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
288 "bool vexpand" : true,
289 "gint position" : 300,
293 "* pack" : "set_end_child",
294 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
295 "gboolean homogeneous" : false,
300 "bool vexpand" : true,
310 "id" : "treeselmodel",
320 "\t//this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));",
325 "id" : "treelistsort",
330 "Gtk.TreeListModelCreateModelFunc create_func" : [
332 "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
333 "\treturn ((JsRender.JsRender)item).childfiles;",
336 "bool autoexpand" : true,
337 "bool passthrough" : false,
338 "id" : "treelistmodel",
343 "GLib.Type item_type" : "typeof(JsRender.JsRender)",
345 "xtype" : "ListStore"
348 "xtype" : "TreeListModel"
360 "* prop" : "expression",
361 "GLib.Type this_type" : "typeof(JsRender.JsRender)",
362 "string property_name" : "name",
363 "xtype" : "PropertyExpression"
366 "xtype" : "StringSorter"
369 "xtype" : "TreeListRowSorter"
372 "xtype" : "SortListModel"
377 "Gtk.CustomFilterFunc match_func" : [
380 "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
381 "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
382 "\tvar j = (JsRender.JsRender) tr;",
383 "\tif (j.xtype == \"Gtk\") {",
386 "\tif (j.xtype != \"Dir\") {",
387 "\t\treturn j.path.has_suffix(\".vala\") || j.path.has_suffix(\".c\");",
391 "\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
392 "\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
393 "\t\tif (f.xtype == \"Gtk\") {",
394 "\t\t\treturn true;",
396 "\t\tif (f.path.has_suffix(\".vala\") || f.path.has_suffix(\".c\")) {",
397 "\t\t\treturn true;",
404 "xtype" : "CustomFilter"
407 "xtype" : "FilterListModel"
410 "xtype" : "SingleSelection"
416 "\t this.el.set_sorter( new Gtk.StringSorter(",
417 "\t \tnew Gtk.PropertyExpression(typeof(JsRender.JsRender), null, \"name\")",
424 "* pack" : "append_column",
425 "bool expand" : true,
426 "bool resizable" : true,
431 "* prop" : "factory",
435 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
439 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
440 "\tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
443 "\tvar lbl = (Gtk.Label) expand.child;",
445 "\t if (lbl.label != \"\") { // do not update",
450 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
451 "\tvar jr = (JsRender.JsRender) lr.get_item();",
452 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
453 "\tlbl.label = jr.name; // for dir's we could hsow the sub path..",
454 "\tlbl.tooltip_markup = jr.path;",
456 " expand.set_hide_expander( jr.childfiles.n_items < 1);",
457 " \texpand.set_list_row(lr);",
459 " expand.set_hide_expander( jr.xtype != \"Dir\" );",
460 " \t expand.set_list_row(lr);",
462 " \t// bind image...",
470 "\tvar expand = new Gtk.TreeExpander();",
472 "\texpand.set_indent_for_depth(true);",
473 "\texpand.set_indent_for_icon(true);",
475 "\tvar lbl = new Gtk.Label(\"\");",
476 "\tlbl.use_markup = true;",
479 " \tlbl.justify = Gtk.Justification.LEFT;",
480 " \tlbl.xalign = 0;",
483 "\texpand.set_child(lbl);",
484 "\t((Gtk.ListItem)listitem).set_child(expand);",
485 "\t((Gtk.ListItem)listitem).activatable = false;",
490 "xtype" : "SignalListItemFactory"
493 "string title" : "Other Files",
494 "xtype" : "ColumnViewColumn"
498 "* pack" : "append_column",
502 "* prop" : "factory",
506 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
510 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
511 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
514 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
515 "\tvar jr = (JsRender.JsRender) lr.get_item();",
516 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
520 " \tjr.bind_property(\"compile_group_selected\",",
522 " GLib.BindingFlags.SYNC_CREATE); ",
523 " \t// bind image...",
531 "\tvar btn = new Gtk.CheckButton();",
533 "\t((Gtk.ListItem)listitem).set_child(btn);",
535 "\tbtn.toggled.connect(() => {",
537 "\t\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
538 "\t\tvar jr = (JsRender.JsRender) lr.get_item();",
539 "\t\tjr.compile_group_selected = btn.active;",
547 "xtype" : "SignalListItemFactory"
550 "string title" : "use",
551 "xtype" : "ColumnViewColumn"
554 "xtype" : "ColumnView"
557 "xtype" : "ScrolledWindow"
564 "* prop" : "start_child",
565 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
570 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
571 "bool hexpand" : true,
576 "bool hexpand" : true,
581 " if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {",
584 " var cg = new Project.GtkValaSettings(_this.project, \"NEW GROUP\");",
585 " _this.project.compilegroups.set(cg.name, cg);",
586 " _this.project.loadTargetsIntoStore(_this.target_model.el);",
587 " // select it.. ?? should load it??",
588 " for(var i =0;i < _this.target_model.el.n_items; i++) {",
589 " \tvar ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);",
590 " \tif (ncg.name == cg.name) {",
591 " \t\t_this.target_sel.el.selected = i;",
592 " \t\t_this.target_sel.selectTarget(cg);",
602 "utf8 label" : "Add Compile Target",
607 "bool hexpand" : true,
611 " // load the new values.",
612 "\tif (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {",
613 "\t\tGLib.debug(\"nothing selected\");",
618 "\t// add the directory..",
619 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);",
622 "\tGLib.debug(\"remove: %s\\n\", cg.name);",
623 "\tif (!_this.project.compilegroups.unset(cg.name)) {",
624 "\t\tGLib.debug(\"remove failed\");",
626 " \t_this.project.loadTargetsIntoStore(_this.target_model.el);",
630 "utf8 label" : "Remove Target",
640 "this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
645 "bool vexpand" : true,
659 "GLib.Type item_type" : "typeof(Project.GtkValaSettings)",
660 "id" : "target_model",
661 "xtype" : "ListStore"
665 "selection_changed" : [
666 "(position, n_items) => {",
669 "\t// load the new values.",
670 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
671 "\t\tthis.selectTarget(null);",
674 "\tthis.selectTarget(null);",
678 "\t// add the directory..",
679 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);",
681 "\tthis.selectTarget(cg);",
687 "xtype" : "SingleSelection",
688 "| void selectTarget" : [
689 "(Project.GtkValaSettings? cg) {",
690 "// load the new values",
691 "\t _this.selected_target = cg; ",
692 "\t _this.project.active_cg = cg;",
695 "\tif (cg == null) {",
697 "\t\t_this.set_vbox.el.hide();\t",
698 "\t\t_this.set_vboxb.el.hide();\t",
703 "\t_this.set_vbox.el.show();",
704 "\t_this.set_vboxb.el.show();",
705 "\t// add the directory..",
708 "\t GLib.debug(\"loading dirs into project list\");",
709 "\t cg.loading_ui = true;",
712 "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
713 "\t _this.project.loadDirsIntoStore(_this.treemodel.el);",
714 " \t _this.treeview.el.set_model(_this.treeselmodel.el);",
716 "\t cg.loading_ui = false;",
717 "\t GLib.debug(\"Set name to %s\", cg.name);",
719 " \t_this.build_name.el.buffer.set_text(cg.name.data);",
722 "\t_this.build_execute_args.el.buffer.set_text( cg.execute_args.data );",
731 "* pack" : "append_column",
732 "bool expand" : true,
736 "* prop" : "factory",
741 "\tvar lbl = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
743 "\tvar item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();",
745 "\titem.bind_property(\"name\",",
747 " GLib.BindingFlags.SYNC_CREATE);",
755 "\t//var j = (JsRender.JsRender) item;",
756 "\tvar gi = (Gtk.ListItem)item;",
758 "\tvar lbl = new Gtk.Label(\"\");",
759 "\tlbl.halign = Gtk.Align.START;",
760 "\tgi.set_child(lbl);",
768 "xtype" : "SignalListItemFactory"
771 "string title" : "Build Target",
772 "xtype" : "ColumnViewColumn"
775 "xtype" : "ColumnView"
778 "xtype" : "ScrolledWindow"
782 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
788 "utf8 label" : "Build Name (executable name)",
797 "\tif (_this.selected_target == null) {",
800 "\tvar name = this.el.text;",
801 "\t// name ischanging.. probably always..",
802 "\tif (_this.selected_target.name != name) {",
803 "\t\t_this.project.compilegroups.unset(_this.selected_target.name);",
804 "\t\t_this.project.compilegroups.set(name, _this.selected_target);",
807 "\t_this.selected_target.name = this.el.buffer.text;",
815 "utf8 label" : "test argments - when run after a build",
820 "id" : "build_execute_args",
824 " if (_this.selected_target == null) {",
827 " _this.selected_target.execute_args = this.el.buffer.text;",
832 "string placeholder_text" : "eg. -f somefile -g ",
848 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
850 "bool hexpand" : true,
851 "int margin_bottom" : 4,
852 "int margin_end" : 4,
853 "int margin_start" : 4,
854 "int margin_top" : 4,
862 " _this.done = true;",
863 " _this.el.hide(); ",
867 "string label" : "Cancel",
872 "bool hexpand" : true,
878 "css_classes" : "{ \"suggested-action\" }",
885 "_this.project.save(); ",
887 "\t// what about .js ?",
888 "_this.done = true;",
890 "if (_this.doneObj != null) {",
891 "\t_this.doneObj.call(_this.project);",
898 "string label" : "Save",
911 "\tif (!this.done) {",
920 "\t if (!this.done) {",
927 "uint border_width" : 0,
931 " this.project.save(); ",
935 "(Gtk.Window pwin, Project.Gtk project, Project.Callback? doneObj) {",
937 " //print(\"ValaProjectSettings show\\n\");",
938 " this.doneObj = doneObj;",
939 " this.project= project;",
941 " this.compile_flags.el.buffer.set_text(",
942 " \tproject.compile_flags.data",
945 " project.loadVapiIntoStore(_this.vapimodel.el);",
946 " GLib.Timeout.add(500, () => {",
947 " \t\t this.vapi_scroll.el.vadjustment.value = 0;\t ",
953 " \tproject.loadTargetsIntoStore(this.target_model.el);",
955 " \t_this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;",
956 "\t_this.target_sel.selectTarget(null);",
957 "//\tGtk.Allocation rect;",
958 "\t//btn.get_allocation(out rect);",
959 " // this.el.set_pointing_to(rect);",
960 " this.el.application = pwin.application; // ??? make it modal?",
961 "\t this.el.set_transient_for(pwin);",
963 "\t// window + header?",
964 "\t// print(\"SHOWALL - POPIP\\n\");",
965 "\tthis.el.set_size_request(800,800);",
967 "\tthis.notebook.el.page = 0; // first page.",
969 "\t//this.view.el.grab_focus();",
976 "name" : "ValaProjectSettingsPopover"