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 cg_loading" : false,
17 "* prop" : "titlebar",
18 "* title" : "Edit Project Details",
22 "* prop" : "title_widget",
23 "string label" : "Change Vala Compile settings",
31 "* pack" : "set_child",
32 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
33 "bool hexpand" : true,
34 "bool vexpand" : true,
38 "bool vexpand" : true,
44 "id" : "label_global",
45 "utf8 label" : "Global",
51 "id" : "label_targets",
52 "utf8 label" : "Targets",
57 "* pack" : "append_page,_this.label_global.el",
58 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
59 "gboolean homogeneous" : false,
63 "Gtk.Align halign" : "Gtk.Align.START",
64 "bool hexpand" : true,
65 "utf8 label" : "compile flags",
70 "id" : "compile_flags",
75 " _this.project.compile_flags = this.el.buffer.text;",
76 " _this.project.save();",
77 "// _this.project.save();",
82 "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR ",
87 "Gtk.PolicyType hscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
88 "Gtk.PolicyType vscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
89 "bool has_frame" : true,
90 "bool hexpand" : true,
91 "bool vexpand" : true,
113 "GLib.Type item_type" : "typeof(Project.VapiSelection)",
115 "xtype" : "ListStore"
123 "* prop" : "expression",
124 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
125 "string property_name" : "sortkey",
126 "xtype" : "PropertyExpression"
129 "xtype" : "StringSorter"
132 "xtype" : "SortListModel"
137 "id" : "vapi_filter",
141 "* prop" : "expression",
142 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
143 "string property_name" : "sortkey",
144 "xtype" : "PropertyExpression"
147 "xtype" : "StringFilter"
150 "xtype" : "FilterListModel"
153 "xtype" : "NoSelection"
157 "* pack" : "append_column",
158 "bool expand" : true,
162 "* prop" : "factory",
167 "\tvar lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
169 "\tvar item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
171 "\titem.bind_property(\"name\",",
173 " GLib.BindingFlags.SYNC_CREATE);",
181 "\t//var j = (JsRender.JsRender) item;",
182 "\tvar gi = (Gtk.ListItem)item;",
184 "\tvar lbl = new Gtk.Label(\"\");",
185 "\tlbl.halign = Gtk.Align.START;",
186 "\tgi.set_child(lbl);",
194 "xtype" : "SignalListItemFactory"
197 "string title" : "Vapi Package",
198 "xtype" : "ColumnViewColumn"
202 "* pack" : "append_column",
206 "* prop" : "factory",
210 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
214 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
215 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
218 "\tvar vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();",
220 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
222 "\tbtn.active = vs.selected; ",
225 " \t// bind image...",
233 "\tvar btn = new Gtk.CheckButton();",
235 "\t((Gtk.ListItem)listitem).set_child(btn);",
237 "\tbtn.toggled.connect(() => {",
239 "\t\tvar jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
240 "\t\tjr.selected = btn.active;",
246 "xtype" : "SignalListItemFactory"
249 "string title" : "use",
250 "xtype" : "ColumnViewColumn"
253 "xtype" : "ColumnView"
256 "xtype" : "ScrolledWindow"
260 "id" : "vapi_search",
265 " _this.vapi_filter.el.set_search(this.el.get_text());",
271 "string placeholder_text" : "Search Libraries (Vapi)",
272 "uint search_delay" : 500,
273 "xtype" : "SearchEntry"
280 "* pack" : "append_page,_this.label_targets.el",
281 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
282 "bool vexpand" : true,
283 "gint position" : 300,
287 "* pack" : "set_end_child",
288 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
289 "gboolean homogeneous" : false,
294 "bool vexpand" : true,
304 "id" : "treeselmodel",
314 "\t//this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));",
319 "id" : "treelistsort",
324 "Gtk.TreeListModelCreateModelFunc create_func" : [
326 "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
327 "\treturn ((JsRender.JsRender)item).childfiles;",
330 "bool autoexpand" : true,
331 "bool passthrough" : false,
332 "id" : "treelistmodel",
337 "GLib.Type item_type" : "typeof(JsRender.JsRender)",
339 "xtype" : "ListStore"
342 "xtype" : "TreeListModel"
354 "* prop" : "expression",
355 "GLib.Type this_type" : "typeof(JsRender.JsRender)",
356 "string property_name" : "name",
357 "xtype" : "PropertyExpression"
360 "xtype" : "StringSorter"
363 "xtype" : "TreeListRowSorter"
366 "xtype" : "SortListModel"
371 "Gtk.CustomFilterFunc match_func" : [
374 "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
375 "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
376 "\tvar j = (JsRender.JsRender) tr;",
377 "\tif (j.xtype == \"Gtk\") {",
380 "\tif (j.xtype != \"Dir\") {",
381 "\t\treturn j.path.has_suffix(\".vala\") || j.path.has_suffix(\".c\");",
385 "\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
386 "\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
387 "\t\tif (f.xtype == \"Gtk\") {",
388 "\t\t\treturn true;",
390 "\t\tif (f.path.has_suffix(\".vala\") || f.path.has_suffix(\".c\")) {",
391 "\t\t\treturn true;",
398 "xtype" : "CustomFilter"
401 "xtype" : "FilterListModel"
404 "xtype" : "SingleSelection"
410 "\t this.el.set_sorter( new Gtk.StringSorter(",
411 "\t \tnew Gtk.PropertyExpression(typeof(JsRender.JsRender), null, \"name\")",
418 "* pack" : "append_column",
419 "bool expand" : true,
420 "bool resizable" : true,
425 "* prop" : "factory",
429 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
433 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
434 "\tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
437 "\tvar lbl = (Gtk.Label) expand.child;",
439 "\t if (lbl.label != \"\") { // do not update",
444 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
445 "\tvar jr = (JsRender.JsRender) lr.get_item();",
446 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
447 "\tlbl.label = jr.name; // for dir's we could hsow the sub path..",
448 "\tlbl.tooltip_markup = jr.path;",
450 " expand.set_hide_expander( jr.childfiles.n_items < 1);",
451 " \texpand.set_list_row(lr);",
453 " \texpand.set_hide_expander( jr.xtype != \"Dir\" );",
454 " \t expand.set_list_row(lr);",
456 " \t// bind image...",
464 "\tvar expand = new Gtk.TreeExpander();",
466 "\texpand.set_indent_for_depth(true);",
467 "\texpand.set_indent_for_icon(true);",
469 "\tvar lbl = new Gtk.Label(\"\");",
470 "\tlbl.use_markup = true;",
473 " \tlbl.justify = Gtk.Justification.LEFT;",
474 " \tlbl.xalign = 0;",
477 "\texpand.set_child(lbl);",
478 "\t((Gtk.ListItem)listitem).set_child(expand);",
479 "\t((Gtk.ListItem)listitem).activatable = false;",
484 "xtype" : "SignalListItemFactory"
487 "string title" : "Other Files",
488 "xtype" : "ColumnViewColumn"
492 "* pack" : "append_column",
496 "* prop" : "factory",
500 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
504 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
505 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
508 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
509 "\tvar jr = (JsRender.JsRender) lr.get_item();",
510 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
512 "\t//btn.active = jr.compile_group_selected;",
513 "\tbtn.active = _this.selected_target.has_file(jr);",
515 " \t//jr.bind_property(\"compile_group_selected\",",
516 " // btn, \"active\",",
517 " // GLib.BindingFlags.BIDIRECTIONAL); ",
518 " \t// bind image...",
525 "\tvar btn = new Gtk.CheckButton();",
527 "\t((Gtk.ListItem)listitem).set_child(btn);",
529 "\tbtn.toggled.connect(() => {",
530 "\t \tif (_this.cg_loading) {",
533 "\t\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
534 "\t\tvar jr = (JsRender.JsRender) lr.get_item();",
535 "\t\tjr.compile_group_selected = btn.active;",
543 "xtype" : "SignalListItemFactory"
546 "string title" : "use",
547 "xtype" : "ColumnViewColumn"
550 "xtype" : "ColumnView"
553 "xtype" : "ScrolledWindow"
560 "* prop" : "start_child",
561 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
566 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
567 "bool hexpand" : true,
572 "bool hexpand" : true,
577 " if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {",
580 " var cg = new Project.GtkValaSettings(_this.project, \"NEW GROUP\");",
581 " _this.project.compilegroups.set(cg.name, cg);",
582 " _this.project.loadTargetsIntoStore(_this.target_model.el);",
583 " // select it.. ?? should load it??",
584 " for(var i =0;i < _this.target_model.el.n_items; i++) {",
585 " \tvar ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);",
586 " \tif (ncg.name == cg.name) {",
587 " \t\t_this.target_sel.el.selected = i;",
588 " \t\t_this.target_sel.selectTarget(cg);",
598 "utf8 label" : "Add Compile Target",
603 "bool hexpand" : true,
607 " // load the new values.",
608 "\tif (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {",
609 "\t\tGLib.debug(\"nothing selected\");",
614 "\t// add the directory..",
615 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);",
618 "\tGLib.debug(\"remove: %s\\n\", cg.name);",
619 "\tif (!_this.project.compilegroups.unset(cg.name)) {",
620 "\t\tGLib.debug(\"remove failed\");",
622 " \t_this.project.loadTargetsIntoStore(_this.target_model.el);",
626 "utf8 label" : "Remove Target",
636 "this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
641 "bool vexpand" : true,
655 "GLib.Type item_type" : "typeof(Project.GtkValaSettings)",
656 "id" : "target_model",
657 "xtype" : "ListStore"
661 "selection_changed" : [
662 "(position, n_items) => {",
665 "\t// load the new values.",
666 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
667 "\t\tthis.selectTarget(null);",
670 "\tthis.selectTarget(null);",
674 "\t// add the directory..",
675 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);",
677 "\tthis.selectTarget(cg);",
683 "xtype" : "SingleSelection",
684 "| void selectTarget" : [
685 "(Project.GtkValaSettings? cg) {",
686 "// load the new values",
687 "\t _this.selected_target = cg; ",
688 "\t _this.project.active_cg = cg;",
691 "\tif (cg == null) {",
693 "\t\t_this.set_vbox.el.hide();\t",
694 "\t\t_this.set_vboxb.el.hide();\t",
699 "\t_this.set_vbox.el.show();",
700 "\t_this.set_vboxb.el.show();",
701 "\t// add the directory..",
704 "\t GLib.debug(\"loading dirs into project list\");",
705 "\t cg.loading_ui = true;",
706 "\t _this.cg_loading = true;",
708 "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
709 "\t _this.project.loadDirsIntoStore(_this.treemodel.el);",
710 " \t _this.treeview.el.set_model(_this.treeselmodel.el);",
712 "\t cg.loading_ui = false;",
714 "\t _this.cg_loading = false;",
715 "\t GLib.debug(\"Set name to %s\", cg.name);",
717 " \t_this.build_name.el.buffer.set_text(cg.name.data);",
720 "\t_this.build_execute_args.el.buffer.set_text( cg.execute_args.data );",
728 "* pack" : "append_column",
729 "bool expand" : true,
733 "* prop" : "factory",
738 "\tvar lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
740 "\tvar item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();",
742 "\titem.bind_property(\"name\",",
744 " GLib.BindingFlags.SYNC_CREATE);",
752 "\t//var j = (JsRender.JsRender) item;",
753 "\tvar gi = (Gtk.ListItem)item;",
755 "\tvar lbl = new Gtk.Label(\"\");",
756 "\tlbl.halign = Gtk.Align.START;",
757 "\tgi.set_child(lbl);",
765 "xtype" : "SignalListItemFactory"
768 "string title" : "Build Target",
769 "xtype" : "ColumnViewColumn"
772 "xtype" : "ColumnView"
775 "xtype" : "ScrolledWindow"
779 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
785 "utf8 label" : "Build Name (executable name)",
794 "\tif (_this.selected_target == null) {",
797 "\tvar name = this.el.text;",
798 "\t// name ischanging.. probably always..",
799 "\tif (_this.selected_target.name != name) {",
800 "\t\t_this.project.compilegroups.unset(_this.selected_target.name);",
801 "\t\t_this.project.compilegroups.set(name, _this.selected_target);",
804 "\t_this.selected_target.name = this.el.buffer.text;",
812 "utf8 label" : "test argments - when run after a build",
817 "id" : "build_execute_args",
821 " if (_this.selected_target == null) {",
824 " _this.selected_target.execute_args = this.el.buffer.text;",
829 "string placeholder_text" : "eg. -f somefile -g ",
845 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
847 "bool hexpand" : true,
848 "int margin_bottom" : 4,
849 "int margin_end" : 4,
850 "int margin_start" : 4,
851 "int margin_top" : 4,
859 " _this.done = true;",
860 " _this.el.hide(); ",
864 "string label" : "Cancel",
869 "bool hexpand" : true,
875 "css_classes" : "{ \"suggested-action\" }",
882 "_this.project.save(); ",
884 "\t// what about .js ?",
885 "_this.done = true;",
887 "if (_this.doneObj != null) {",
888 "\t_this.doneObj.call(_this.project);",
895 "string label" : "Save",
908 "\tif (!this.done) {",
918 "\t if (!this.done) {",
924 "uint border_width" : 0,
928 " this.project.save(); ",
932 "(Gtk.Window pwin, Project.Gtk project, Project.Callback? doneObj) {",
934 " //print(\"ValaProjectSettings show\\n\");",
935 " this.doneObj = doneObj;",
936 " this.project= project;",
938 " this.compile_flags.el.buffer.set_text(",
939 " \tproject.compile_flags.data",
942 " project.loadVapiIntoStore(_this.vapimodel.el);",
943 " GLib.Timeout.add(500, () => {",
944 " \t\t this.vapi_scroll.el.vadjustment.value = 0;\t ",
950 " \tproject.loadTargetsIntoStore(this.target_model.el);",
952 " \t_this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;",
953 "\t_this.target_sel.selectTarget(null);",
954 "//\tGtk.Allocation rect;",
955 "\t//btn.get_allocation(out rect);",
956 " // this.el.set_pointing_to(rect);",
957 " this.el.application = pwin.application; // ??? make it modal?",
958 "\t this.el.set_transient_for(pwin);",
960 "\t// window + header?",
961 "\t// print(\"SHOWALL - POPIP\\n\");",
962 "\tthis.el.set_size_request(800,800);",
964 "\tthis.notebook.el.page = 0; // first page.",
966 "\t//this.view.el.grab_focus();",
973 "name" : "ValaProjectSettingsPopover"