NewBranch.bjs
[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\tswitch(response_id) {\n\t\tcase 1: \n\t\n\t\t\t\n\t\t\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\t\t\n\t\t\tif (this.repo != null) {\n\t\t\t\tvar bn = _this.name.el.get_text();\n\n\t\t\t\tvar res = this.repo.setActiveTicket(\t\t\t\n\t\t\t\t\t RooTicket.singleton().getById(ticket_id != \"\" ? ticket_id : \"-1\"), bn\n\t\t\t\t );\n\t\t\t\t if (res) {\n\t\t\t\t \t// start the monitoring..\n\t\t\t\t \t GitMonitor.gitmonitor.start();\n\t\t\t\t \t \n\t\t\t\t }\n\t\t\t}\n     \t\tbreak;\n \t\tcase 2: // create ticket + branch\n\t \t\tbreak;\n \t\t\n \t\tcase 3: // just commit...\n \t\t\n \t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\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\t\n\t\n\tthis.queue = queue;\n\tthis.running  = true;\n\tGitMonitor.gitmonitor.stop();\n\t\n\t\n    this.repo = repo;\n\tthis.el.move((Gdk.Screen.width() / 2)- 250 ,0);\n\tthis.el.set_default_size( 500,200); // not sure why it grows..\n\t\n\t\n\t\n\t\n     \n\n    this.el.show_all();\n    this.el.set_keep_above(true);\n\t\n\t_this.notebook.el.set_current_page(0);\n\t\n\t_this.select_ticket_tab.load_data(tid);\n\t//_this.create_ticket_tab.load_data();\n\t//_this.quick_commit_tab.load_data();\n     _this.commit_message.el.set_text(\"\");\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      "listeners" : {
29       "switch_page" : "(page, page_num) => {\n\tGLib.debug(\"Switch to page: %d\", (int)page_num);\n\tswitch(page_num) {\n\t\tcase 0: \n\t\t\tbreak; // do nothing.. it's already loaded at start.\n\t\tcase 1: \n\t\t\t_this.create_ticket_tab.load_data();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t_this.quick_commit_tab.load_data();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n}\n"
30      },
31      "id" : "notebook",
32      "* pack" : "get_content_area().add",
33      "xtype" : "Notebook",
34      "$ xns" : "Gtk",
35      "bool vexpand" : true,
36      "items" : [
37       {
38        "id" : "label_select_ticket",
39        "* pack" : false,
40        "xtype" : "Label",
41        "string label" : "Select Existing Ticket to work on",
42        "$ xns" : "Gtk"
43       },
44       {
45        "id" : "label_create_ticket",
46        "xtype" : "Label",
47        "* pack" : false,
48        "string label" : "Create a New Ticket",
49        "$ xns" : "Gtk"
50       },
51       {
52        "id" : "label_quick_commit",
53        "* pack" : false,
54        "xtype" : "Label",
55        "string label" : "Quick Commit",
56        "$ xns" : "Gtk"
57       },
58       {
59        "id" : "select_ticket_tab",
60        "bool homogeneous" : false,
61        "* pack" : "append_page,_this.label_select_ticket.el",
62        "xtype" : "Box",
63        "| void load_data" : "(string tid = \"\") {\n\n    GLib.debug(\"Loading tickets\"); \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.branchbtn.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",
64        "$ xns" : "Gtk",
65        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
66        "items" : [
67         {
68          "bool homogeneous" : true,
69          "bool expand" : false,
70          "xtype" : "Table",
71          "* pack" : "pack_start,false,false,0",
72          "uint column_spacing" : 4,
73          "n_columns" : 5,
74          "$ xns" : "Gtk",
75          "n_rows" : 5,
76          "bool vexpand" : false,
77          "int margin" : 2,
78          "items" : [
79           {
80            "label" : "Project",
81            "$ visible" : true,
82            "Gtk.Align halign" : "Gtk.Align.START",
83            "* pack" : "attach_defaults,0,1,0,1",
84            "xtype" : "Label",
85            "$ justify" : "Gtk.Justification.RIGHT",
86            "x_options" : 4,
87            "$ xns" : "Gtk"
88           },
89           {
90            "label" : "Ticket",
91            "$ visible" : true,
92            "Gtk.Align halign" : "Gtk.Align.START",
93            "* pack" : "attach_defaults,1,2,0,1",
94            "xtype" : "Label",
95            "x_options" : 4,
96            "$ xns" : "Gtk"
97           },
98           {
99            "listeners" : {
100             "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}"
101            },
102            "* ctor" : "new Gtk.ComboBox.with_entry()",
103            "| 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",
104            "id" : "projectsel",
105            "* init" : "this.el.set_entry_text_column(1);",
106            "* pack" : "attach_defaults,0,1,1,2",
107            "xtype" : "ComboBox",
108            "# bool loading" : false,
109            "$ xns" : "Gtk",
110            "items" : [
111             {
112              "id" : "prcellrenderer",
113              "* pack" : "pack_start,true",
114              "xtype" : "CellRendererText",
115              "$ xns" : "Gtk"
116             },
117             {
118              "| 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",
119              "id" : "prmodel",
120              "* pack" : "set_model",
121              "xtype" : "ListStore",
122              "$ columns" : "typeof(string),typeof(string)",
123              "n_columns" : 2,
124              "$ xns" : "Gtk"
125             }
126            ]
127           },
128           {
129            "listeners" : {
130             "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.branchbtn.updateState();\n\t\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n}"
131            },
132            "* ctor" : "new Gtk.ComboBox.with_entry()",
133            "id" : "ticketsel",
134            "* init" : "//this.el.add_attribute(_this.dbcellrenderer.el , \"markup\", 1 );\nthis.el.set_entry_text_column(1);\nthis.el.get_child().set_sensitive(false); ",
135            "* pack" : "attach_defaults,1,5,1,2",
136            "xtype" : "ComboBox",
137            "# bool loading" : false,
138            "$ xns" : "Gtk",
139            "| 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",
140            "items" : [
141             {
142              "id" : "dbcellrenderer",
143              "xtype" : "CellRendererText",
144              "* pack" : "pack_start,true",
145              "$ xns" : "Gtk"
146             },
147             {
148              "id" : "dbmodel",
149              "xtype" : "ListStore",
150              "* pack" : "set_model",
151              "| 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",
152              "$ columns" : "typeof(string),typeof(string)",
153              "n_columns" : 2,
154              "$ xns" : "Gtk"
155             }
156            ]
157           },
158           {
159            "label" : "Use this as branch name",
160            "Gtk.Align halign" : "Gtk.Align.START",
161            "xalign" : 0.90000000000000002,
162            "* pack" : "attach_defaults,0,1,3,4",
163            "xtype" : "Label",
164            "$ justify" : "Gtk.Justification.RIGHT",
165            "x_options" : 4,
166            "$ xns" : "Gtk"
167           },
168           {
169            "id" : "name",
170            "$ visible" : true,
171            "xtype" : "Entry",
172            "* pack" : "attach_defaults,0,4,4,5",
173            "$ xns" : "Gtk"
174           },
175           {
176            "listeners" : {
177             "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}"
178            },
179            "label" : "Create Branch",
180            "| 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",
181            "id" : "branchbtn",
182            "* init" : "{\n   this.el.get_style_context().add_class(\"suggested-action\");\n}\n",
183            "xtype" : "Button",
184            "* pack" : "attach_defaults,4,5,4,5",
185            "$ xns" : "Gtk"
186           },
187           {
188            "* pack" : "attach_defaults,0,5,2,3",
189            "xtype" : "Box",
190            "$ xns" : "Gtk",
191            "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
192            "items" : [
193             {
194              "listeners" : {
195               "toggled" : "() => {\n\tvar project_id = _this.projectsel.selectedProjectId();\n\t_this.dbmodel.loadTickets(project_id);\t\n}"
196              },
197              "id" : "btn_not_me",
198              "* pack" : "add",
199              "string label" : "Show tickets not assigned to me",
200              "xtype" : "CheckButton",
201              "$ xns" : "Gtk"
202             },
203             {
204              "listeners" : {
205               "toggled" : "() => {\n \tvar project_id = _this.projectsel.selectedProjectId();\n\t_this.dbmodel.loadTickets(project_id);\t\n\t \n}"
206              },
207              "id" : "btn_closed",
208              "string label" : "Show closed Tickets",
209              "xtype" : "CheckButton",
210              "* pack" : "add",
211              "$ xns" : "Gtk"
212             },
213             {
214              "listeners" : {
215               "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}"
216              },
217              "bool use_markup" : true,
218              "Gtk.Align halign" : "Gtk.Align.END",
219              "bool hexpand" : true,
220              "* pack" : "add",
221              "xtype" : "Label",
222              "string label" : "<a href=\"refresh\">Refresh Ticket list</a>",
223              "$ xns" : "Gtk"
224             }
225            ]
226           }
227          ]
228         },
229         {
230          "int height_request" : 500,
231          "id" : "scrolled_window",
232          "* init" : "{\n\tthis.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n}\n",
233          "* pack" : "add",
234          "xtype" : "ScrolledWindow",
235          "$ xns" : "Gtk",
236          "bool vexpand" : true,
237          "items" : [
238           {
239            "id" : "view",
240            "* pack" : "add",
241            "xtype" : "WebView",
242            "$ xns" : "WebKit",
243            "| 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"
244           }
245          ]
246         }
247        ]
248       },
249       {
250        "id" : "create_ticket_tab",
251        "bool homogeneous" : false,
252        "xtype" : "Box",
253        "* pack" : "append_page,_this.label_create_ticket.el",
254        "| void load_data" : "() {\n \n \t _this.table.el.hide();\n\t_this.spinner.el.show();\n\t_this.spinner.el.start();\t\n\t\n    Timeout.add_seconds(1, () => {\n\t\t \n\t\tRooProject? curproj = null;\n\t\tif (_this.repo != null) {\n\t\t\tcurproj = RooProject.getProjectByRepo(_this.repo);\n\t\t}\n\t\t_this.tprmodel.loadProjects(curproj == null ? \"\" : curproj.id);\n\t\tif (curproj != null) {\n\t \n\t\t\t\n\t\t\tvar rt = RooTicket.singleton();\n\t\t\trt.loadProjectOptions(curproj.id);\n\t\t\t\n\t\t\t_this.msmodel.loadMilestones();\n\t\t\t_this.primodel.loadPriorities();\n\t\t\t_this.sevmodel.loadSeverities();\n\t\t\t_this.clmodel.loadClassifications();\t\n\t\t\t_this.devmodel.loadDevelopers();\t\n\t\t\t\n\t\t}\n\t\t_this.summary.el.set_text(\"\");\n\t\t_this.description.el.buffer.text = \"\"; \n\t\t_this.spinner.el.stop();\n\t\t_this.spinner.el.hide();\t\n\n\t\t_this.table.el.show();\n\t    //_this.summary.el.grab_focus();\n \n\t \treturn false;\n \t});\n}\n",
255        "$ xns" : "Gtk",
256        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
257        "items" : [
258         {
259          "id" : "table",
260          "bool homogeneous" : true,
261          "bool expand" : false,
262          "xtype" : "Table",
263          "* pack" : "pack_start,false,false,0",
264          "uint column_spacing" : 4,
265          "n_columns" : 4,
266          "$ xns" : "Gtk",
267          "n_rows" : 14,
268          "bool vexpand" : false,
269          "int margin" : 2,
270          "items" : [
271           {
272            "label" : "Project",
273            "$ visible" : true,
274            "Gtk.Align halign" : "Gtk.Align.START",
275            "* pack" : "attach_defaults,0,1,0,1",
276            "xtype" : "Label",
277            "$ xns" : "Gtk"
278           },
279           {
280            "label" : "Summary",
281            "$ visible" : true,
282            "Gtk.Align halign" : "Gtk.Align.START",
283            "* pack" : "attach_defaults,1,2,0,1",
284            "xtype" : "Label",
285            "x_options" : 4,
286            "$ xns" : "Gtk"
287           },
288           {
289            "listeners" : {
290             "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}"
291            },
292            "* ctor" : "new Gtk.ComboBox.with_entry()",
293            "id" : "project_id",
294            "| string selectedProjectId" : "() {\n\tGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.tprmodel.el.get_value (iter, 0, out val1);\n \n\n\treturn  (string) val1;\n\t\n\t\n\t\n\t\n}\n",
295            "* init" : "this.el.set_entry_text_column(1);",
296            "* pack" : "attach_defaults,0,1,1,2",
297            "xtype" : "ComboBox",
298            "# bool loading" : false,
299            "$ xns" : "Gtk",
300            "items" : [
301             {
302              "id" : "tprcellrenderer",
303              "xtype" : "CellRendererText",
304              "* pack" : "pack_start,true",
305              "$ xns" : "Gtk"
306             },
307             {
308              "| 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",
309              "id" : "tprmodel",
310              "* pack" : "set_model",
311              "xtype" : "ListStore",
312              "$ columns" : "typeof(string),typeof(string)",
313              "n_columns" : 2,
314              "$ xns" : "Gtk"
315             }
316            ]
317           },
318           {
319            "id" : "summary",
320            "$ visible" : true,
321            "xtype" : "Entry",
322            "* pack" : "attach_defaults,1,4,1,2",
323            "$ xns" : "Gtk"
324           },
325           {
326            "label" : "Milestone",
327            "Gtk.Align halign" : "Gtk.Align.START",
328            "xalign" : 0.90000000000000002,
329            "* pack" : "attach_defaults,0,1,2,3",
330            "xtype" : "Label",
331            "$ justify" : "Gtk.Justification.RIGHT",
332            "x_options" : 4,
333            "$ xns" : "Gtk"
334           },
335           {
336            "* ctor" : "new Gtk.ComboBox.with_entry()",
337            "id" : "milestone_id",
338            "* init" : "this.el.set_entry_text_column(1);",
339            "* pack" : "attach_defaults,0,1,3,4",
340            "xtype" : "ComboBox",
341            "# bool loading" : false,
342            "$ xns" : "Gtk",
343            "| 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",
344            "items" : [
345             {
346              "id" : "msmodel",
347              "* pack" : "set_model",
348              "xtype" : "ListStore",
349              "| 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",
350              "$ columns" : "typeof(string),typeof(string)",
351              "n_columns" : 2,
352              "$ xns" : "Gtk"
353             }
354            ]
355           },
356           {
357            "label" : "Description",
358            "Gtk.Align halign" : "Gtk.Align.START",
359            "* pack" : "attach_defaults,1,4,2,3",
360            "xtype" : "Label",
361            "x_options" : 4,
362            "$ xns" : "Gtk"
363           },
364           {
365            "id" : "description",
366            "* pack" : "attach_defaults,1,4,3,12",
367            "xtype" : "TextView",
368            "$ xns" : "Gtk",
369            "uint border_width" : 1
370           },
371           {
372            "label" : "Priority",
373            "Gtk.Align halign" : "Gtk.Align.START",
374            "xalign" : 0.90000000000000002,
375            "* pack" : "attach_defaults,0,1,4,5",
376            "xtype" : "Label",
377            "x_options" : 4,
378            "$ xns" : "Gtk"
379           },
380           {
381            "* ctor" : "new Gtk.ComboBox.with_entry()",
382            "id" : "priority_id",
383            "* init" : "this.el.set_entry_text_column(1);",
384            "* pack" : "attach_defaults,0,1,5,6",
385            "xtype" : "ComboBox",
386            "# bool loading" : false,
387            "$ xns" : "Gtk",
388            "| 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",
389            "items" : [
390             {
391              "id" : "primodel",
392              "| 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",
393              "* pack" : "set_model",
394              "xtype" : "ListStore",
395              "$ columns" : "typeof(string),typeof(string)",
396              "n_columns" : 2,
397              "$ xns" : "Gtk"
398             }
399            ]
400           },
401           {
402            "label" : "Severity",
403            "Gtk.Align halign" : "Gtk.Align.START",
404            "* pack" : "attach_defaults,0,1,6,7",
405            "xtype" : "Label",
406            "x_options" : 4,
407            "$ xns" : "Gtk"
408           },
409           {
410            "* ctor" : "new Gtk.ComboBox.with_entry()",
411            "id" : "severity_id",
412            "* init" : "this.el.set_entry_text_column(1);",
413            "* pack" : "attach_defaults,0,1,7,8",
414            "xtype" : "ComboBox",
415            "# bool loading" : false,
416            "$ xns" : "Gtk",
417            "| 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",
418            "items" : [
419             {
420              "| 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",
421              "id" : "sevmodel",
422              "* pack" : "set_model",
423              "xtype" : "ListStore",
424              "$ columns" : "typeof(string),typeof(string)",
425              "n_columns" : 2,
426              "$ xns" : "Gtk"
427             }
428            ]
429           },
430           {
431            "label" : "Classification",
432            "Gtk.Align halign" : "Gtk.Align.START",
433            "* pack" : "attach_defaults,0,1,8,9",
434            "xtype" : "Label",
435            "x_options" : 4,
436            "$ xns" : "Gtk"
437           },
438           {
439            "* ctor" : "new Gtk.ComboBox.with_entry()",
440            "id" : "classification_id",
441            "* init" : "this.el.set_entry_text_column(1);",
442            "* pack" : "attach_defaults,0,1,9,10",
443            "xtype" : "ComboBox",
444            "# bool loading" : false,
445            "$ xns" : "Gtk",
446            "| 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",
447            "items" : [
448             {
449              "id" : "clmodel",
450              "| 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",
451              "* pack" : "set_model",
452              "xtype" : "ListStore",
453              "$ columns" : "typeof(string),typeof(string)",
454              "n_columns" : 2,
455              "$ xns" : "Gtk"
456             }
457            ]
458           },
459           {
460            "label" : "Assign to",
461            "Gtk.Align halign" : "Gtk.Align.START",
462            "* pack" : "attach_defaults,0,1,10,11",
463            "xtype" : "Label",
464            "x_options" : 4,
465            "$ xns" : "Gtk"
466           },
467           {
468            "* ctor" : "new Gtk.ComboBox.with_entry()",
469            "id" : "developer_id",
470            "* init" : "this.el.set_entry_text_column(1);",
471            "* pack" : "attach_defaults,0,1,11,12",
472            "xtype" : "ComboBox",
473            "# bool loading" : false,
474            "| 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",
475            "$ xns" : "Gtk",
476            "items" : [
477             {
478              "id" : "devmodel",
479              "* pack" : "set_model",
480              "xtype" : "ListStore",
481              "$ columns" : "typeof(string),typeof(string)",
482              "n_columns" : 2,
483              "$ xns" : "Gtk",
484              "| 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"
485             }
486            ]
487           },
488           {
489            "listeners" : {
490             "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}"
491            },
492            "label" : "Create Ticket & Branch",
493            "* init" : "{\n   this.el.get_style_context().add_class(\"suggested-action\");\n}\n",
494            "xtype" : "Button",
495            "* pack" : "attach_defaults,0,4,13,14",
496            "$ xns" : "Gtk"
497           }
498          ]
499         },
500         {
501          "id" : "spinner",
502          "bool hexpand" : true,
503          "* pack" : "add",
504          "xtype" : "Spinner",
505          "$ xns" : "Gtk",
506          "bool vexpand" : true
507         }
508        ]
509       },
510       {
511        "id" : "quick_commit_tab",
512        "bool homogeneous" : false,
513        "* pack" : "append_page,_this.label_quick_commit.el",
514        "xtype" : "Box",
515        "| void load_data" : "() {\n\n  _this.createbtn.updateState();\n}\n",
516        "$ xns" : "Gtk",
517        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
518        "items" : [
519         {
520          "bool homogeneous" : true,
521          "bool expand" : false,
522          "xtype" : "Table",
523          "* pack" : "pack_start,false,false,0",
524          "uint column_spacing" : 4,
525          "n_columns" : 5,
526          "$ xns" : "Gtk",
527          "n_rows" : 3,
528          "bool vexpand" : false,
529          "int margin" : 2,
530          "items" : [
531           {
532            "label" : "Just commit with this comment",
533            "Gtk.Align halign" : "Gtk.Align.START",
534            "xalign" : 0.90000000000000002,
535            "* pack" : "attach_defaults,0,1,0,1",
536            "xtype" : "Label",
537            "$ justify" : "Gtk.Justification.RIGHT",
538            "x_options" : 4,
539            "$ xns" : "Gtk"
540           },
541           {
542            "listeners" : {
543             "key_release_event" : "() => { \n\n\t_this.createbtn.updateState();\n\treturn true;\n}"
544            },
545            "id" : "commit_message",
546            "$ visible" : true,
547            "xtype" : "Entry",
548            "* pack" : "attach_defaults,0,5,1,2",
549            "$ xns" : "Gtk"
550           },
551           {
552            "listeners" : {
553             "clicked" : "() => {\n\n\tGLib.debug(\"fire response = 1\");\n\t\n\t \n\t \n\t_this.el.response(3);\n}"
554            },
555            "label" : "Commit Changes",
556            "id" : "createbtn",
557            "| void updateState" : "() {\n\n\tvar msg = _this.commit_message.el.get_text();\n\t\n\tif (msg == \"\") {\n\t\tthis.el.set_sensitive(false);\n\t\treturn;\n\t}\n \n\tthis.el.set_sensitive(true);\n \n}\n",
558            "* init" : "{\n   this.el.get_style_context().add_class(\"suggested-action\");\n}\n",
559            "xtype" : "Button",
560            "* pack" : "attach_defaults,0,5,2,3",
561            "$ xns" : "Gtk"
562           }
563          ]
564         },
565         {
566          "int height_request" : 400,
567          "* pack" : "add",
568          "xtype" : "ScrolledWindow",
569          "$ xns" : "Gtk",
570          "bool vexpand" : true,
571          "items" : [
572           {
573            "id" : "diff_view",
574            "* 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    );",
575            "xtype" : "View",
576            "* pack" : "add",
577            "$ xns" : "GtkSource"
578           }
579          ]
580         }
581        ]
582       }
583      ]
584     }
585    ]
586   }
587  ]
588 }