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",
11 "bool autohide" : false,
17 "* prop" : "titlebar",
18 "* title" : "Edit Project Details",
22 "* prop" : "title_widget",
23 "string label" : "Change Vala Compile settings",
28 "* pack" : "pack_end",
29 "string icon_name" : "",
30 "string label" : "Create / Recreate Build files (configure.ac / makefile.am etc)",
38 "* pack" : "set_child",
39 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
40 "bool hexpand" : true,
41 "bool vexpand" : true,
45 "bool vexpand" : true,
51 "id" : "label_global",
52 "utf8 label" : "Global",
58 "id" : "label_targets",
59 "utf8 label" : "Targets",
64 "* pack" : "append_page,_this.label_global.el",
65 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
66 "gboolean homogeneous" : false,
70 "Gtk.Align halign" : "Gtk.Align.START",
71 "bool hexpand" : true,
72 "utf8 label" : "compile flags",
77 "id" : "compile_flags",
82 " _this.project.compile_flags = this.el.buffer.text;",
83 " _this.project.save();",
84 "// _this.project.save();",
89 "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR ",
94 "Gtk.PolicyType hscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
95 "Gtk.PolicyType vscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
96 "bool has_frame" : true,
97 "bool hexpand" : true,
98 "bool vexpand" : true,
120 "GLib.Type item_type" : "typeof(Project.VapiSelection)",
122 "xtype" : "ListStore"
130 "* prop" : "expression",
131 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
132 "string property_name" : "sortkey",
133 "xtype" : "PropertyExpression"
136 "xtype" : "StringSorter"
139 "xtype" : "SortListModel"
144 "id" : "vapi_filter",
148 "* prop" : "expression",
149 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
150 "string property_name" : "sortkey",
151 "xtype" : "PropertyExpression"
154 "xtype" : "StringFilter"
157 "xtype" : "FilterListModel"
160 "xtype" : "NoSelection"
164 "* pack" : "append_column",
165 "bool expand" : true,
169 "* prop" : "factory",
174 "\tvar lbl = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
176 "\tvar item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
178 "\titem.bind_property(\"name\",",
180 " GLib.BindingFlags.SYNC_CREATE);",
188 "\t//var j = (JsRender.JsRender) item;",
189 "\tvar gi = (Gtk.ListItem)item;",
191 "\tvar lbl = new Gtk.Label(\"\");",
192 "\tlbl.halign = Gtk.Align.START;",
193 "\tgi.set_child(lbl);",
201 "xtype" : "SignalListItemFactory"
204 "string title" : "Vapi Package",
205 "xtype" : "ColumnViewColumn"
209 "* pack" : "append_column",
213 "* prop" : "factory",
217 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
221 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
222 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
225 "\tvar vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();",
227 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
229 "\tbtn.active = vs.selected; ",
232 " \t// bind image...",
240 "\tvar btn = new Gtk.CheckButton();",
242 "\t((Gtk.ListItem)listitem).set_child(btn);",
244 "\tbtn.toggled.connect(() => {",
246 "\t\tvar jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
247 "\t\tjr.selected = btn.active;",
253 "xtype" : "SignalListItemFactory"
256 "string title" : "use",
257 "xtype" : "ColumnViewColumn"
260 "xtype" : "ColumnView"
263 "xtype" : "ScrolledWindow"
267 "id" : "vapi_search",
272 " _this.vapi_filter.el.set_search(this.el.get_text());",
278 "string placeholder_text" : "Search Libraries (Vapi)",
279 "uint search_delay" : 500,
280 "xtype" : "SearchEntry"
287 "* pack" : "append_page,_this.label_targets.el",
288 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
289 "bool vexpand" : true,
290 "gint position" : 300,
294 "* pack" : "set_end_child",
295 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
296 "gboolean homogeneous" : false,
301 "bool vexpand" : true,
311 "id" : "treeselmodel",
321 "\t//this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));",
326 "id" : "treelistsort",
331 "Gtk.TreeListModelCreateModelFunc create_func" : [
333 "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
334 "\treturn ((JsRender.JsRender)item).childfiles;",
337 "bool autoexpand" : true,
338 "bool passthrough" : false,
339 "id" : "treelistmodel",
344 "GLib.Type item_type" : "typeof(JsRender.JsRender)",
346 "xtype" : "ListStore"
349 "xtype" : "TreeListModel"
361 "* prop" : "expression",
362 "GLib.Type this_type" : "typeof(JsRender.JsRender)",
363 "string property_name" : "name",
364 "xtype" : "PropertyExpression"
367 "xtype" : "StringSorter"
370 "xtype" : "TreeListRowSorter"
373 "xtype" : "SortListModel"
378 "Gtk.CustomFilterFunc match_func" : [
381 "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
382 "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
383 "\tvar j = (JsRender.JsRender) tr;",
384 "\tif (j.xtype == \"Gtk\") {",
387 "\tif (j.xtype != \"Dir\") {",
388 "\t\treturn j.path.has_suffix(\".vala\") || j.path.has_suffix(\".c\");",
392 "\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
393 "\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
394 "\t\tif (f.xtype == \"Gtk\") {",
395 "\t\t\treturn true;",
397 "\t\tif (f.path.has_suffix(\".vala\") || f.path.has_suffix(\".c\")) {",
398 "\t\t\treturn true;",
405 "xtype" : "CustomFilter"
408 "xtype" : "FilterListModel"
411 "xtype" : "SingleSelection"
417 "\t this.el.set_sorter( new Gtk.StringSorter(",
418 "\t \tnew Gtk.PropertyExpression(typeof(JsRender.JsRender), null, \"name\")",
425 "* pack" : "append_column",
426 "bool expand" : true,
427 "bool resizable" : true,
432 "* prop" : "factory",
436 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
440 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
441 "\tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
444 "\tvar lbl = (Gtk.Label) expand.child;",
446 "\t if (lbl.label != \"\") { // do not update",
451 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
452 "\tvar jr = (JsRender.JsRender) lr.get_item();",
453 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
454 "\tlbl.label = jr.name; // for dir's we could hsow the sub path..",
455 "\tlbl.tooltip_markup = jr.path;",
457 " expand.set_hide_expander( jr.childfiles.n_items < 1);",
458 " \texpand.set_list_row(lr);",
460 " expand.set_hide_expander( jr.xtype != \"Dir\" );",
461 " \t expand.set_list_row(lr);",
463 " \t// bind image...",
471 "\tvar expand = new Gtk.TreeExpander();",
473 "\texpand.set_indent_for_depth(true);",
474 "\texpand.set_indent_for_icon(true);",
476 "\tvar lbl = new Gtk.Label(\"\");",
477 "\tlbl.use_markup = true;",
480 " \tlbl.justify = Gtk.Justification.LEFT;",
481 " \tlbl.xalign = 0;",
484 "\texpand.set_child(lbl);",
485 "\t((Gtk.ListItem)listitem).set_child(expand);",
486 "\t((Gtk.ListItem)listitem).activatable = false;",
491 "xtype" : "SignalListItemFactory"
494 "string title" : "Other Files",
495 "xtype" : "ColumnViewColumn"
499 "* pack" : "append_column",
503 "* prop" : "factory",
507 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
511 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
512 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
515 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
516 "\tvar jr = (JsRender.JsRender) lr.get_item();",
517 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
521 " \tjr.bind_property(\"compile_group_selected\",",
523 " GLib.BindingFlags.SYNC_CREATE); ",
524 " \t// bind image...",
532 "\tvar btn = new Gtk.CheckButton();",
534 "\t((Gtk.ListItem)listitem).set_child(btn);",
536 "\tbtn.toggled.connect(() => {",
538 "\t\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
539 "\t\tvar jr = (JsRender.JsRender) lr.get_item();",
540 "\t\tjr.compile_group_selected = btn.active;",
548 "xtype" : "SignalListItemFactory"
551 "string title" : "use",
552 "xtype" : "ColumnViewColumn"
555 "xtype" : "ColumnView"
558 "xtype" : "ScrolledWindow"
565 "* prop" : "start_child",
566 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
571 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
572 "bool hexpand" : true,
577 "bool hexpand" : true,
582 " if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {",
585 " var cg = new Project.GtkValaSettings(_this.project, \"NEW GROUP\");",
586 " _this.project.compilegroups.set(cg.name, cg);",
587 " _this.project.loadTargetsIntoStore(_this.target_model.el);",
588 " // select it.. ?? should load it??",
589 " for(var i =0;i < _this.target_model.el.n_items; i++) {",
590 " \tvar ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);",
591 " \tif (ncg.name == cg.name) {",
592 " \t\t_this.target_sel.el.selected = i;",
593 " \t\t_this.target_sel.selectTarget(cg);",
603 "utf8 label" : "Add Compile Target",
608 "bool hexpand" : true,
612 " // load the new values.",
613 "\tif (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {",
614 "\t\tGLib.debug(\"nothing selected\");",
619 "\t// add the directory..",
620 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);",
623 "\tGLib.debug(\"remove: %s\\n\", cg.name);",
624 "\tif (!_this.project.compilegroups.unset(cg.name)) {",
625 "\t\tGLib.debug(\"remove failed\");",
627 " \t_this.project.loadTargetsIntoStore(_this.target_model.el);",
631 "utf8 label" : "Remove Target",
641 "this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
646 "bool vexpand" : true,
660 "GLib.Type item_type" : "typeof(Project.GtkValaSettings)",
661 "id" : "target_model",
662 "xtype" : "ListStore"
666 "selection_changed" : [
667 "(position, n_items) => {",
670 "\t// load the new values.",
671 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
672 "\t\tthis.selectTarget(null);",
675 "\tthis.selectTarget(null);",
679 "\t// add the directory..",
680 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);",
682 "\tthis.selectTarget(cg);",
688 "xtype" : "SingleSelection",
689 "| void selectTarget" : [
690 "(Project.GtkValaSettings? cg) {",
691 "// load the new values",
692 "\t _this.selected_target = cg; ",
693 "\t _this.project.active_cg = cg;",
696 "\tif (cg == null) {",
698 "\t\t_this.set_vbox.el.hide();\t",
699 "\t\t_this.set_vboxb.el.hide();\t",
704 "\t_this.set_vbox.el.show();",
705 "\t_this.set_vboxb.el.show();",
706 "\t// add the directory..",
709 "\t GLib.debug(\"loading dirs into project list\");",
710 "\t cg.loading_ui = true;",
713 "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
714 "\t _this.project.loadDirsIntoStore(_this.treemodel.el);",
715 " \t _this.treeview.el.set_model(_this.treeselmodel.el);",
717 "\t cg.loading_ui = false;",
718 "\t GLib.debug(\"Set name to %s\", cg.name);",
720 " \t_this.build_name.el.buffer.set_text(cg.name.data);",
723 "\t_this.build_execute_args.el.buffer.set_text( cg.execute_args.data );",
732 "* pack" : "append_column",
733 "bool expand" : true,
737 "* prop" : "factory",
742 "\tvar lbl = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
744 "\tvar item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();",
746 "\titem.bind_property(\"name\",",
748 " GLib.BindingFlags.SYNC_CREATE);",
756 "\t//var j = (JsRender.JsRender) item;",
757 "\tvar gi = (Gtk.ListItem)item;",
759 "\tvar lbl = new Gtk.Label(\"\");",
760 "\tlbl.halign = Gtk.Align.START;",
761 "\tgi.set_child(lbl);",
769 "xtype" : "SignalListItemFactory"
772 "string title" : "Build Target",
773 "xtype" : "ColumnViewColumn"
776 "xtype" : "ColumnView"
779 "xtype" : "ScrolledWindow"
783 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
789 "utf8 label" : "Build Name (executable name)",
798 "\tif (_this.selected_target == null) {",
801 "\tvar name = this.el.text;",
802 "\t// name ischanging.. probably always..",
803 "\tif (_this.selected_target.name != name) {",
804 "\t\t_this.project.compilegroups.unset(_this.selected_target.name);",
805 "\t\t_this.project.compilegroups.set(name, _this.selected_target);",
808 "\t_this.selected_target.name = this.el.buffer.text;",
816 "utf8 label" : "test argments - when run after a build",
821 "id" : "build_execute_args",
825 " if (_this.selected_target == null) {",
828 " _this.selected_target.execute_args = this.el.buffer.text;",
833 "string placeholder_text" : "eg. -f somefile -g ",
849 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
851 "bool hexpand" : true,
852 "int margin_bottom" : 4,
853 "int margin_end" : 4,
854 "int margin_start" : 4,
855 "int margin_top" : 4,
863 " _this.done = true;",
864 " _this.el.hide(); ",
868 "string label" : "Cancel",
873 "bool hexpand" : true,
879 "css_classes" : "{ \"suggested-action\" }",
886 "_this.project.save(); ",
888 "\t// what about .js ?",
889 "_this.done = true;",
891 "if (_this.doneObj != null) {",
892 "\t_this.doneObj.call(_this.project);",
894 "// hopefull this will work with bjs files..",
901 "string label" : "Save",
914 "\tif (!this.done) {",
923 "\t if (!this.done) {",
930 "uint border_width" : 0,
934 " this.project.save(); ",
938 "(Gtk.Window pwin, Project.Gtk project, Project.Callback doneObj) {",
940 " //print(\"ValaProjectSettings show\\n\");",
941 " this.doneObj = doneObj;",
942 " this.project= project;",
944 " this.compile_flags.el.buffer.set_text(",
945 " \tproject.compile_flags.data",
948 " project.loadVapiIntoStore(_this.vapimodel.el);",
949 " GLib.Timeout.add(500, () => {",
950 " \t\t this.vapi_scroll.el.vadjustment.value = 0;\t ",
956 " \tproject.loadTargetsIntoStore(this.target_model.el);",
958 " \t_this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;",
959 "\t_this.target_sel.selectTarget(null);",
960 "//\tGtk.Allocation rect;",
961 "\t//btn.get_allocation(out rect);",
962 " // this.el.set_pointing_to(rect);",
963 " this.el.application = pwin.application; // ??? make it modal?",
964 "\t this.el.set_transient_for(pwin);",
966 "\t// window + header?",
967 "\t// print(\"SHOWALL - POPIP\\n\");",
968 "\tthis.el.set_size_request(800,800);",
970 "\tthis.notebook.el.page = 0; // first page.",
972 "\t//this.view.el.grab_focus();",
979 "name" : "ValaProjectSettingsPopover"