Fix #7959 - new project flow - use void func to callback after each step, tidy up...
[roobuilder] / src / Builder4 / MainWindow.bjs
1 {
2  "build_module" : "builder",
3  "gen_extended" : false,
4  "items" : [
5   {
6    "# Project.Project project" : "null",
7    "# WindowState windowstate" : "",
8    "$ type" : "Gtk.WindowType.TOPLEVEL",
9    "$ xns" : "Gtk",
10    "* ctor" : "new Gtk.ApplicationWindow(BuilderApplication.singleton({}))",
11    "* init" : [
12     " ",
13     " ",
14     "     this.el.set_icon_name(\"roobuilder\");",
15     "     ",
16     "   ",
17     "     ",
18     " "
19    ],
20    "border_width" : 0,
21    "default_height" : 850,
22    "default_width" : 1200,
23    "id" : "MainWindow",
24    "items" : [
25     {
26      "$ string title" : "\"Application Builder\"",
27      "$ xns" : "Gtk",
28      "* pack" : "set_titlebar",
29      "bool show_close_button" : true,
30      "id" : "headerbar",
31      "items" : [
32       {
33        "$ xns" : "Gtk",
34        "* pack" : "pack_start",
35        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
36        "items" : [
37         {
38          "# Gee.ArrayList<Gtk.Widget> mitems" : "",
39          "$ Gtk.Align halign" : "Gtk.Align.START",
40          "$ xns" : "Gtk",
41          "* init" : [
42           "{",
43           "\tthis.mitems = new Gee.ArrayList<Gtk.Button>();",
44           "}",
45           ""
46          ],
47          "id" : "windowbtn",
48          "int margin_end" : 4,
49          "items" : [
50           {
51            "$ xns" : "Gtk",
52            "* pack" : false,
53            "id" : "windowspopup",
54            "items" : [
55             {
56              "$ xns" : "Gtk",
57              "* pack" : "set_child",
58              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
59              "id" : "popover_menu",
60              "int spacing" : 0,
61              "items" : [
62               {
63                "$ xns" : "Gtk",
64                "* pack" : "append",
65                "items" : [
66                 {
67                  "$ Gtk.ShortcutScope scope" : "Gtk.ShortcutScope.GLOBAL",
68                  "$ xns" : "Gtk",
69                  "* init" : [
70                   "{",
71                   "\tthis.el.add_shortcut(",
72                   "\t\tnew Gtk.Shortcut(",
73                   "\t\t\tnew Gtk.KeyvalTrigger(Gdk.Key.N,Gdk.ModifierType.CONTROL_MASK),",
74                   "\t\t\tnew Gtk.SignalAction(\"clicked\")",
75                   "\t\t)",
76                   "\t);",
77                   "}",
78                   ""
79                  ],
80                  "xtype" : "ShortcutController"
81                 }
82                ],
83                "listeners" : {
84                 "clicked" : [
85                  "( ) => {",
86                  "\t_this.windowspopup.el.hide();",
87                  "\t_this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);",
88                  "}",
89                  ""
90                 ]
91                },
92                "string label" : "New Window",
93                "xtype" : "Button"
94               },
95               {
96                "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
97                "$ xns" : "Gtk",
98                "* pack" : "append",
99                "xtype" : "Separator"
100               }
101              ],
102              "xtype" : "Box"
103             }
104            ],
105            "xtype" : "Popover"
106           },
107           {
108            "$ xns" : "Gtk",
109            "* prop" : "child",
110            "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
111            "items" : [
112             {
113              "$ xns" : "Gtk",
114              "int margin_start" : 4,
115              "string icon_name" : "window-new",
116              "xtype" : "Image"
117             },
118             {
119              "$ xns" : "Gtk",
120              "string label" : "Windows (Add/List)",
121              "xtype" : "Label"
122             }
123            ],
124            "xtype" : "Box"
125           }
126          ],
127          "listeners" : {
128           "clicked" : [
129            "( ) => {",
130            "\tthis.updateMenu();",
131            "",
132            "\t _this.windowspopup.el.set_parent(this.el);",
133            "",
134            "\t _this.windowspopup.el.set_position(Gtk.PositionType.BOTTOM); ",
135            "\t _this.windowspopup.el.popup(); ",
136            "}",
137            ""
138           ]
139          },
140          "xtype" : "Button",
141          "| void updateMenu" : [
142           "() {",
143           "\t foreach(var m in  this.mitems) {",
144           "\t \t _this.popover_menu.el.remove(m);",
145           "\t }",
146           "\t this.mitems.clear();",
147           "\t",
148           "\t BuilderApplication.windows.sort((a,b) => {",
149           "\t \tif (a.windowstate == null ||",
150           " \t\t\t a.windowstate.file == null || ",
151           " \t\t\t b.windowstate == null ||",
152           " \t\t\t b.windowstate.file == null",
153           " \t\t\t ) { ",
154           " \t\t\treturn 0;",
155           "\t\t}",
156           "",
157           "\t \tvar ap = a.windowstate.file.project.name;",
158           "\t \tvar bp = b.windowstate.file.project.name;",
159           "\t \t",
160           "",
161           "\t \t",
162           "\t \tif (ap != bp) {",
163           "\t \t\treturn ap.collate(bp);",
164           "\t \t}",
165           "\t \tvar af =  a.windowstate.file == null ? \"\" : a.windowstate.file.getTitle();",
166           "\t \tvar bf = b.windowstate.file == null ? \"\" : b.windowstate.file.getTitle();\t \t",
167           "\t\treturn af.collate(bf);",
168           "\t ",
169           "\t });",
170           "\t ",
171           "\t var p = \"\";",
172           "\t foreach(var w in BuilderApplication.windows) {",
173           "\t \tvar wid = BuilderApplication.windows.index_of(w);",
174           "\t \t// fixme find a better way to display this.",
175           " \t\tif (w.windowstate == null ||",
176           " \t\t\t w.windowstate.file == null || ",
177           " \t\t\t _this.windowstate == null ||",
178           " \t\t\t _this.windowstate.file == null",
179           " \t\t\t ) { ",
180           " \t\t\tcontinue;",
181           "\t\t}",
182           "\t \t// should not happen...",
183           "\t \tif (w.windowstate.file.path == _this.windowstate.file.path) {",
184           "\t \t\tcontinue;",
185           " \t\t}",
186           " \t\tif (w.windowstate.file.project.name != p || p != \"\") {",
187           " \t\t\tvar ms = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);",
188           " \t\t\t_this.popover_menu.el.append(ms);",
189           "\t\t \tms.show();",
190           "\t\t \tthis.mitems.add(ms);",
191           " \t\t}",
192           " \t\t",
193           " \t\tp = w.windowstate.file.project.name;",
194           " \t\t",
195           "",
196           " \t\tGLib.debug(\"add menuitem %s\", w.windowstate.file.path);",
197           " \t\t",
198           " \t\t",
199           " \t\t",
200           "\t \tvar m = new Gtk.Button.with_label(",
201           "\t\t \tw.windowstate.file.project.name + \" : \" + w.windowstate.file.relpath",
202           "\t \t);",
203           "\t \tm.halign = Gtk.Align.START;",
204           "\t \t",
205           "\t \t",
206           "\t \t//w.windowstate.file.path);",
207           "\t \tm.clicked.connect(() => {",
208           "\t\t \t_this.windowspopup.el.hide();",
209           "\t \t\t BuilderApplication.windows.get(wid).el.present();",
210           "\t \t});",
211           "\t \t_this.popover_menu.el.append(m);",
212           "\t \t//m.show();",
213           "\t \tthis.mitems.add(m);",
214           "\t }",
215           "}"
216          ]
217         },
218         {
219          "$ xns" : "Gtk",
220          "* pack" : "append",
221          "bool always_show_image" : true,
222          "id" : "open_projects_btn",
223          "listeners" : {
224           "clicked" : [
225            "  ( ) => {",
226            "  \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);",
227            "}"
228           ]
229          },
230          "string icon_name" : "system-file-manager",
231          "string label" : "Files / Projects",
232          "tooltop_text" : "\"Open File\"",
233          "xtype" : "Button"
234         }
235        ],
236        "xtype" : "Box"
237       }
238      ],
239      "xtype" : "HeaderBar"
240     },
241     {
242      "$ xns" : "Gtk",
243      "* pack" : "set_child",
244      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
245      "bool homogeneous" : false,
246      "bool vexpand" : true,
247      "id" : "vbox",
248      "items" : [
249       {
250        "# int lastWidth" : 0,
251        "$ xns" : "Gtk",
252        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
253        "bool hexpand" : true,
254        "bool vexpand" : true,
255        "id" : "mainpane",
256        "items" : [
257         {
258          "$ xns" : "Gtk",
259          "* prop" : "start_child",
260          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
261          "bool hexpand" : true,
262          "bool vexpand" : true,
263          "id" : "leftpane",
264          "items" : [
265           {
266            "$ xns" : "Gtk",
267            "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
268            "id" : "editpane",
269            "items" : [
270             {
271              "$ xns" : "Gtk",
272              "* prop" : "start_child",
273              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
274              "bool hexpand" : true,
275              "bool vexpand" : true,
276              "id" : "tree",
277              "xtype" : "Box"
278             },
279             {
280              "$ xns" : "Gtk",
281              "* prop" : "end_child",
282              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
283              "bool hexpand" : true,
284              "bool vexpand" : true,
285              "id" : "props",
286              "xtype" : "Box"
287             }
288            ],
289            "listeners" : {
290             "accept_position" : [
291              "( ) => {",
292              "\t_this.windowstate.left_tree.onresize();",
293              "\treturn true;",
294              "}",
295              ""
296             ],
297             "move_handle" : [
298              "(scroll) => {",
299              "\tGLib.debug(\"Move handle\");",
300              "\treturn true;",
301              "}"
302             ]
303            },
304            "xtype" : "Paned"
305           }
306          ],
307          "xtype" : "Box"
308         },
309         {
310          "$ xns" : "Gtk",
311          "* prop" : "end_child",
312          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
313          "bool hexpand" : true,
314          "bool vexpand" : true,
315          "items" : [
316           {
317            "$ xns" : "Gtk",
318            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
319            "bool hexpand" : true,
320            "bool vexpand" : true,
321            "id" : "rooviewbox",
322            "xtype" : "Box"
323           },
324           {
325            "$ xns" : "Gtk",
326            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
327            "bool hexpand" : true,
328            "bool vexpand" : true,
329            "id" : "codeeditviewbox",
330            "xtype" : "Box"
331           }
332          ],
333          "xtype" : "Box"
334         }
335        ],
336        "listeners" : {
337         "accept_position" : [
338          "( ) => {",
339          "\t_this.windowstate.left_tree.onresize();",
340          "\treturn true;",
341          "}",
342          ""
343         ]
344        },
345        "position" : 400,
346        "xtype" : "Paned"
347       },
348       {
349        "$ xns" : "Gtk",
350        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
351        "bool homogeneous" : false,
352        "bool vexpand" : false,
353        "items" : [
354         {
355          "$ tooltip_text" : "\"Project Details\"",
356          "$ xns" : "Gtk",
357          "bool always_show_image" : true,
358          "listeners" : {
359           "clicked" : [
360            "  ( ) => {",
361            "     ",
362            "     _this.windowstate.projectPopoverShow(_this.el, null, null);",
363            "   ",
364            "  ",
365            "}"
366           ]
367          },
368          "string icon_name" : "emblem-system",
369          "string label" : "Edit Project Settings",
370          "xtype" : "Button"
371         },
372         {
373          "$ tooltip_text" : "\"File Details\"",
374          "$ xns" : "Gtk",
375          "bool always_show_image" : true,
376          "listeners" : {
377           "clicked" : [
378            "  ( ) => {",
379            "  ",
380            "    // create a new file in project..",
381            "    if (_this.project == null || _this.windowstate.file == null) {",
382            "        return  ;",
383            "    }",
384            "     _this.windowstate.file_details.show(",
385            "        _this.windowstate.file, _this.el, false",
386            "    );",
387            "     ",
388            "    return  ;    ",
389            "",
390            "",
391            "}"
392           ]
393          },
394          "string icon_name" : "document-properties",
395          "string label" : "Edit File Properties",
396          "xtype" : "Button"
397         },
398         {
399          "$ xns" : "Gtk",
400          "bool always_show_image" : true,
401          "items" : [
402           {
403            "$ xns" : "Gtk",
404            "* ctor" : "new Gtk.PopoverMenu.from_model(null)",
405            "* init" : [
406             "{",
407             "   // this.el.show();",
408             "}",
409             ""
410            ],
411            "* prop" : "popover",
412            "id" : "topbarmenu",
413            "items" : [
414             {
415              "$ xns" : "Gtk",
416              "* pack" : "set_child",
417              "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
418              "int spacing" : 0,
419              "items" : [
420               {
421                "$ xns" : "Gtk",
422                "listeners" : {
423                 "activate" : [
424                  " ( ) => {",
425                  "         Resources.singleton().fetchStart();",
426                  "}"
427                 ]
428                },
429                "string label" : "Download updated Resources",
430                "xtype" : "Button"
431               },
432               {
433                "$ xns" : "Gtk",
434                "listeners" : {
435                 "clicked" : [
436                  "() => {",
437                  "    About.singleton().el.show();",
438                  "    }"
439                 ]
440                },
441                "string label" : "About the Builder",
442                "xtype" : "Button"
443               }
444              ],
445              "xtype" : "Box"
446             }
447            ],
448            "xtype" : "PopoverMenu"
449           }
450          ],
451          "string icon_name" : "dialog-information",
452          "string label" : "About",
453          "xtype" : "MenuButton"
454         },
455         {
456          "$ xns" : "Gtk",
457          "bool hexpand" : true,
458          "string label" : "   ",
459          "xtype" : "Label"
460         },
461         {
462          "$ xns" : "Gtk",
463          "* init" : [
464           "{",
465           "     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {",
466           "        if (pos < 1) {",
467           "            this.el.hide();",
468           "            _this.mainpane.el.set_sensitive(true);",
469           "            ",
470           "            return;",
471           "        }",
472           "         _this.mainpane.el.set_sensitive(false);",
473           "         this.el.show();",
474           "         this.el.set_fraction ((1.0f * pos) / (1.0f * total));",
475           "         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));",
476           "       ",
477           "     });",
478           "}",
479           ""
480          ],
481          "bool show_text" : true,
482          "id" : "statusbar",
483          "ulong handler_id" : "-1",
484          "xtype" : "ProgressBar"
485         },
486         {
487          "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
488          "$ xns" : "Gtk",
489          "items" : [
490           {
491            "$ xns" : "Gtk",
492            "id" : "statusbar_compilestatus_label",
493            "int margin_end" : 4,
494            "int margin_start" : 4,
495            "string label" : "Compile Status:",
496            "xtype" : "Label"
497           },
498           {
499            "# GLib.ListStore notices" : "null",
500            "$ xns" : "Gtk",
501            "Xcls_ValaCompileErrors popup" : "",
502            "id" : "statusbar_errors",
503            "listeners" : {
504             "clicked" : [
505              "() => {",
506              "    ",
507              "",
508              "    ",
509              "    if (this.popup == null) {",
510              "        this.popup = new Xcls_ValaCompileErrors();",
511              "        this.popup.window = _this;",
512              "        //this.popup.el.application = _this.el.application;",
513              "\t  //   this.popup.el.set_transient_for( _this.el );",
514              "       this.popup.el.set_parent(this.el);",
515              "    }",
516              "    if (_this.statusbar_compile_spinner.el.spinning) {",
517              "\t\tthis.popup.el.show();    \t",
518              "    \treturn;",
519              "\t}    ",
520              "    this.popup.show(this.notices, this.el);",
521              "    return;",
522              "}"
523             ]
524            },
525            "string icon_name" : "dialog-error",
526            "string label" : "0 Errors",
527            "xtype" : "Button",
528            "| void setNotices" : [
529             "(GLib.ListStore nots, int qty, int tf) {",
530             "    ",
531             "     if (qty < 1 ) {",
532             "    \tthis.el.hide();",
533             "    \tif (this.popup != null && this.popup.el.visible) {",
534             "    \t\tthis.popup.el.hide();",
535             "\t\t}",
536             "    \treturn;",
537             "    }",
538             "    ",
539             "    this.el.show();",
540             "    this.el.label = \"%d/%d Errors\".printf(tf,qty);",
541             "    this.notices = nots;",
542             "\tif (this.popup != null && this.popup.el.visible) {",
543             "\t\t this.popup.show(this.notices, this.el);",
544             "    }",
545             "}",
546             ""
547            ]
548           },
549           {
550            "# GLib.ListStore notices" : "null",
551            "$ xns" : "Gtk",
552            "Xcls_ValaCompileErrors popup" : "",
553            "id" : "statusbar_warnings",
554            "listeners" : {
555             "clicked" : [
556              "() => {",
557              " ",
558              "\tif (this.popup == null) {",
559              "        this.popup = new Xcls_ValaCompileErrors();",
560              "        this.popup.window = _this;",
561              "      //    this.popup.el.set_transient_for( _this.el );",
562              "        this.popup.el.set_parent(this.el);",
563              "    }",
564              "        if (_this.statusbar_compile_spinner.el.spinning) {",
565              "\t\tthis.popup.el.show();    \t",
566              "    \treturn;",
567              "\t}    ",
568              "    this.popup.show(this.notices, this.el);",
569              "    return;",
570              "}"
571             ]
572            },
573            "string icon_name" : "dialog-warning",
574            "string label" : "0 Warnings",
575            "xtype" : "Button",
576            "| void setNotices" : [
577             "(GLib.ListStore nots, int qty, int tf) {",
578             "    ",
579             "    if (qty < 1 ) {",
580             "    \tthis.el.hide();",
581             "    \tif (this.popup != null && this.popup.el.visible) {",
582             "    \t\tthis.popup.el.hide();",
583             "\t\t}",
584             "    \treturn;",
585             "    }",
586             "    this.el.show();",
587             "    this.el.label = \"%d/%d Warnings\".printf(tf,qty);",
588             "     this.notices = nots;",
589             "    if (this.popup != null && this.popup.el.visible) {",
590             "\t\t this.popup.show(this.notices, this.el);",
591             "    }",
592             "    ",
593             "",
594             "}",
595             ""
596            ]
597           },
598           {
599            "# GLib.ListStore notices" : "null",
600            "$ xns" : "Gtk",
601            "Xcls_ValaCompileErrors popup" : "",
602            "id" : "statusbar_depricated",
603            "listeners" : {
604             "clicked" : [
605              "() => {",
606              "    ",
607              "\tif (this.popup == null) {",
608              "        this.popup = new Xcls_ValaCompileErrors();",
609              "        this.popup.window = _this;",
610              "      //  this.popup.el.set_transient_for( _this.el );",
611              "        this.popup.el.set_parent(this.el);",
612              "    }",
613              "    if (_this.statusbar_compile_spinner.el.spinning) {",
614              "\t\tthis.popup.el.show();    \t",
615              "    \treturn;",
616              "\t}    ",
617              "    ",
618              "    this.popup.show(this.notices, this.el);",
619              "    return;",
620              "}"
621             ]
622            },
623            "string icon_name" : "dialog-information",
624            "string label" : "0 Depricated",
625            "xtype" : "Button",
626            "| void setNotices" : [
627             "(GLib.ListStore nots, int qty, int tf) {",
628             "    if (qty < 1) {",
629             "    \tthis.el.hide();",
630             "    \tif (this.popup != null && this.popup.el.visible) {",
631             "\t\t\t this.popup.el.hide();",
632             "\t\t}",
633             " ",
634             "    \treturn;",
635             "\t}",
636             "    ",
637             "    this.el.show();",
638             "    ",
639             "    this.el.label = \"%d/%d Depricated\".printf(tf,qty);",
640             "    this.notices = nots;",
641             "\tif (this.popup != null && this.popup.el.visible) {",
642             "\t\t this.popup.show(this.notices, this.el);",
643             "    }",
644             "}",
645             ""
646            ]
647           },
648           {
649            "$ xns" : "Gtk",
650            "Xcls_ValaCompileErrors popup" : "",
651            "id" : "statusbar_run",
652            "listeners" : {
653             "clicked" : [
654              "() => {",
655              "   ",
656              "   if (_this.windowstate.file == null) {",
657              "\t\treturn;",
658              "\t}",
659              "   if (_this.statusbar_compile_spinner.el.spinning) {",
660              "    \t_this.windowstate.compile_results.el.set_parent(this.el);",
661              "\t    _this.windowstate.compile_results.el.show(); // show currently running.",
662              "    \treturn;",
663              "\t}",
664              "\tBuilderApplication.valacompilequeue.addFile( ",
665              "\t \t\t\t\t\tPalete.ValaCompileRequestType.RUN, ",
666              "\t \t\t\t\t\t_this.windowstate.file, \"\", true ) ;",
667              "",
668              "\t_this.windowstate.compile_results.el.set_parent(this.el);",
669              "\t_this.windowstate.compile_results.show(this.el,true);",
670              "\t         ",
671              "}"
672             ]
673            },
674            "string icon_name" : "media-playback-start",
675            "string label" : "Run",
676            "xtype" : "Button"
677           }
678          ],
679          "xtype" : "Box"
680         },
681         {
682          "$ xns" : "Gtk",
683          "id" : "statusbar_compile_spinner",
684          "int margin_end" : 4,
685          "int margin_start" : 4,
686          "string tooltip_text" : "Compiling",
687          "xtype" : "Spinner",
688          "| void start" : [
689           "() {",
690           "  this.el.show();",
691           "  this.el.start();  ",
692           "  ",
693           "\t ",
694           "}",
695           ""
696          ],
697          "| void stop" : [
698           "() {",
699           " this.el.stop();",
700           "  this.el.hide();",
701           "   ",
702           "}",
703           ""
704          ]
705         }
706        ],
707        "xtype" : "Box"
708       }
709      ],
710      "xtype" : "Box"
711     }
712    ],
713    "listeners" : {
714     "close_request" : [
715      "( ) => {",
716      "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
717      "\t ",
718      "\t BuilderApplication.removeWindow(this);",
719      "\t ",
720      "\t if (BuilderApplication.windows.size  < 1) {",
721      "",
722      "\t\tBuilderApplication.singleton(  null ).quit();",
723      "\t }",
724      "\treturn true;",
725      "}",
726      ""
727     ],
728     "hide" : [
729      "() =>  {",
730      " ",
731      " ",
732      "",
733      "}"
734     ],
735     "show" : [
736      "  ( ) => {",
737      "    // hide the file editing..",
738      "   ",
739      "    //this.hideViewEditing();",
740      "    // this is updated by windowstate - we try and fill it in..",
741      "     _this.statusbar.el.hide();",
742      "     //_this.statusbar_errors.el.hide();",
743      "    //_this.statusbar_warnings.el.hide();",
744      "    //_this.statusbar_depricated.el.hide();",
745      "    _this.statusbar_compile_spinner.el.hide();",
746      "  ",
747      "    Resources.singleton().checkResources();",
748      "    ",
749      "  ",
750      "",
751      "}"
752     ]
753    },
754    "string title" : "Roo Application Builder",
755    "xtype" : "ApplicationWindow",
756    "| void initChildren" : [
757     " () {",
758     "    // this needs putting in a better place..",
759     "    this.windowstate = new WindowState(this);",
760     "     ",
761     "",
762     " ",
763     "",
764     "    ",
765     "",
766     "",
767     "",
768     "}",
769     ""
770    ],
771    "| void openNewWindow" : [
772     "() {",
773     " ",
774     "    var w = new Xcls_MainWindow();",
775     "    w.ref();",
776     "\tBuilderApplication.addWindow(w);",
777     "    w.el.show();",
778     "    w.initChildren();",
779     "    w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);",
780     "     ",
781     "}",
782     ""
783    ],
784    "| void setTitle" : [
785     " () {",
786     "    if (_this.windowstate.project == null || ",
787     "\t    _this.windowstate.file == null",
788     "    ) {",
789     "    \tthis.el.set_title(\"Select File\");",
790     "    \treturn;",
791     "\t}",
792     "    _this.el.set_title(",
793     "    \t_this.windowstate.project.name + ",
794     "    \t\" - \" +",
795     "\t\t_this.windowstate.file.relpath);",
796     "} "
797    ],
798    "| void show" : [
799     "() {",
800     "   ",
801     "    this.el.show();",
802     "    if (this.windowstate.file  == null) {",
803     "    \tthis.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);",
804     "    }",
805     "}"
806    ],
807    "| void updateErrors" : [
808     "(Palete.ValaCompileRequest? req) {",
809     "",
810     "\tif (req == null) {",
811     " ",
812     "\t    _this.statusbar_errors.el.hide();",
813     "\t\t_this.statusbar_warnings.el.hide();",
814     "\t\t_this.statusbar_depricated.el.hide();",
815     "\t\treturn;",
816     "\t}",
817     "\t",
818     "\t",
819     "\tthis.statusbar_errors.setNotices(",
820     "\t\treq.errorByType.get(\"ERR\"),",
821     "\t\treq.totalErrors(\"ERR\"),",
822     "\t\treq.totalErrors(\"ERR\", this.windowstate.file)",
823     "\t);",
824     "\tthis.statusbar_warnings.setNotices(",
825     "\t\treq.errorByType.get(\"WARN\"),",
826     "\t\treq.totalErrors(\"WARN\"),",
827     "\t\treq.totalErrors(\"WARN\", this.windowstate.file)",
828     "\t);",
829     "\tthis.statusbar_depricated.setNotices(",
830     "\t\treq.errorByType.get(\"DEPR\"),",
831     "\t\treq.totalErrors(\"DEPR\"),",
832     "\t\treq.totalErrors(\"DEPR\", this.windowstate.file)",
833     "\t);",
834     "",
835     "\t_this.statusbar_run.el.hide();",
836     "",
837     "\tif (req.totalErrors(\"ERR\") < 1) {",
838     "\t\t_this.statusbar_run.el.show();",
839     "\t}",
840     "\t",
841     "}"
842    ]
843   }
844  ],
845  "name" : "MainWindow"
846 }