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\t GLib.debug(\"got %d\", (int) response_id);\n}",
14     "show" : "(self)  => {\n \n\n  //test\n}"
15    },
16    "default_width" : 500,
17    "$ deletable" : true,
18    "title" : "Create a working branch ",
19    "xtype" : "Dialog",
20    "|   void show" : "( ) \n{\n     // this.el.set_gravity(Gdk.Gravity.NORTH);\n     \n\tthis.el.move((Gdk.Screen.width() / 2)- 250 ,0);\n       \tGLib.debug(\"Loading tickets\"); \n \t_this.dbmodel.loadTickets();\n\n    this.el.show_all();\n\n\n \n    \n      \n}",
21    "default_height" : 200,
22    "$ xns" : "Gtk",
23    "bool modal" : true,
24    "items" : [
25     {
26      "xtype" : "VBox",
27      "$ pack" : "get_content_area().add",
28      "$ xns" : "Gtk",
29      "items" : [
30       {
31        "bool homogeneous" : false,
32        "* pack" : "pack_start,false,false,0",
33        "xtype" : "Table",
34        "uint column_spacing" : 2,
35        "n_columns" : 2,
36        "$ xns" : "Gtk",
37        "n_rows" : 2,
38        "int margin" : 2,
39        "items" : [
40         {
41          "label" : "Select Ticket",
42          "$ visible" : true,
43          "xalign" : 0.90000000000000002,
44          "* pack" : "attach_defaults,0,1,0,1",
45          "xtype" : "Label",
46          "$ justify" : "Gtk.Justification.RIGHT",
47          "x_options" : 4,
48          "$ xns" : "Gtk"
49         },
50         {
51          "listeners" : {
52           "changed" : "() => {\n\tGtk.TreeIter iter;\n\tValue val1;\n\tValue val2;\n \n\tthis.el.get_active_iter (out iter);\n\t_this.dbmodel.el.get_value (iter, 0, out val1);\n\t_this.dbmodel.el.get_value (iter, 1, out val2);\n\n\tvar ticket_id = (string) val1;\n\t\n\tif (ticket_id == \"\") {\n\t\t_this.name.el.set_text(\"wip_NAME_DATE\");\n\t\treturn;\n\t}\n\tvar ticket = RooTicket.singleton().getById(ticket_id);\n   \n\t_this.name.el.set_text(\"wip_NAME_T%s_%s\".printf(ticket.id, ticket.summaryToBranchName());\n\t\n\t//GLib.debug (\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n}"
53          },
54          "id" : "build_module",
55          "* init" : "this.el.add_attribute(_this.dbcellrenderer.el , \"markup\", 1 );",
56          "* pack" : "attach_defaults,1,2,0,1",
57          "xtype" : "ComboBox",
58          "$ xns" : "Gtk",
59          "items" : [
60           {
61            "id" : "dbcellrenderer",
62            "xtype" : "CellRendererText",
63            "* pack" : "pack_start,true",
64            "$ xns" : "Gtk"
65           },
66           {
67            "id" : "dbmodel",
68            "xtype" : "ListStore",
69            "* pack" : "set_model",
70            "| void loadTickets" : "  () {\n\n    RooTicket.singleton().loadTickets();\n    \n    \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.build_module.el.set_active_iter(iter);\n    var tickets = RooTicket.singleton().tickets;\n    foreach(var ticket in tickets) {\n    \n\n        el.append(out iter);\n        \n        el.set_value(iter, 0, ticket.id);\n        el.set_value(iter, 1, \"#%s [%s] %s\".printf( ticket.id, ticket.project_id_name , ticket.summary));\n        \n        //if (data.get(i) == cur) {\n         //   _this.build_module.el.set_active_iter(iter);\n       // }\n        \n    }\n     //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n",
71            "$ columns" : "typeof(string),typeof(string)",
72            "n_columns" : 2,
73            "$ xns" : "Gtk"
74           }
75          ]
76         },
77         {
78          "label" : "or use this as branch name",
79          "xalign" : 0.90000000000000002,
80          "* pack" : "attach_defaults,0,1,1,2",
81          "xtype" : "Label",
82          "$ justify" : "Gtk.Justification.RIGHT",
83          "x_options" : 4,
84          "$ xns" : "Gtk"
85         },
86         {
87          "id" : "name",
88          "$ visible" : true,
89          "xtype" : "Entry",
90          "* pack" : "attach_defaults,1,2,1,2",
91          "$ xns" : "Gtk"
92         }
93        ]
94       }
95      ]
96     },
97     {
98      "label" : "Do not create Branch",
99      "xtype" : "Button",
100      "* pack" : "add_action_widget,0",
101      "Gtk.ReliefStyle relief" : "Gtk.ReliefStyle.NONE",
102      "$ xns" : "Gtk"
103     },
104     {
105      "label" : "Create Branch",
106      "xtype" : "Button",
107      "* pack" : "add_action_widget,1",
108      "$ xns" : "Gtk"
109     }
110    ]
111   }
112  ]
113 }