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