432ee5556689b36058ec94b31c74f1f507ad1b74
[gitlive] / NewBranch.bjs
1 {
2  "name" : "NewBranch",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/gitlive/NewBranch.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "gitlive",
9  "items" : [
10   {
11    "listeners" : {
12     "delete_event" : "(self, event) => {\n    this.el.hide();\n    return true; \n    //test  \n}\n ",
13     "response" : " (self, response_id) =>  { \n  \n\tGLib.debug(\"got %d\", (int) response_id);\n\t\n\t \n\t\n\t \n\t// have they selected a ticket..\n\t// make that the current active ticket?\n\t// we really need to store locally what ticket is being worked on..\n\t// in theory we could be working on multiple project and not merging..\n\t// -- each repo would have their active ticket (only one per repo)\n\t// -- so we could just store that in there\n\t// -- initial load can check the contents of the ticket files on first scan.\n\n\t \n\tif (response_id < 1) {\n\t    _this.el.hide();\t\n\t    this.running = false; \n\t \treturn;\n\t}\n\t\n\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n    if (this.repo != null) {\n    \tvar bn = _this.name.el.get_text();\n\n\t\tvar res = this.repo.setActiveTicket(\t\t\t\n\t\t\t RooTicket.singleton().getById(ticket_id != \"\" ? ticket_id : \"-1\"), bn\n\t\t );\n\t\t if (res) {\n\t\t \t// start the monitoring..\n\t\t \t GitMonitor.gitmonitor.start();\n\t\t \t \n\t\t }\n    }\n     \n\n    this.running = false; \n\n\tthis.el.hide();\n\t \n\t \n\n\t \n}"
14    },
15    "default_width" : 500,
16    "$ deletable" : true,
17    "title" : "Create a working branch ",
18    "xtype" : "Dialog",
19    "# GitRepo? repo" : "null",
20    "|   void show" : "( GitRepo repo, Gee.ArrayList<GitMonitorQueue> queue, string tid = \"\" ) \n{\n     // this.el.set_gravity(Gdk.Gravity.NORTH);\n    if (this.running) { // should not happen!!\n    \tGLib.error(\"new branch show called, when already being displayed?\");\n\t}\n\tthis.queue = queue;\n\t\n\tthis.running  = true;\n\tGitMonitor.gitmonitor.stop();\n\t\n    this.repo = repo;\n    \n     \n    \n\tthis.el.move((Gdk.Screen.width() / 2)- 250 ,0);\n\tthis.el.set_default_size( 500,200); // not sure why it grows..\n    GLib.debug(\"Loading tickets\"); \n     \n\n    this.el.show_all();\n    this.el.set_keep_above(true);\n   \n    \n    var curproj = RooProject.getProjectByRepo(this.repo);\n     _this.prmodel.loadProjects(curproj == null ? \"\" : curproj.id);\n    \n \t_this.dbmodel.loadTickets(curproj == null ? \"\": curproj.id, tid);\n \t_this.createbtn.updateState();\n \t\n\t_this.ticketsel.el.get_child().get_style_context().remove_class(\"warning\");\n \tif (tid != \"\") { \n\t \tvar name = RooTicket.singleton().usernameLocal();\n \t\tvar ticket = RooTicket.singleton().getById(tid);\n\t\t_this.name.el.set_text(\"wip_%s_T%s_%s\".printf(name,ticket.id, ticket.summaryToBranchName()));\n\t} else {\n\t\t_this.ticketsel.el.get_child().get_style_context().add_class(\"warning\");\n\t}\n    _this.view.loadTicket(tid);\n    \n    \n    \n    \n    \n    \n    \n \tthis.el.run();\n\n}",
21    "default_height" : 500,
22    "$ xns" : "Gtk",
23    "# bool running" : false,
24    "# Gee.ArrayList<GitMonitorQueue> queue" : "null",
25    "bool modal" : true,
26    "items" : [
27     {
28      "* pack" : "get_content_area().add",
29      "xtype" : "Notebook",
30      "$ xns" : "Gtk",
31      "bool vexpand" : true,
32      "items" : [
33       {
34        "id" : "label_select_ticket",
35        "* pack" : false,
36        "xtype" : "Label",
37        "string label" : "Select Existing Ticket to work on",
38        "$ xns" : "Gtk"
39       },
40       {
41        "id" : "label_create_ticket",
42        "xtype" : "Label",
43        "* pack" : false,
44        "string label" : "Create a New Ticket",
45        "$ xns" : "Gtk"
46       },
47       {
48        "id" : "label_quick_commit",
49        "* pack" : false,
50        "xtype" : "Label",
51        "string label" : "Quick Commit",
52        "$ xns" : "Gtk"
53       },
54       {
55        "id" : "select_ticket_tab",
56        "bool homogeneous" : false,
57        "* pack" : "append_page,_this.label_select_ticket.el",
58        "xtype" : "Box",
59        "$ xns" : "Gtk",
60        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
61        "items" : [
62         {
63          "bool homogeneous" : true,
64          "bool expand" : false,
65          "xtype" : "Table",
66          "* pack" : "pack_start,false,false,0",
67          "uint column_spacing" : 4,
68          "n_columns" : 5,
69          "$ xns" : "Gtk",
70          "n_rows" : 5,
71          "bool vexpand" : false,
72          "int margin" : 2,
73          "items" : [
74           {
75            "label" : "Project",
76            "$ visible" : true,
77            "Gtk.Align halign" : "Gtk.Align.START",
78            "* pack" : "attach_defaults,0,1,0,1",
79            "xtype" : "Label",
80            "$ justify" : "Gtk.Justification.RIGHT",
81            "x_options" : 4,
82            "$ xns" : "Gtk"
83           },
84           {
85            "label" : "Ticket",
86            "$ visible" : true,
87            "Gtk.Align halign" : "Gtk.Align.START",
88            "* pack" : "attach_defaults,1,2,0,1",
89            "xtype" : "Label",
90            "x_options" : 4,
91            "$ xns" : "Gtk"
92           },
93           {
94            "listeners" : {
95             "changed" : "() => {\n\tif (this.loading) {\n\t\treturn;\n\t}\n\tvar project_id = this.selectedProjectId();\n\t_this.dbmodel.loadTickets(project_id);\n\t\n\t\n\t/*if (this.loading) {\n\t\treturn;\n\t}\n\tvar ticket_id = this.selectedTicketId();\n\t\n\tvar name = RooTicket.singleton().usernameLocal();\n\t\n\tif (ticket_id == \"\" || ticket_id == null) {\n\t\n\t\tvar dt = new  DateTime.now_local();\n\t\t_this.name.el.set_text(\"wip_%s_%s\".printf(name,dt.format(\"%Y_%b_%d\")));\n\t\treturn;\n\t}\n\t\n\t\n\tvar ticket = RooTicket.singleton().getById(ticket_id);\n   \n\t_this.name.el.set_text(\"wip_%s_T%s_%s\".printf(name,ticket.id, ticket.summaryToBranchName()));\n\t\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n\t*/\n}"
96            },
97            "* ctor" : "new Gtk.ComboBox.with_entry()",
98            "| string selectedProjectId" : "() {\n\tGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.prmodel.el.get_value (iter, 0, out val1);\n \n\n\treturn  (string) val1;\n\t\n\t\n\t\n\t\n}\n",
99            "id" : "projectsel",
100            "* init" : "this.el.set_entry_text_column(1);",
101            "* pack" : "attach_defaults,0,1,1,2",
102            "xtype" : "ComboBox",
103            "# bool loading" : false,
104            "$ xns" : "Gtk",
105            "items" : [
106             {
107              "id" : "prcellrenderer",
108              "* pack" : "pack_start,true",
109              "xtype" : "CellRendererText",
110              "$ xns" : "Gtk"
111             },
112             {
113              "| void loadProjects" : "  (string id) {\n\n\n    \n    _this.projectsel.loading = true;\n\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n    el.append(out iter);\n\n    \n    el.set_value(iter, 0, \"\");\n    el.set_value(iter, 1, \"-- select a project --\");\n    if (id == \"\") {\n\t    _this.projectsel.el.set_active_iter(iter);\n    }\n  \n    foreach(var project in RooProject.projects()) {\n    \n        el.append(out iter);\n        \n        el.set_value(iter, 0, project.id);\n        el.set_value(iter, 1,  project.name );\n        if (id == project.id) {\n\t \t   _this.projectsel.el.set_active_iter(iter);\n\t    }   \n        \n    }\n    \n    _this.projectsel.loading = false;\n     //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n",
114              "id" : "prmodel",
115              "* pack" : "set_model",
116              "xtype" : "ListStore",
117              "$ columns" : "typeof(string),typeof(string)",
118              "n_columns" : 2,
119              "$ xns" : "Gtk"
120             }
121            ]
122           },
123           {
124            "listeners" : {
125             "changed" : "() => {\n\tif (this.loading) {\n\t\treturn;\n\t}\n\tvar ticket_id = this.selectedTicketId();\n\t\n\tvar name = RooTicket.singleton().usernameLocal();\n\t\n\tthis.el.get_child().get_style_context().remove_class(\"warning\");\n\tif (ticket_id == \"\" || ticket_id == null) {\n\t\n\t\tvar dt = new  DateTime.now_local();\n\t\t_this.name.el.set_text(\"wip_%s_%s\".printf(name,dt.format(\"%Y_%b_%d\")));\n\t\t_this.view.loadTicket(\"\");\t\t\n\t\t\n\t\tthis.el.get_child().get_style_context().add_class(\"warning\");\n\t\t_this.createbtn.updateState();\n\t\treturn;\n\t}\n\t\n\t\n\tvar ticket = RooTicket.singleton().getById(ticket_id);\n   \n\t_this.name.el.set_text(\"wip_%s_T%s_%s\".printf(name,ticket.id, ticket.summaryToBranchName()));\n\t_this.scrolled_window.el.show();\n\t \n\t_this.view.loadTicket(ticket.id);\n\t_this.createbtn.updateState();\n\t\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n}"
126            },
127            "* ctor" : "new Gtk.ComboBox.with_entry()",
128            "id" : "ticketsel",
129            "* init" : "//this.el.add_attribute(_this.dbcellrenderer.el , \"markup\", 1 );\nthis.el.set_entry_text_column(1);\nthis.el.get_child().set_sensitive(false); ",
130            "* pack" : "attach_defaults,1,5,1,2",
131            "xtype" : "ComboBox",
132            "# bool loading" : false,
133            "$ xns" : "Gtk",
134            "| string selectedTicketId" : "() {\nGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.dbmodel.el.get_value (iter, 0, out val1);\n \n\n\treturn  (string) val1;\n\t\n\t\n\t\n\t\n}\n",
135            "items" : [
136             {
137              "id" : "dbcellrenderer",
138              "xtype" : "CellRendererText",
139              "* pack" : "pack_start,true",
140              "$ xns" : "Gtk"
141             },
142             {
143              "id" : "dbmodel",
144              "xtype" : "ListStore",
145              "* pack" : "set_model",
146              "| void loadTickets" : "(string project_id , string tid = \"\") {\n\n\n    \n    // fixme .. get project id from selection..\n    \n     RooTicket.singleton().loadTickets(\n \t\t\tproject_id,\n \t\t\t_this.btn_not_me.el.active ? RooTicket.Who.ANYBODY :  RooTicket.Who.ME,\n \t\t\t _this.btn_closed.el.active ? RooTicket.Status.ALL :  RooTicket.Status.ACTIVE\n\t\t );\n        \n    _this.ticketsel.loading = true;\n\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n    el.append(out iter);\n\n    \n    el.set_value(iter, 0, \"\");\n    el.set_value(iter, 1, \"-- select a ticket --\");\n    \n    _this.ticketsel.el.set_active_iter(iter);\n    var tickets = RooTicket.singleton().tickets;\n    foreach(var ticket in tickets) {\n    \n        el.append(out iter);\n        \n        el.set_value(iter, 0, ticket.id);\n        el.set_value(iter, 1, \"#%s %s\".printf( ticket.id, ticket.summary));\n        \n        if (ticket.id == tid) {\n\t\t    _this.ticketsel.el.set_active_iter(iter);\n        }\n        \n    }\n    \n    _this.ticketsel.loading = false;\n     //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n",
147              "$ columns" : "typeof(string),typeof(string)",
148              "n_columns" : 2,
149              "$ xns" : "Gtk"
150             }
151            ]
152           },
153           {
154            "label" : "Use this as branch name",
155            "Gtk.Align halign" : "Gtk.Align.START",
156            "xalign" : 0.90000000000000002,
157            "* pack" : "attach_defaults,0,1,3,4",
158            "xtype" : "Label",
159            "$ justify" : "Gtk.Justification.RIGHT",
160            "x_options" : 4,
161            "$ xns" : "Gtk"
162           },
163           {
164            "id" : "name",
165            "$ visible" : true,
166            "xtype" : "Entry",
167            "* pack" : "attach_defaults,0,4,4,5",
168            "$ xns" : "Gtk"
169           },
170           {
171            "listeners" : {
172             "clicked" : "() => {\n\n\tGLib.debug(\"fire response = 1\");\n\t\n\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n\tif (ticket_id == \"\") {\n\t\t_this.ticketsel.el.get_child().get_style_context().add_class(\"warning\");\n\t\treturn;\n\t}\n\t \n\t_this.el.response(1);\n}"
173            },
174            "label" : "Create Branch",
175            "| void updateState" : "() {\n\n\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n\tif (ticket_id == \"\") {\n\t\tthis.el.set_sensitive(false);\n\t\treturn;\n\t}\n \n\tthis.el.set_sensitive(true);\n \n}\n",
176            "id" : "createbtn",
177            "* init" : "{\n   this.el.get_style_context().add_class(\"suggested-action\");\n}\n",
178            "xtype" : "Button",
179            "* pack" : "attach_defaults,4,5,4,5",
180            "$ xns" : "Gtk"
181           },
182           {
183            "* pack" : "attach_defaults,0,5,2,3",
184            "xtype" : "Box",
185            "$ xns" : "Gtk",
186            "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
187            "items" : [
188             {
189              "listeners" : {
190               "toggled" : "() => {\n\tvar project_id = _this.projectsel.selectedProjectId();\n\t_this.dbmodel.loadTickets(project_id);\t\n}"
191              },
192              "id" : "btn_not_me",
193              "* pack" : "add",
194              "string label" : "Show tickets not assigned to me",
195              "xtype" : "CheckButton",
196              "$ xns" : "Gtk"
197             },
198             {
199              "listeners" : {
200               "toggled" : "() => {\n \tvar project_id = _this.projectsel.selectedProjectId();\n\t_this.dbmodel.loadTickets(project_id);\t\n\t \n}"
201              },
202              "id" : "btn_closed",
203              "string label" : "Show closed Tickets",
204              "xtype" : "CheckButton",
205              "* pack" : "add",
206              "$ xns" : "Gtk"
207             },
208             {
209              "listeners" : {
210               "activate_link" : "(uri) => {\n\tif (uri == \"refresh\") {\n\t\tRooProject.reload();\n\t\tvar curproj = RooProject.getProjectByRepo(_this.repo);\n\t\t _this.prmodel.loadProjects(curproj == null ? \"\": curproj.id);\n\n\t\t_this.dbmodel.loadTickets(curproj == null ? \"\": curproj.id);\t\t\n\t}\n\treturn true;\n}"
211              },
212              "bool use_markup" : true,
213              "Gtk.Align halign" : "Gtk.Align.END",
214              "bool hexpand" : true,
215              "* pack" : "add",
216              "xtype" : "Label",
217              "string label" : "<a href=\"refresh\">Refresh Ticket list</a>",
218              "$ xns" : "Gtk"
219             }
220            ]
221           }
222          ]
223         },
224         {
225          "int height_request" : 500,
226          "id" : "scrolled_window",
227          "* init" : "{\n\tthis.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n}\n",
228          "* pack" : "add",
229          "xtype" : "ScrolledWindow",
230          "$ xns" : "Gtk",
231          "bool vexpand" : true,
232          "items" : [
233           {
234            "id" : "view",
235            "* pack" : "add",
236            "xtype" : "WebView",
237            "$ xns" : "WebKit",
238            "| void loadTicket" : "(string tid) {\n\tint h,w;\n\t_this.el.get_size(out w, out h);\n\t\n\tif (tid == \"\") {\n\t\t_this.scrolled_window.el.hide();\n\t\t_this.el.resize(w, 150);\n\t} else {\n\t\t_this.scrolled_window.el.show();\n\t\t_this.el.resize(w, 800);\n\t}\n\t\n\tvar rs =  RooTicket.singleton();\t\t\n\tvar uri = new WebKit.URIRequest(\"https://roojs.com/admin.php/MTrack/View/\" + tid);\n\tvar hd = uri.get_http_headers();\n\tvar authCode = Base64.encode (\"%s:%s\".printf(rs.username, rs.password).data);\n\thd.append(\"Authorization\", \"Basic %s\".printf(authCode));\n\t\n\t this.el.load_request(uri);\n}\n"
239           }
240          ]
241         }
242        ]
243       },
244       {
245        "bool homogeneous" : false,
246        "xtype" : "Box",
247        "* pack" : "append_page,_this.label_create_ticket.el",
248        "$ xns" : "Gtk",
249        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
250        "items" : [
251         {
252          "id" : "table",
253          "bool homogeneous" : true,
254          "bool expand" : false,
255          "xtype" : "Table",
256          "* pack" : "pack_start,false,false,0",
257          "uint column_spacing" : 4,
258          "n_columns" : 4,
259          "$ xns" : "Gtk",
260          "n_rows" : 14,
261          "bool vexpand" : false,
262          "int margin" : 2,
263          "items" : [
264           {
265            "label" : "Project",
266            "$ visible" : true,
267            "Gtk.Align halign" : "Gtk.Align.START",
268            "* pack" : "attach_defaults,0,1,0,1",
269            "xtype" : "Label",
270            "$ xns" : "Gtk"
271           },
272           {
273            "label" : "Summary",
274            "$ visible" : true,
275            "Gtk.Align halign" : "Gtk.Align.START",
276            "* pack" : "attach_defaults,1,2,0,1",
277            "xtype" : "Label",
278            "x_options" : 4,
279            "$ xns" : "Gtk"
280           },
281           {
282            "listeners" : {
283             "changed" : "() => {\n\tif (this.loading) {\n\t\treturn;\n\t}\n\tvar project_id = this.selectedProjectId();\n\t\n\tvar rt = RooTicket.singleton();\n\trt.loadProjectOptions(project_id);\n\t\n\t_this.msmodel.loadMilestones();\n\t_this.primodel.loadPriorities();\n\t_this.sevmodel.loadSeverities();\n\t_this.clmodel.loadClassifications();\t\n\t_this.devmodel.loadDevelopers();\t\n\t\n\t// affects projects and milestones..\n\t\n\t\n\t/*if (this.loading) {\n\t\treturn;\n\t}\n\tvar ticket_id = this.selectedTicketId();\n\t\n\tvar name = RooTicket.singleton().usernameLocal();\n\t\n\tif (ticket_id == \"\" || ticket_id == null) {\n\t\n\t\tvar dt = new  DateTime.now_local();\n\t\t_this.name.el.set_text(\"wip_%s_%s\".printf(name,dt.format(\"%Y_%b_%d\")));\n\t\treturn;\n\t}\n\t\n\t\n\tvar ticket = RooTicket.singleton().getById(ticket_id);\n   \n\t_this.name.el.set_text(\"wip_%s_T%s_%s\".printf(name,ticket.id, ticket.summaryToBranchName()));\n\t\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n\t*/\n}"
284            },
285            "* ctor" : "new Gtk.ComboBox.with_entry()",
286            "id" : "project_id",
287            "| string selectedProjectId" : "() {\n\tGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.prmodel.el.get_value (iter, 0, out val1);\n \n\n\treturn  (string) val1;\n\t\n\t\n\t\n\t\n}\n",
288            "* init" : "this.el.set_entry_text_column(1);",
289            "* pack" : "attach_defaults,0,1,1,2",
290            "xtype" : "ComboBox",
291            "# bool loading" : false,
292            "$ xns" : "Gtk",
293            "items" : [
294             {
295              "id" : "prcellrenderer",
296              "xtype" : "CellRendererText",
297              "* pack" : "pack_start,true",
298              "$ xns" : "Gtk"
299             },
300             {
301              "| void loadProjects" : "  (string id) {\n\n    \n    _this.project_id.loading = true;\n\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n    el.append(out iter);\n\n    \n    el.set_value(iter, 0, \"\");\n    el.set_value(iter, 1, \"-- select a project --\");\n    if (id == \"\") {\n\t    _this.project_id.el.set_active_iter(iter);\n    }\n\n    foreach(var project in RooProject.projects()) {\n    \n        el.append(out iter);\n        \n        el.set_value(iter, 0, project.id);\n        el.set_value(iter, 1,  project.name );\n        if (id == project.id) {\n\t \t   _this.project_id.el.set_active_iter(iter);\n\t    }   \n        \n    }\n    \n    _this.project_id.loading = false;\n     //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n",
302              "id" : "prmodel",
303              "* pack" : "set_model",
304              "xtype" : "ListStore",
305              "$ columns" : "typeof(string),typeof(string)",
306              "n_columns" : 2,
307              "$ xns" : "Gtk"
308             }
309            ]
310           },
311           {
312            "id" : "summary",
313            "$ visible" : true,
314            "xtype" : "Entry",
315            "* pack" : "attach_defaults,1,4,1,2",
316            "$ xns" : "Gtk"
317           },
318           {
319            "label" : "Milestone",
320            "Gtk.Align halign" : "Gtk.Align.START",
321            "xalign" : 0.90000000000000002,
322            "* pack" : "attach_defaults,0,1,2,3",
323            "xtype" : "Label",
324            "$ justify" : "Gtk.Justification.RIGHT",
325            "x_options" : 4,
326            "$ xns" : "Gtk"
327           },
328           {
329            "* ctor" : "new Gtk.ComboBox.with_entry()",
330            "id" : "milestone_id",
331            "* init" : "this.el.set_entry_text_column(1);",
332            "* pack" : "attach_defaults,0,1,3,4",
333            "xtype" : "ComboBox",
334            "# bool loading" : false,
335            "$ xns" : "Gtk",
336            "| string selectedMilestoneId" : "() {\n\tGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.msmodel.el.get_value (iter, 0, out val1);\n \n\n\treturn  (string) val1;\n\t\n\t\n\t\n\t\n}\n",
337            "items" : [
338             {
339              "id" : "msmodel",
340              "* pack" : "set_model",
341              "xtype" : "ListStore",
342              "| void loadMilestones" : "  ( ) {\n\n    var rt = RooTicket.singleton();\n   // rt.loadProjects();\n    \n    _this.milestone_id.loading = true;\n\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n    el.append(out iter);\n\n    \n    el.set_value(iter, 0, \"\");\n    el.set_value(iter, 1, \"-- select a milestone --\");\n    _this.milestone_id.el.set_active_iter(iter);    \n     \n    var projects = rt.milestones;\n    foreach(var project in projects) {\n    \n        el.append(out iter);\n        \n        el.set_value(iter, 0, project.id);\n        el.set_value(iter, 1,  project.display_name );\n      //  if (id == project.id) {\n\t //\t   _this.milestone.el.set_active_iter(iter);\n\t //   }   \n        \n    }\n    \n    \n    _this.milestone_id.loading = false;\n     //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n",
343              "$ columns" : "typeof(string),typeof(string)",
344              "n_columns" : 2,
345              "$ xns" : "Gtk"
346             }
347            ]
348           },
349           {
350            "label" : "Description",
351            "Gtk.Align halign" : "Gtk.Align.START",
352            "* pack" : "attach_defaults,1,4,2,3",
353            "xtype" : "Label",
354            "x_options" : 4,
355            "$ xns" : "Gtk"
356           },
357           {
358            "id" : "description",
359            "* pack" : "attach_defaults,1,4,3,12",
360            "xtype" : "TextView",
361            "$ xns" : "Gtk",
362            "uint border_width" : 1
363           },
364           {
365            "label" : "Priority",
366            "Gtk.Align halign" : "Gtk.Align.START",
367            "xalign" : 0.90000000000000002,
368            "* pack" : "attach_defaults,0,1,4,5",
369            "xtype" : "Label",
370            "x_options" : 4,
371            "$ xns" : "Gtk"
372           },
373           {
374            "* ctor" : "new Gtk.ComboBox.with_entry()",
375            "id" : "priority_id",
376            "* init" : "this.el.set_entry_text_column(1);",
377            "* pack" : "attach_defaults,0,1,5,6",
378            "xtype" : "ComboBox",
379            "# bool loading" : false,
380            "$ xns" : "Gtk",
381            "| string selectedPriorityId" : "() {\n\tGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.primodel.el.get_value (iter, 0, out val1);\n \n\n\treturn  (string) val1;\n\t\n\t\n\t\n\t\n}\n",
382            "items" : [
383             {
384              "id" : "primodel",
385              "| void loadPriorities" : "  ( ) {\n\n    var rt = RooTicket.singleton();\n   // rt.loadProjects();\n    \n    _this.priority_id.loading = true;\n\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n    \n   var projects = rt.priorities;\n    foreach(var project in projects) {\n    \n        el.append(out iter);\n        \n        el.set_value(iter, 0, project.id);\n        el.set_value(iter, 1,  project.display_name );\n        if (\"normal\" == project.name) {\n\t \t   _this.priority_id.el.set_active_iter(iter);\n\t    }   \n        \n    }\n    \n    _this.priority_id.loading = false;\n           \n                                     \n}\n",
386              "* pack" : "set_model",
387              "xtype" : "ListStore",
388              "$ columns" : "typeof(string),typeof(string)",
389              "n_columns" : 2,
390              "$ xns" : "Gtk"
391             }
392            ]
393           },
394           {
395            "label" : "Severity",
396            "Gtk.Align halign" : "Gtk.Align.START",
397            "* pack" : "attach_defaults,0,1,6,7",
398            "xtype" : "Label",
399            "x_options" : 4,
400            "$ xns" : "Gtk"
401           },
402           {
403            "* ctor" : "new Gtk.ComboBox.with_entry()",
404            "id" : "severity_id",
405            "* init" : "this.el.set_entry_text_column(1);",
406            "* pack" : "attach_defaults,0,1,7,8",
407            "xtype" : "ComboBox",
408            "# bool loading" : false,
409            "$ xns" : "Gtk",
410            "| string selectedSeverityId" : "() {\n\tGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.sevmodel.el.get_value (iter, 0, out val1);\n \n\n\treturn  (string) val1;\n\t\n\t\n\t\n\t\n}\n",
411            "items" : [
412             {
413              "| void loadSeverities" : "  () {\n\n    var rt = RooTicket.singleton();\n    //rt.loadProjects();\n    \n    _this.severity_id.loading = true;\n\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n     \n    var projects = rt.serverities;\n    foreach(var project in projects) {\n    \n        el.append(out iter);\n        \n        el.set_value(iter, 0, project.id);\n        el.set_value(iter, 1,  project.display_name );\n        if (\"normal\" == project.name) {\n\t \t   _this.severity_id.el.set_active_iter(iter);\n\t    }   \n        \n    }\n   \n    _this.severity_id.loading = false;\n     //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n",
414              "id" : "sevmodel",
415              "* pack" : "set_model",
416              "xtype" : "ListStore",
417              "$ columns" : "typeof(string),typeof(string)",
418              "n_columns" : 2,
419              "$ xns" : "Gtk"
420             }
421            ]
422           },
423           {
424            "label" : "Classification",
425            "Gtk.Align halign" : "Gtk.Align.START",
426            "* pack" : "attach_defaults,0,1,8,9",
427            "xtype" : "Label",
428            "x_options" : 4,
429            "$ xns" : "Gtk"
430           },
431           {
432            "* ctor" : "new Gtk.ComboBox.with_entry()",
433            "id" : "classification_id",
434            "* init" : "this.el.set_entry_text_column(1);",
435            "* pack" : "attach_defaults,0,1,9,10",
436            "xtype" : "ComboBox",
437            "# bool loading" : false,
438            "$ xns" : "Gtk",
439            "| string selectedClassificationId" : "() {\n\tGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.clmodel.el.get_value (iter, 0, out val1);\n \n\n\treturn  (string) val1;\n\t\n\t\n\t\n\t\n}\n",
440            "items" : [
441             {
442              "id" : "clmodel",
443              "| void loadClassifications" : "  ( ) {\n\n    var rt = RooTicket.singleton();\n    // rt.loadProjects();\n    \n    _this.classification_id.loading = true;\n\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n    el.append(out iter);\n\n     \n    var projects = rt.classifications;\n    foreach(var project in projects) {\n    \n        el.append(out iter);\n        \n        el.set_value(iter, 0, project.id);\n        el.set_value(iter, 1,  project.display_name );\n        if (\"bug\" == project.name) {\n\t \t   _this.classification_id.el.set_active_iter(iter);\n\t    }   \n        \n    }\n    \n    _this.classification_id.loading = false;\n     //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n",
444              "* pack" : "set_model",
445              "xtype" : "ListStore",
446              "$ columns" : "typeof(string),typeof(string)",
447              "n_columns" : 2,
448              "$ xns" : "Gtk"
449             }
450            ]
451           },
452           {
453            "label" : "Assign to",
454            "Gtk.Align halign" : "Gtk.Align.START",
455            "* pack" : "attach_defaults,0,1,10,11",
456            "xtype" : "Label",
457            "x_options" : 4,
458            "$ xns" : "Gtk"
459           },
460           {
461            "* ctor" : "new Gtk.ComboBox.with_entry()",
462            "id" : "developer_id",
463            "* init" : "this.el.set_entry_text_column(1);",
464            "* pack" : "attach_defaults,0,1,11,12",
465            "xtype" : "ComboBox",
466            "# bool loading" : false,
467            "| string selectedDeveloperId" : "() {\n\tGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.devmodel.el.get_value (iter, 0, out val1);\n \n\n\treturn  (string) val1;\n\t\n\t\n\t\n\t\n}\n",
468            "$ xns" : "Gtk",
469            "items" : [
470             {
471              "id" : "devmodel",
472              "* pack" : "set_model",
473              "xtype" : "ListStore",
474              "$ columns" : "typeof(string),typeof(string)",
475              "n_columns" : 2,
476              "$ xns" : "Gtk",
477              "| void loadDevelopers" : "  ( ) {\n\n    var rt = RooTicket.singleton();\n    //rt.loadProjects();\n    \n    _this.developer_id.loading = true;\n\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n    el.append(out iter);\n\n    \n    el.set_value(iter, 0, \"\");\n    el.set_value(iter, 1, \"-- select a developer --\");\n  //  if (id == \"\") {\n\t    _this.developer_id.el.set_active_iter(iter);\n   // }\n    \n    var peps = rt.developers;\n    foreach(var p in peps) {\n    \n        el.append(out iter);\n        \n        el.set_value(iter, 0, p.id);\n        el.set_value(iter, 1,  p.display_name );\n        if (rt.authuser_id == p.id) {\n\t \t   _this.developer_id.el.set_active_iter(iter);\n\t    }   \n    }\n \n    _this.developer_id.loading = false;\n     //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n"
478             }
479            ]
480           },
481           {
482            "listeners" : {
483             "clicked" : "() => {\n\tGLib.debug(\"fire response = 1\");\n\t\n\t\n\tvar invalid = false;\n\t\n\t// validate first...\n\t_this.project_id.el.get_child().get_style_context().remove_class(\"warning\");\t\n\tif (_this.project_id.selectedProjectId() == \"\") {\n\t\t_this.project_id.el.get_child().get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t_this.milestone_id.el.get_child().get_style_context().remove_class(\"warning\");\t\n\n\t_this.priority_id.el.get_child().get_style_context().remove_class(\"warning\");\t\n\tif (_this.priority_id.selectedPriorityId() == \"\") {\n\t\t_this.priority_id.el.get_child().get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t_this.classification_id.el.get_child().get_style_context().remove_class(\"warning\");\t\n\tif (_this.classification_id.selectedClassificationId() == \"\") {\n\t\t_this.classification_id.el.get_child().get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t_this.developer_id.el.get_child().get_style_context().remove_class(\"warning\");\t\n\tif (_this.developer_id.selectedDeveloperId() == \"\") {\n\t\t_this.developer_id.el.get_child().get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t_this.summary.el.get_style_context().remove_class(\"warning\");\t\n\tif (_this.summary.el.get_text() == \"\") {\n\t\t_this.summary.el.get_style_context().add_class(\"warning\");\n\t\tinvalid = true;\n\t}\n\t\n\t_this.description.el.get_style_context().remove_class(\"warning\");\t\n \n\tif (invalid) {\n\t\treturn;\n\t}\n\tGLib.debug(\"for is valid\");\n\t\n\t_this.el.response(1);\n}"
484            },
485            "label" : "Create Ticket & Branch",
486            "* init" : "{\n   this.el.get_style_context().add_class(\"suggested-action\");\n}\n",
487            "xtype" : "Button",
488            "* pack" : "attach_defaults,0,4,13,14",
489            "$ xns" : "Gtk"
490           }
491          ]
492         }
493        ]
494       },
495       {
496        "bool homogeneous" : false,
497        "* pack" : "append_page,_this.label_quick_commit.el",
498        "xtype" : "Box",
499        "$ xns" : "Gtk",
500        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
501        "items" : [
502         {
503          "bool homogeneous" : true,
504          "bool expand" : false,
505          "xtype" : "Table",
506          "* pack" : "pack_start,false,false,0",
507          "uint column_spacing" : 4,
508          "n_columns" : 5,
509          "$ xns" : "Gtk",
510          "n_rows" : 2,
511          "bool vexpand" : false,
512          "int margin" : 2,
513          "items" : [
514           {
515            "label" : "Just commit with this comment",
516            "Gtk.Align halign" : "Gtk.Align.START",
517            "xalign" : 0.90000000000000002,
518            "* pack" : "attach_defaults,0,1,0,1",
519            "xtype" : "Label",
520            "$ justify" : "Gtk.Justification.RIGHT",
521            "x_options" : 4,
522            "$ xns" : "Gtk"
523           },
524           {
525            "id" : "commit_message",
526            "$ visible" : true,
527            "xtype" : "Entry",
528            "* pack" : "attach_defaults,0,4,1,2",
529            "$ xns" : "Gtk"
530           },
531           {
532            "listeners" : {
533             "clicked" : "() => {\n\n\tGLib.debug(\"fire response = 1\");\n\t\n\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n\tif (ticket_id == \"\") {\n\t\t_this.ticketsel.el.get_child().get_style_context().add_class(\"warning\");\n\t\treturn;\n\t}\n\t \n\t_this.el.response(1);\n}"
534            },
535            "label" : "Commit Changes",
536            "id" : "createbtn",
537            "| void updateState" : "() {\n\n\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n\tif (ticket_id == \"\") {\n\t\tthis.el.set_sensitive(false);\n\t\treturn;\n\t}\n \n\tthis.el.set_sensitive(true);\n \n}\n",
538            "* init" : "{\n   this.el.get_style_context().add_class(\"suggested-action\");\n}\n",
539            "xtype" : "Button",
540            "* pack" : "attach_defaults,4,5,1,2",
541            "$ xns" : "Gtk"
542           }
543          ]
544         },
545         {
546          "int height_request" : 400,
547          "* pack" : "add",
548          "xtype" : "ScrolledWindow",
549          "$ xns" : "Gtk",
550          "bool vexpand" : true,
551          "items" : [
552           {
553            "id" : "diff_view",
554            "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);\n     var lm = Gtk.SourceLanguageManager.get_default();\n                    \n    ((Gtk.SourceBuffer)(this.el.get_buffer())).set_language(\n        lm.get_language(\"diff\")\n    );",
555            "xtype" : "View",
556            "* pack" : "add",
557            "$ xns" : "GtkSource"
558           }
559          ]
560         }
561        ]
562       }
563      ]
564     }
565    ]
566   }
567  ]
568 }