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",
30 "* pack" : "set_child",
31 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
32 "bool hexpand" : true,
33 "bool vexpand" : true,
37 "bool vexpand" : true,
43 "id" : "label_global",
44 "utf8 label" : "Global",
50 "id" : "label_targets",
51 "utf8 label" : "Targets",
56 "* pack" : "append_page,_this.label_global.el",
57 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
58 "gboolean homogeneous" : false,
62 "Gtk.Align halign" : "Gtk.Align.START",
63 "bool hexpand" : true,
64 "utf8 label" : "compile flags",
69 "id" : "compile_flags",
74 " _this.project.compile_flags = this.el.buffer.text;",
75 " _this.project.save();",
76 "// _this.project.save();",
81 "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR ",
86 "Gtk.PolicyType hscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
87 "Gtk.PolicyType vscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
88 "bool has_frame" : true,
89 "bool hexpand" : true,
90 "bool vexpand" : true,
112 "GLib.Type item_type" : "typeof(Project.VapiSelection)",
114 "xtype" : "ListStore"
122 "* prop" : "expression",
123 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
124 "string property_name" : "sortkey",
125 "xtype" : "PropertyExpression"
128 "xtype" : "StringSorter"
131 "xtype" : "SortListModel"
136 "id" : "vapi_filter",
140 "* prop" : "expression",
141 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
142 "string property_name" : "sortkey",
143 "xtype" : "PropertyExpression"
146 "xtype" : "StringFilter"
149 "xtype" : "FilterListModel"
152 "xtype" : "NoSelection"
156 "* pack" : "append_column",
157 "bool expand" : true,
161 "* prop" : "factory",
166 "\tvar lbl = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
168 "\tvar item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
170 "\titem.bind_property(\"name\",",
172 " GLib.BindingFlags.SYNC_CREATE);",
180 "\t//var j = (JsRender.JsRender) item;",
181 "\tvar gi = (Gtk.ListItem)item;",
183 "\tvar lbl = new Gtk.Label(\"\");",
184 "\tlbl.halign = Gtk.Align.START;",
185 "\tgi.set_child(lbl);",
193 "xtype" : "SignalListItemFactory"
196 "string title" : "Vapi Package",
197 "xtype" : "ColumnViewColumn"
201 "* pack" : "append_column",
205 "* prop" : "factory",
209 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
213 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
214 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
217 "\tvar vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();",
219 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
221 "\tbtn.active = vs.selected; ",
224 " \t// bind image...",
232 "\tvar btn = new Gtk.CheckButton();",
234 "\t((Gtk.ListItem)listitem).set_child(btn);",
236 "\tbtn.toggled.connect(() => {",
238 "\t\tvar jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
239 "\t\tjr.selected = btn.active;",
245 "xtype" : "SignalListItemFactory"
248 "string title" : "use",
249 "xtype" : "ColumnViewColumn"
252 "xtype" : "ColumnView"
255 "xtype" : "ScrolledWindow"
259 "id" : "vapi_search",
264 " _this.vapi_filter.el.set_search(this.el.get_text());",
270 "string placeholder_text" : "Search Libraries (Vapi)",
271 "uint search_delay" : 500,
272 "xtype" : "SearchEntry"
279 "* pack" : "append_page,_this.label_targets.el",
280 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
281 "bool vexpand" : true,
282 "gint position" : 300,
286 "* pack" : "set_end_child",
287 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
288 "gboolean homogeneous" : false,
293 "bool vexpand" : true,
303 "id" : "treeselmodel",
313 "\t//this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));",
318 "id" : "treelistsort",
323 "Gtk.TreeListModelCreateModelFunc create_func" : [
325 "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
326 "\treturn ((JsRender.JsRender)item).childfiles;",
329 "bool autoexpand" : true,
330 "bool passthrough" : false,
331 "id" : "treelistmodel",
336 "GLib.Type item_type" : "typeof(JsRender.JsRender)",
338 "xtype" : "ListStore"
341 "xtype" : "TreeListModel"
353 "* prop" : "expression",
354 "GLib.Type this_type" : "typeof(JsRender.JsRender)",
355 "string property_name" : "name",
356 "xtype" : "PropertyExpression"
359 "xtype" : "StringSorter"
362 "xtype" : "TreeListRowSorter"
365 "xtype" : "SortListModel"
370 "Gtk.CustomFilterFunc match_func" : [
373 "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
374 "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
375 "\tvar j = (JsRender.JsRender) tr;",
376 "\tif (j.xtype == \"Gtk\") {",
379 "\tif (j.xtype != \"Dir\") {",
380 "\t\treturn j.path.has_suffix(\".vala\") || j.path.has_suffix(\".c\");",
384 "\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
385 "\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
386 "\t\tif (f.xtype == \"Gtk\") {",
387 "\t\t\treturn true;",
389 "\t\tif (f.path.has_suffix(\".vala\") || f.path.has_suffix(\".c\")) {",
390 "\t\t\treturn true;",
397 "xtype" : "CustomFilter"
400 "xtype" : "FilterListModel"
403 "xtype" : "SingleSelection"
409 "\t this.el.set_sorter( new Gtk.StringSorter(",
410 "\t \tnew Gtk.PropertyExpression(typeof(JsRender.JsRender), null, \"name\")",
417 "* pack" : "append_column",
418 "bool expand" : true,
419 "bool resizable" : true,
424 "* prop" : "factory",
428 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
432 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
433 "\tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
436 "\tvar lbl = (Gtk.Label) expand.child;",
438 "\t if (lbl.label != \"\") { // do not update",
443 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
444 "\tvar jr = (JsRender.JsRender) lr.get_item();",
445 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
446 "\tlbl.label = jr.name; // for dir's we could hsow the sub path..",
447 "\tlbl.tooltip_markup = jr.path;",
449 " expand.set_hide_expander( jr.childfiles.n_items < 1);",
450 " \texpand.set_list_row(lr);",
452 " expand.set_hide_expander( jr.xtype != \"Dir\" );",
453 " \t expand.set_list_row(lr);",
455 " \t// bind image...",
463 "\tvar expand = new Gtk.TreeExpander();",
465 "\texpand.set_indent_for_depth(true);",
466 "\texpand.set_indent_for_icon(true);",
468 "\tvar lbl = new Gtk.Label(\"\");",
469 "\tlbl.use_markup = true;",
472 " \tlbl.justify = Gtk.Justification.LEFT;",
473 " \tlbl.xalign = 0;",
476 "\texpand.set_child(lbl);",
477 "\t((Gtk.ListItem)listitem).set_child(expand);",
478 "\t((Gtk.ListItem)listitem).activatable = false;",
483 "xtype" : "SignalListItemFactory"
486 "string title" : "Other Files",
487 "xtype" : "ColumnViewColumn"
491 "* pack" : "append_column",
495 "* prop" : "factory",
499 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
503 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
504 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
507 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
508 "\tvar jr = (JsRender.JsRender) lr.get_item();",
509 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
513 " \tjr.bind_property(\"compile_group_selected\",",
515 " GLib.BindingFlags.SYNC_CREATE); ",
516 " \t// bind image...",
524 "\tvar btn = new Gtk.CheckButton();",
526 "\t((Gtk.ListItem)listitem).set_child(btn);",
528 "\tbtn.toggled.connect(() => {",
530 "\t\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
531 "\t\tvar jr = (JsRender.JsRender) lr.get_item();",
532 "\t\tjr.compile_group_selected = btn.active;",
540 "xtype" : "SignalListItemFactory"
543 "string title" : "use",
544 "xtype" : "ColumnViewColumn"
547 "xtype" : "ColumnView"
550 "xtype" : "ScrolledWindow"
557 "* prop" : "start_child",
558 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
563 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
564 "bool hexpand" : true,
569 "bool hexpand" : true,
574 " if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {",
577 " var cg = new Project.GtkValaSettings(_this.project, \"NEW GROUP\");",
578 " _this.project.compilegroups.set(cg.name, cg);",
579 " _this.project.loadTargetsIntoStore(_this.target_model.el);",
580 " // select it.. ?? should load it??",
581 " for(var i =0;i < _this.target_model.el.n_items; i++) {",
582 " \tvar ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);",
583 " \tif (ncg.name == cg.name) {",
584 " \t\t_this.target_sel.el.selected = i;",
585 " \t\t_this.target_sel.selectTarget(cg);",
595 "utf8 label" : "Add Compile Target",
600 "bool hexpand" : true,
604 " // load the new values.",
605 "\tif (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {",
606 "\t\tGLib.debug(\"nothing selected\");",
611 "\t// add the directory..",
612 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);",
615 "\tGLib.debug(\"remove: %s\\n\", cg.name);",
616 "\tif (!_this.project.compilegroups.unset(cg.name)) {",
617 "\t\tGLib.debug(\"remove failed\");",
619 " \t_this.project.loadTargetsIntoStore(_this.target_model.el);",
623 "utf8 label" : "Remove Target",
633 "this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
638 "bool vexpand" : true,
652 "GLib.Type item_type" : "typeof(Project.GtkValaSettings)",
653 "id" : "target_model",
654 "xtype" : "ListStore"
658 "selection_changed" : [
659 "(position, n_items) => {",
662 "\t// load the new values.",
663 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
664 "\t\tthis.selectTarget(null);",
667 "\tthis.selectTarget(null);",
671 "\t// add the directory..",
672 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);",
674 "\tthis.selectTarget(cg);",
680 "xtype" : "SingleSelection",
681 "| void selectTarget" : [
682 "(Project.GtkValaSettings? cg) {",
683 "// load the new values",
684 "\t _this.selected_target = cg; ",
685 "\t _this.project.active_cg = cg;",
688 "\tif (cg == null) {",
690 "\t\t_this.set_vbox.el.hide();\t",
691 "\t\t_this.set_vboxb.el.hide();\t",
696 "\t_this.set_vbox.el.show();",
697 "\t_this.set_vboxb.el.show();",
698 "\t// add the directory..",
701 "\t GLib.debug(\"loading dirs into project list\");",
702 "\t cg.loading_ui = true;",
705 "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
706 "\t _this.project.loadDirsIntoStore(_this.treemodel.el);",
707 " \t _this.treeview.el.set_model(_this.treeselmodel.el);",
709 "\t cg.loading_ui = false;",
710 "\t GLib.debug(\"Set name to %s\", cg.name);",
712 " \t_this.build_name.el.buffer.set_text(cg.name.data);",
715 "\t_this.build_execute_args.el.buffer.set_text( cg.execute_args.data );",
724 "* pack" : "append_column",
725 "bool expand" : true,
729 "* prop" : "factory",
734 "\tvar lbl = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
736 "\tvar item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();",
738 "\titem.bind_property(\"name\",",
740 " GLib.BindingFlags.SYNC_CREATE);",
748 "\t//var j = (JsRender.JsRender) item;",
749 "\tvar gi = (Gtk.ListItem)item;",
751 "\tvar lbl = new Gtk.Label(\"\");",
752 "\tlbl.halign = Gtk.Align.START;",
753 "\tgi.set_child(lbl);",
761 "xtype" : "SignalListItemFactory"
764 "string title" : "Build Target",
765 "xtype" : "ColumnViewColumn"
768 "xtype" : "ColumnView"
771 "xtype" : "ScrolledWindow"
775 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
781 "utf8 label" : "Build Name (executable name)",
790 "\tif (_this.selected_target == null) {",
793 "\tvar name = this.el.text;",
794 "\t// name ischanging.. probably always..",
795 "\tif (_this.selected_target.name != name) {",
796 "\t\t_this.project.compilegroups.unset(_this.selected_target.name);",
797 "\t\t_this.project.compilegroups.set(name, _this.selected_target);",
800 "\t_this.selected_target.name = this.el.buffer.text;",
808 "utf8 label" : "test argments - when run after a build",
813 "id" : "build_execute_args",
817 " if (_this.selected_target == null) {",
820 " _this.selected_target.execute_args = this.el.buffer.text;",
825 "string placeholder_text" : "eg. -f somefile -g ",
841 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
843 "bool hexpand" : true,
844 "int margin_bottom" : 4,
845 "int margin_end" : 4,
846 "int margin_start" : 4,
847 "int margin_top" : 4,
855 " _this.done = true;",
856 " _this.el.hide(); ",
860 "string label" : "Cancel",
865 "bool hexpand" : true,
871 "css_classes" : "{ \"suggested-action\" }",
878 "_this.project.save(); ",
880 "\t// what about .js ?",
881 "_this.done = true;",
883 "if (_this.doneObj != null) {",
884 "\t_this.doneObj.call(_this.project);",
891 "string label" : "Save",
904 "\tif (!this.done) {",
913 "\t if (!this.done) {",
920 "uint border_width" : 0,
924 " this.project.save(); ",
928 "(Gtk.Window pwin, Project.Gtk project, Project.Callback? doneObj) {",
930 " //print(\"ValaProjectSettings show\\n\");",
931 " this.doneObj = doneObj;",
932 " this.project= project;",
934 " this.compile_flags.el.buffer.set_text(",
935 " \tproject.compile_flags.data",
938 " project.loadVapiIntoStore(_this.vapimodel.el);",
939 " GLib.Timeout.add(500, () => {",
940 " \t\t this.vapi_scroll.el.vadjustment.value = 0;\t ",
946 " \tproject.loadTargetsIntoStore(this.target_model.el);",
948 " \t_this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;",
949 "\t_this.target_sel.selectTarget(null);",
950 "//\tGtk.Allocation rect;",
951 "\t//btn.get_allocation(out rect);",
952 " // this.el.set_pointing_to(rect);",
953 " this.el.application = pwin.application; // ??? make it modal?",
954 "\t this.el.set_transient_for(pwin);",
956 "\t// window + header?",
957 "\t// print(\"SHOWALL - POPIP\\n\");",
958 "\tthis.el.set_size_request(800,800);",
960 "\tthis.notebook.el.page = 0; // first page.",
962 "\t//this.view.el.grab_focus();",
969 "name" : "ValaProjectSettingsPopover"