Force word characters for compile targets
[roobuilder] / src / Builder4 / ValaProjectSettingsPopover.bjs
1 {
2  "build_module" : "builder",
3  "gen_extended" : false,
4  "items" : [
5   {
6    "$ Project.Callback doneObj" : "null",
7    "$ xns" : "Gtk",
8    "Project.Gtk project" : "null",
9    "Project.GtkValaSettings? selected_target" : "null",
10    "Xcls_MainWindow window" : "null",
11    "bool cg_loading" : false,
12    "bool done" : false,
13    "bool modal" : true,
14    "items" : [
15     {
16      "$ xns" : "Gtk",
17      "* prop" : "titlebar",
18      "* title" : "Edit Project Details",
19      "items" : [
20       {
21        "$ xns" : "Gtk",
22        "* prop" : "title_widget",
23        "string label" : "Change Vala  Compile settings",
24        "xtype" : "Label"
25       }
26      ],
27      "xtype" : "HeaderBar"
28     },
29     {
30      "$ xns" : "Gtk",
31      "* pack" : "set_child",
32      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
33      "bool hexpand" : true,
34      "bool vexpand" : true,
35      "items" : [
36       {
37        "$ xns" : "Gtk",
38        "bool vexpand" : true,
39        "id" : "notebook",
40        "items" : [
41         {
42          "$ xns" : "Gtk",
43          "* pack" : false,
44          "id" : "label_global",
45          "utf8 label" : "Global",
46          "xtype" : "Label"
47         },
48         {
49          "$ xns" : "Gtk",
50          "* pack" : false,
51          "id" : "label_targets",
52          "utf8 label" : "Targets",
53          "xtype" : "Label"
54         },
55         {
56          "$ xns" : "Gtk",
57          "* pack" : "append_page,_this.label_global.el",
58          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
59          "gboolean homogeneous" : false,
60          "items" : [
61           {
62            "$ xns" : "Gtk",
63            "Gtk.Align halign" : "Gtk.Align.START",
64            "bool hexpand" : true,
65            "utf8 label" : "compile flags",
66            "xtype" : "Label"
67           },
68           {
69            "$ xns" : "Gtk",
70            "id" : "compile_flags",
71            "listeners" : {
72             "changed" : [
73              "() => {",
74              "    ",
75              "   _this.project.compile_flags = this.el.buffer.text;",
76              "   _this.project.save();",
77              "//    _this.project.save();",
78              "",
79              "}"
80             ]
81            },
82            "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR ",
83            "xtype" : "Entry"
84           },
85           {
86            "$ xns" : "Gtk",
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,
92            "id" : "vapi_scroll",
93            "items" : [
94             {
95              "$ xns" : "Gtk",
96              "* prop" : "child",
97              "items" : [
98               {
99                "$ xns" : "Gtk",
100                "* prop" : "model",
101                "items" : [
102                 {
103                  "$ xns" : "Gtk",
104                  "* prop" : "model",
105                  "items" : [
106                   {
107                    "$ xns" : "Gtk",
108                    "* prop" : "model",
109                    "items" : [
110                     {
111                      "$ xns" : "GLib",
112                      "* prop" : "model",
113                      "GLib.Type item_type" : "typeof(Project.VapiSelection)",
114                      "id" : "vapimodel",
115                      "xtype" : "ListStore"
116                     },
117                     {
118                      "$ xns" : "Gtk",
119                      "* prop" : "sorter",
120                      "items" : [
121                       {
122                        "$ xns" : "Gtk",
123                        "* prop" : "expression",
124                        "GLib.Type this_type" : "typeof(Project.VapiSelection)",
125                        "string property_name" : "sortkey",
126                        "xtype" : "PropertyExpression"
127                       }
128                      ],
129                      "xtype" : "StringSorter"
130                     }
131                    ],
132                    "xtype" : "SortListModel"
133                   },
134                   {
135                    "$ xns" : "Gtk",
136                    "* prop" : "filter",
137                    "id" : "vapi_filter",
138                    "items" : [
139                     {
140                      "$ xns" : "Gtk",
141                      "* prop" : "expression",
142                      "GLib.Type this_type" : "typeof(Project.VapiSelection)",
143                      "string property_name" : "sortkey",
144                      "xtype" : "PropertyExpression"
145                     }
146                    ],
147                    "xtype" : "StringFilter"
148                   }
149                  ],
150                  "xtype" : "FilterListModel"
151                 }
152                ],
153                "xtype" : "NoSelection"
154               },
155               {
156                "$ xns" : "Gtk",
157                "* pack" : "append_column",
158                "bool expand" : true,
159                "items" : [
160                 {
161                  "$ xns" : "Gtk",
162                  "* prop" : "factory",
163                  "listeners" : {
164                   "bind" : [
165                    "(listitem) => {",
166                    " ",
167                    "\tvar lbl = (Gtk.Label)  ((Gtk.ListItem)listitem).get_child();",
168                    "\t   ",
169                    "\tvar item = (Project.VapiSelection)  ((Gtk.ListItem)listitem).get_item();",
170                    "",
171                    "\titem.bind_property(\"name\",",
172                    "                lbl, \"label\",",
173                    "           GLib.BindingFlags.SYNC_CREATE);",
174                    "",
175                    "\t  ",
176                    "}",
177                    ""
178                   ],
179                   "setup" : [
180                    "(item) => {",
181                    "\t//var j = (JsRender.JsRender) item;",
182                    "\tvar gi = (Gtk.ListItem)item;",
183                    "\t ",
184                    "\tvar lbl = new Gtk.Label(\"\");",
185                    "\tlbl.halign = Gtk.Align.START;",
186                    "\tgi.set_child(lbl);",
187                    "",
188                    "",
189                    "",
190                    "}",
191                    ""
192                   ]
193                  },
194                  "xtype" : "SignalListItemFactory"
195                 }
196                ],
197                "string title" : "Vapi Package",
198                "xtype" : "ColumnViewColumn"
199               },
200               {
201                "$ xns" : "Gtk",
202                "* pack" : "append_column",
203                "items" : [
204                 {
205                  "$ xns" : "Gtk",
206                  "* prop" : "factory",
207                  "listeners" : {
208                   "bind" : [
209                    "(listitem) => {",
210                    "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
211                    "\t",
212                    "\t",
213                    "\t",
214                    "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
215                    "\tvar btn = (Gtk.CheckButton)  ((Gtk.ListItem)listitem).get_child();",
216                    "\t  ",
217                    " ",
218                    "\tvar vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();",
219                    "",
220                    "\t//GLib.debug(\"change  %s to %s\", lbl.label, np.name);",
221                    "",
222                    "\tbtn.active = vs.selected; ",
223                    "\t",
224                    "\tvs.btn = btn;",
225                    " \t// bind image...",
226                    " \t",
227                    "}"
228                   ],
229                   "setup" : [
230                    "",
231                    "(listitem) => {",
232                    "",
233                    "\tvar btn = new Gtk.CheckButton();",
234                    " ",
235                    "\t((Gtk.ListItem)listitem).set_child(btn);",
236                    "\t",
237                    "\tbtn.toggled.connect(() =>  {",
238                    "\t ",
239                    "\t\tvar jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
240                    "\t\tjr.selected = btn.active;",
241                    "\t});",
242                    "}",
243                    ""
244                   ]
245                  },
246                  "xtype" : "SignalListItemFactory"
247                 }
248                ],
249                "string title" : "use",
250                "xtype" : "ColumnViewColumn"
251               }
252              ],
253              "xtype" : "ColumnView"
254             }
255            ],
256            "xtype" : "ScrolledWindow"
257           },
258           {
259            "$ xns" : "Gtk",
260            "id" : "vapi_search",
261            "listeners" : {
262             "search_changed" : [
263              "( ) => {",
264              "",
265              " _this.vapi_filter.el.set_search(this.el.get_text());",
266              " ",
267              "}",
268              ""
269             ]
270            },
271            "string placeholder_text" : "Search Libraries (Vapi)",
272            "uint search_delay" : 500,
273            "xtype" : "SearchEntry"
274           }
275          ],
276          "xtype" : "Box"
277         },
278         {
279          "$ xns" : "Gtk",
280          "* pack" : "append_page,_this.label_targets.el",
281          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
282          "bool vexpand" : true,
283          "gint position" : 300,
284          "items" : [
285           {
286            "$ xns" : "Gtk",
287            "* pack" : "set_end_child",
288            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
289            "gboolean homogeneous" : false,
290            "id" : "set_vbox",
291            "items" : [
292             {
293              "$ xns" : "Gtk",
294              "bool vexpand" : true,
295              "items" : [
296               {
297                "$ xns" : "Gtk",
298                "* prop" : "child",
299                "id" : "treeview",
300                "items" : [
301                 {
302                  "$ xns" : "Gtk",
303                  "* prop" : "model",
304                  "id" : "treeselmodel",
305                  "items" : [
306                   {
307                    "$ xns" : "Gtk",
308                    "* prop" : "model",
309                    "items" : [
310                     {
311                      "$ xns" : "Gtk",
312                      "* init" : [
313                       "{",
314                       "\t//this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));",
315                       "}",
316                       ""
317                      ],
318                      "* prop" : "model",
319                      "id" : "treelistsort",
320                      "items" : [
321                       {
322                        "$ xns" : "Gtk",
323                        "* prop" : "model",
324                        "Gtk.TreeListModelCreateModelFunc create_func" : [
325                         "(item) => {",
326                         "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
327                         "\treturn ((JsRender.JsRender)item).childfiles;",
328                         "} "
329                        ],
330                        "bool autoexpand" : true,
331                        "bool passthrough" : false,
332                        "id" : "treelistmodel",
333                        "items" : [
334                         {
335                          "$ xns" : "GLib",
336                          "* prop" : "root",
337                          "GLib.Type item_type" : "typeof(JsRender.JsRender)",
338                          "id" : "treemodel",
339                          "xtype" : "ListStore"
340                         }
341                        ],
342                        "xtype" : "TreeListModel"
343                       },
344                       {
345                        "$ xns" : "Gtk",
346                        "* prop" : "sorter",
347                        "items" : [
348                         {
349                          "$ xns" : "Gtk",
350                          "* prop" : "sorter",
351                          "items" : [
352                           {
353                            "$ xns" : "Gtk",
354                            "* prop" : "expression",
355                            "GLib.Type this_type" : "typeof(JsRender.JsRender)",
356                            "string property_name" : "name",
357                            "xtype" : "PropertyExpression"
358                           }
359                          ],
360                          "xtype" : "StringSorter"
361                         }
362                        ],
363                        "xtype" : "TreeListRowSorter"
364                       }
365                      ],
366                      "xtype" : "SortListModel"
367                     },
368                     {
369                      "$ xns" : "Gtk",
370                      "* prop" : "filter",
371                      "Gtk.CustomFilterFunc match_func" : [
372                       "(item) => { ",
373                       "\t",
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\") {",
378                       "\t\treturn true;",
379                       "\t}",
380                       "\tif (j.xtype != \"Dir\") {",
381                       "\t\treturn j.path.has_suffix(\".vala\") ||  j.path.has_suffix(\".c\");",
382                       "\t}",
383                       "\t// dirs..",
384                       "\t ",
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;",
389                       "\t\t}",
390                       "\t\tif (f.path.has_suffix(\".vala\") ||  f.path.has_suffix(\".c\")) {",
391                       "\t\t\treturn true;",
392                       "\t\t}",
393                       "\t}",
394                       "\treturn false;",
395                       "",
396                       "}"
397                      ],
398                      "xtype" : "CustomFilter"
399                     }
400                    ],
401                    "xtype" : "FilterListModel"
402                   }
403                  ],
404                  "xtype" : "SingleSelection"
405                 },
406                 {
407                  "$ xns" : "Gtk",
408                  "* init" : [
409                   "{",
410                   "\t this.el.set_sorter(  new Gtk.StringSorter(",
411                   "\t \tnew Gtk.PropertyExpression(typeof(JsRender.JsRender), null, \"name\")",
412                   " \t));",
413                   "\t\t;",
414                   "\t\t",
415                   "}",
416                   ""
417                  ],
418                  "* pack" : "append_column",
419                  "bool expand" : true,
420                  "bool resizable" : true,
421                  "id" : "name",
422                  "items" : [
423                   {
424                    "$ xns" : "Gtk",
425                    "* prop" : "factory",
426                    "listeners" : {
427                     "bind" : [
428                      "(listitem) => {",
429                      "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
430                      "\t",
431                      "\t",
432                      "\t",
433                      "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
434                      "\tvar expand = (Gtk.TreeExpander)  ((Gtk.ListItem)listitem).get_child();",
435                      "\t  ",
436                      " ",
437                      "\tvar lbl = (Gtk.Label) expand.child;",
438                      "\t",
439                      "\t if (lbl.label != \"\") { // do not update",
440                      "\t \treturn;",
441                      " \t}",
442                      "\t",
443                      "",
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;",
449                      "\t ",
450                      "    expand.set_hide_expander(  jr.childfiles.n_items < 1);",
451                      " \texpand.set_list_row(lr);",
452                      " ",
453                      "  \texpand.set_hide_expander(  jr.xtype != \"Dir\" );",
454                      " \t expand.set_list_row(lr);",
455                      " ",
456                      " \t// bind image...",
457                      " \t",
458                      "}",
459                      ""
460                     ],
461                     "setup" : [
462                      "(listitem) => {",
463                      "\t",
464                      "\tvar expand = new Gtk.TreeExpander();",
465                      "\t ",
466                      "\texpand.set_indent_for_depth(true);",
467                      "\texpand.set_indent_for_icon(true);",
468                      "\t ",
469                      "\tvar lbl = new Gtk.Label(\"\");",
470                      "\tlbl.use_markup = true;",
471                      "\t",
472                      "\t",
473                      " \tlbl.justify = Gtk.Justification.LEFT;",
474                      " \tlbl.xalign = 0;",
475                      "",
476                      " ",
477                      "\texpand.set_child(lbl);",
478                      "\t((Gtk.ListItem)listitem).set_child(expand);",
479                      "\t((Gtk.ListItem)listitem).activatable = false;",
480                      "}",
481                      ""
482                     ]
483                    },
484                    "xtype" : "SignalListItemFactory"
485                   }
486                  ],
487                  "string title" : "Other Files",
488                  "xtype" : "ColumnViewColumn"
489                 },
490                 {
491                  "$ xns" : "Gtk",
492                  "* pack" : "append_column",
493                  "items" : [
494                   {
495                    "$ xns" : "Gtk",
496                    "* prop" : "factory",
497                    "listeners" : {
498                     "bind" : [
499                      "(listitem) => {",
500                      "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
501                      "\t",
502                      "\t",
503                      "\t",
504                      "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
505                      "\tvar btn = (Gtk.CheckButton)  ((Gtk.ListItem)listitem).get_child();",
506                      "\t  ",
507                      " ",
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);",
511                      "",
512                      "\t//btn.active = jr.compile_group_selected;",
513                      "\tbtn.active = _this.selected_target.has_file(jr);",
514                      "\t",
515                      " \t//jr.bind_property(\"compile_group_selected\",",
516                      "    //                btn, \"active\",",
517                      "    //               GLib.BindingFlags.BIDIRECTIONAL); ",
518                      " \t// bind image...",
519                      " \t",
520                      "}"
521                     ],
522                     "setup" : [
523                      "(listitem) => {",
524                      "",
525                      "\tvar btn = new Gtk.CheckButton();",
526                      " ",
527                      "\t((Gtk.ListItem)listitem).set_child(btn);",
528                      "\t",
529                      "\tbtn.toggled.connect(() =>  {",
530                      "\t \tif (_this.cg_loading) {",
531                      "\t \t\treturn;",
532                      " \t\t}",
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;",
536                      "\t\t",
537                      "\t\t",
538                      "\t});",
539                      "}",
540                      ""
541                     ]
542                    },
543                    "xtype" : "SignalListItemFactory"
544                   }
545                  ],
546                  "string title" : "use",
547                  "xtype" : "ColumnViewColumn"
548                 }
549                ],
550                "xtype" : "ColumnView"
551               }
552              ],
553              "xtype" : "ScrolledWindow"
554             }
555            ],
556            "xtype" : "Box"
557           },
558           {
559            "$ xns" : "Gtk",
560            "* prop" : "start_child",
561            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
562            "int spacing" : 0,
563            "items" : [
564             {
565              "$ xns" : "Gtk",
566              "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
567              "bool hexpand" : true,
568              "int spacing" : 0,
569              "items" : [
570               {
571                "$ xns" : "Gtk",
572                "bool hexpand" : true,
573                "listeners" : {
574                 "clicked" : [
575                  "()  => {",
576                  "    ",
577                  "       if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {",
578                  "        return;",
579                  "    }",
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);",
589                  "     \t\tbreak;",
590                  " \t\t}",
591                  "\t} ",
592                  "\t",
593                  "\t",
594                  "\t ",
595                  "}"
596                 ]
597                },
598                "utf8 label" : "Add Compile Target",
599                "xtype" : "Button"
600               },
601               {
602                "$ xns" : "Gtk",
603                "bool hexpand" : true,
604                "listeners" : {
605                 "clicked" : [
606                  "()  => {",
607                  "    // load the new values.",
608                  "\tif (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {",
609                  "\t\tGLib.debug(\"nothing selected\");",
610                  "\t\treturn;",
611                  "\t}",
612                  "\t",
613                  "\t ",
614                  "\t// add the directory..",
615                  "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);",
616                  "\t ",
617                  "\t ",
618                  "\tGLib.debug(\"remove: %s\\n\", cg.name);",
619                  "\tif (!_this.project.compilegroups.unset(cg.name)) {",
620                  "\t\tGLib.debug(\"remove failed\");",
621                  "\t}",
622                  " \t_this.project.loadTargetsIntoStore(_this.target_model.el);",
623                  "}"
624                 ]
625                },
626                "utf8 label" : "Remove Target",
627                "xtype" : "Button"
628               }
629              ],
630              "xtype" : "Box"
631             },
632             {
633              "$ xns" : "Gtk",
634              "* init" : [
635               "{  ",
636               "this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
637               "",
638               "}",
639               ""
640              ],
641              "bool vexpand" : true,
642              "items" : [
643               {
644                "$ xns" : "Gtk",
645                "* prop" : "child",
646                "items" : [
647                 {
648                  "$ xns" : "Gtk",
649                  "* prop" : "model",
650                  "id" : "target_sel",
651                  "items" : [
652                   {
653                    "$ xns" : "GLib",
654                    "* prop" : "model",
655                    "GLib.Type item_type" : "typeof(Project.GtkValaSettings)",
656                    "id" : "target_model",
657                    "xtype" : "ListStore"
658                   }
659                  ],
660                  "listeners" : {
661                   "selection_changed" : [
662                    "(position, n_items) => {",
663                    "",
664                    "\t ",
665                    "\t// load the new values.",
666                    "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
667                    "\t\tthis.selectTarget(null);",
668                    "\t\treturn;",
669                    "\t}",
670                    "\tthis.selectTarget(null);",
671                    "\t",
672                    " ",
673                    "",
674                    "\t// add the directory..",
675                    "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);",
676                    "\t",
677                    "\tthis.selectTarget(cg);",
678                    "   ",
679                    "}",
680                    ""
681                   ]
682                  },
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;",
689                   "\t ",
690                   "",
691                   "\tif (cg == null) {",
692                   "\t\t ",
693                   "\t\t_this.set_vbox.el.hide();\t",
694                   "\t\t_this.set_vboxb.el.hide();\t",
695                   "\t\treturn;",
696                   "\t}",
697                   "\t",
698                   "\t",
699                   "\t_this.set_vbox.el.show();",
700                   "\t_this.set_vboxb.el.show();",
701                   "\t// add the directory..",
702                   " ",
703                   "\t ",
704                   "\t GLib.debug(\"loading dirs into project list\");",
705                   "\t cg.loading_ui = true;",
706                   "\t _this.cg_loading = true;",
707                   "",
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);",
711                   "\t  ",
712                   "\t cg.loading_ui = false;",
713                   "\t ",
714                   "\t _this.cg_loading = false;",
715                   "\t GLib.debug(\"Set name to %s\", cg.name);",
716                   "\t ",
717                   " \t_this.build_name.el.buffer.set_text(cg.name.data);",
718                   " ",
719                   " ",
720                   "\t_this.build_execute_args.el.buffer.set_text(  cg.execute_args.data );",
721                   " ",
722                   "}",
723                   ""
724                  ]
725                 },
726                 {
727                  "$ xns" : "Gtk",
728                  "* pack" : "append_column",
729                  "bool expand" : true,
730                  "items" : [
731                   {
732                    "$ xns" : "Gtk",
733                    "* prop" : "factory",
734                    "listeners" : {
735                     "bind" : [
736                      "(listitem) => {",
737                      " ",
738                      "\tvar lbl = (Gtk.Label)  ((Gtk.ListItem)listitem).get_child();",
739                      "\t   ",
740                      "\tvar item = (Project.GtkValaSettings)  ((Gtk.ListItem)listitem).get_item();",
741                      "",
742                      "\titem.bind_property(\"name\",",
743                      "                lbl, \"label\",",
744                      "           GLib.BindingFlags.SYNC_CREATE);",
745                      "",
746                      "\t  ",
747                      "}",
748                      ""
749                     ],
750                     "setup" : [
751                      "(item) => {",
752                      "\t//var j = (JsRender.JsRender) item;",
753                      "\tvar gi = (Gtk.ListItem)item;",
754                      "\t ",
755                      "\tvar lbl = new Gtk.Label(\"\");",
756                      "\tlbl.halign = Gtk.Align.START;",
757                      "\tgi.set_child(lbl);",
758                      "",
759                      "",
760                      "",
761                      "}",
762                      ""
763                     ]
764                    },
765                    "xtype" : "SignalListItemFactory"
766                   }
767                  ],
768                  "string title" : "Build Target",
769                  "xtype" : "ColumnViewColumn"
770                 }
771                ],
772                "xtype" : "ColumnView"
773               }
774              ],
775              "xtype" : "ScrolledWindow"
776             },
777             {
778              "$ xns" : "Gtk",
779              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
780              "id" : "set_vboxb",
781              "int spacing" : 0,
782              "items" : [
783               {
784                "$ xns" : "Gtk",
785                "utf8 label" : "Build Name (executable name)",
786                "xtype" : "Label"
787               },
788               {
789                "# bool in_insert" : false,
790                "$ xns" : "Gtk",
791                "* init" : [
792                 "",
793                 "var ed = (this.el.get_delegate() as Gtk.Editable);",
794                 "if (ed != null) {",
795                 "\ted.insert_text.connect((text, length, ref position) => {",
796                 "\t\tif (this.in_insert) {",
797                 "\t\t\treturn;",
798                 "\t\t}",
799                 "\t\tGLib.debug(\"got insert text %s\", text);",
800                 "\t\t",
801                 "\t\tvar nt = \"\";",
802                 "\t\tfor(var i = 0;i < text.length; i++){ ",
803                 "\t\t\tif (Posix.isupper(text[i]) ||Posix.islower(text[i])  ) {",
804                 "\t\t\t\tnt +=  text[i].to_string();",
805                 "\t\t\t}\t",
806                 "\t\t}",
807                 "\t\tif (nt.length < 1) {",
808                 "\t\t\tGLib.Signal.stop_emission_by_name(ed, \"insert_text\");",
809                 "\t\t\treturn;",
810                 "\t\t}",
811                 "",
812                 "\t\tthis.in_insert = true;",
813                 "\t ",
814                 "\t\tthis.el.insert_text(nt,nt.length, ref position);",
815                 "\t\tthis.in_insert = false;",
816                 "\t\tGLib.Signal.stop_emission_by_name(ed, \"insert_text\");",
817                 "\t});",
818                 "",
819                 "}"
820                ],
821                "id" : "build_name",
822                "listeners" : {
823                 "changed" : [
824                  "()  => {",
825                  "\tif (_this.selected_target == null) {",
826                  "\t\treturn;",
827                  "\t}",
828                  "\tvar name = this.el.text;",
829                  "\t// name ischanging.. probably always..",
830                  "\tif (_this.selected_target.name != name) {",
831                  "\t\t_this.project.compilegroups.unset(_this.selected_target.name);",
832                  "\t\t_this.project.compilegroups.set(name, _this.selected_target);",
833                  "\t}",
834                  "",
835                  "\t_this.selected_target.name = this.el.buffer.text;",
836                  "}"
837                 ],
838                 "insert_text" : [
839                  "(text, length, ref position) => {",
840                  "\tif (this.in_insert) {",
841                  "\t\treturn;",
842                  "\t}",
843                  "\tGLib.debug(\"got insert text %s\", text);",
844                  "\t",
845                  "\tvar nt = \"\";",
846                  "\tfor(var i = 0;i < text.length; i++){ ",
847                  "\t\tif (Posix.isalpha(text[i])) {",
848                  "\t\t\tnt +=  text[i].to_string();",
849                  "\t\t}\t",
850                  "\t}",
851                  "\tif (nt.length < 1) {",
852                  "\t\treturn;",
853                  "\t}",
854                  "",
855                  "\tthis.in_insert = true;",
856                  " ",
857                  "\tthis.el.insert_text(text,length, ref position);",
858                  "\tthis.in_insert = false;",
859                  "}",
860                  ""
861                 ]
862                },
863                "xtype" : "Entry"
864               },
865               {
866                "$ xns" : "Gtk",
867                "utf8 label" : "test argments - when run after a build",
868                "xtype" : "Label"
869               },
870               {
871                "$ xns" : "Gtk",
872                "id" : "build_execute_args",
873                "listeners" : {
874                 "changed" : [
875                  "() => {",
876                  "    if (_this.selected_target == null) {",
877                  "        return;",
878                  "    }",
879                  "    _this.selected_target.execute_args = this.el.buffer.text;",
880                  "    ",
881                  "}"
882                 ]
883                },
884                "string placeholder_text" : "eg.  -f somefile -g ",
885                "xtype" : "Entry"
886               }
887              ],
888              "xtype" : "Box"
889             }
890            ],
891            "xtype" : "Box"
892           }
893          ],
894          "xtype" : "Paned"
895         }
896        ],
897        "xtype" : "Notebook"
898       },
899       {
900        "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
901        "$ xns" : "Gtk",
902        "bool hexpand" : true,
903        "int margin_bottom" : 4,
904        "int margin_end" : 4,
905        "int margin_start" : 4,
906        "int margin_top" : 4,
907        "items" : [
908         {
909          "$ xns" : "Gtk",
910          "listeners" : {
911           "clicked" : [
912            "() => { ",
913            "",
914            "  _this.done = true;",
915            "    _this.el.hide(); ",
916            "}"
917           ]
918          },
919          "string label" : "Cancel",
920          "xtype" : "Button"
921         },
922         {
923          "$ xns" : "Gtk",
924          "bool hexpand" : true,
925          "string label" : "",
926          "xtype" : "Label"
927         },
928         {
929          "$ xns" : "Gtk",
930          "css_classes" : "{ \"suggested-action\" }",
931          "id" : "save_btn",
932          "listeners" : {
933           "clicked" : [
934            "( ) =>  { ",
935            "",
936            " ",
937            "_this.project.save(); ",
938            " ",
939            "\t// what about .js ?",
940            "_this.done = true;",
941            "_this.el.hide();",
942            "if (_this.doneObj != null) {",
943            "\t_this.doneObj.call(_this.project);",
944            "}",
945            " ",
946            "   ",
947            "}"
948           ]
949          },
950          "string label" : "Save",
951          "xtype" : "Button"
952         }
953        ],
954        "xtype" : "Box"
955       }
956      ],
957      "xtype" : "Box"
958     }
959    ],
960    "listeners" : {
961     "close_request" : [
962      "( ) => {",
963      "\tif (!this.done) {",
964      "\t\treturn true;",
965      "\t}",
966      "\treturn false;",
967      "\t",
968      "}",
969      ""
970     ],
971     "hide" : [
972      "() => {",
973      "\t  if (!this.done) {",
974      "    _this.el.show();",
975      "  }",
976      "}"
977     ]
978    },
979    "uint border_width" : 0,
980    "xtype" : "Window",
981    "| void save" : [
982     "()  {",
983     "    this.project.save(); ",
984     "}"
985    ],
986    "| void show" : [
987     "(Gtk.Window pwin, Project.Gtk project, Project.Callback? doneObj) {",
988     "     ",
989     "    //print(\"ValaProjectSettings show\\n\");",
990     "    this.doneObj = doneObj;",
991     "    this.project=  project;",
992     "\t ",
993     "    this.compile_flags.el.buffer.set_text(",
994     "    \tproject.compile_flags.data",
995     "\t);",
996     "\t   ",
997     "    project.loadVapiIntoStore(_this.vapimodel.el);",
998     "     GLib.Timeout.add(500, () => {",
999     " \t\t this.vapi_scroll.el.vadjustment.value  = 0;\t ",
1000     "\t     return false;",
1001     "     });",
1002     "    ",
1003     "   ",
1004     " \t",
1005     " \tproject.loadTargetsIntoStore(this.target_model.el);",
1006     "\t",
1007     " \t_this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;",
1008     "\t_this.target_sel.selectTarget(null);",
1009     "//\tGtk.Allocation rect;",
1010     "\t//btn.get_allocation(out rect);",
1011     " //   this.el.set_pointing_to(rect);",
1012     " this.el.application = pwin.application; // ??? make it modal?",
1013     "\t this.el.set_transient_for(pwin);",
1014     "\t ",
1015     "\t// window + header?",
1016     "\t// print(\"SHOWALL - POPIP\\n\");",
1017     "\tthis.el.set_size_request(800,800);",
1018     "\tthis.el.show();",
1019     "\tthis.notebook.el.page = 0; // first page.",
1020     "\t",
1021     "\t//this.view.el.grab_focus();",
1022     "",
1023     "}",
1024     ""
1025    ]
1026   }
1027  ],
1028  "name" : "ValaProjectSettingsPopover"
1029 }