1 static NewBranch _NewBranch;
3 public class NewBranch : Object
6 private NewBranch _this;
8 public static NewBranch singleton()
10 if (_NewBranch == null) {
11 _NewBranch= new NewBranch();
15 public Xcls_build_module build_module;
16 public Xcls_dbcellrenderer dbcellrenderer;
17 public Xcls_dbmodel dbmodel;
18 public Xcls_name name;
26 this.el = new Gtk.Dialog();
31 this.el.title = "Create a working branch ";
32 this.el.default_height = 200;
33 this.el.default_width = 500;
34 this.el.deletable = true;
36 var child_0 = new Xcls_VBox2( _this );
38 this.el.get_content_area().add ( child_0.el );
39 var child_1 = new Xcls_Button10( _this );
41 this.el.add_action_widget ( child_1.el , 0 );
42 var child_2 = new Xcls_Button11( _this );
44 this.el.add_action_widget ( child_2.el , 1 );
47 this.el.delete_event.connect( (self, event) => {
52 this.el.response.connect( (self, response_id) => {
54 GLib.debug("got %d", (int) response_id);
56 this.el.show.connect( (self) => {
63 // user defined functions
66 // this.el.set_gravity(Gdk.Gravity.NORTH);
68 this.el.move((Gdk.Screen.width() / 2)- 250 ,0);
69 GLib.debug("Loading tickets");
70 _this.dbmodel.loadTickets();
79 public class Xcls_VBox2 : Object
82 private NewBranch _this;
88 public Xcls_VBox2(NewBranch _owner )
91 this.el = new Gtk.VBox( true, 0 );
96 var child_0 = new Xcls_Table3( _this );
98 this.el.pack_start ( child_0.el , false,false,0 );
101 // user defined functions
103 public class Xcls_Table3 : Object
106 private NewBranch _this;
112 public Xcls_Table3(NewBranch _owner )
115 this.el = new Gtk.Table( 2, 2, true );
119 // set gobject values
120 var child_0 = new Xcls_Label4( _this );
122 this.el.attach_defaults ( child_0.el , 0,1,0,1 );
123 var child_1 = new Xcls_build_module( _this );
125 this.el.attach_defaults ( child_1.el , 1,2,0,1 );
126 var child_2 = new Xcls_Label8( _this );
128 this.el.attach_defaults ( child_2.el , 0,1,1,2 );
129 var child_3 = new Xcls_name( _this );
131 this.el.attach_defaults ( child_3.el , 1,2,1,2 );
134 // user defined functions
136 public class Xcls_Label4 : Object
139 private NewBranch _this;
145 public Xcls_Label4(NewBranch _owner )
148 this.el = new Gtk.Label( "Select Ticket" );
152 // set gobject values
153 this.el.justify = Gtk.Justification.RIGHT;
154 this.el.xalign = 0.900000f;
155 this.el.visible = true;
158 // user defined functions
161 public class Xcls_build_module : Object
163 public Gtk.ComboBox el;
164 private NewBranch _this;
170 public Xcls_build_module(NewBranch _owner )
173 _this.build_module = this;
174 this.el = new Gtk.ComboBox();
178 // set gobject values
179 var child_0 = new Xcls_dbcellrenderer( _this );
181 this.el.pack_start ( child_0.el , true );
182 var child_1 = new Xcls_dbmodel( _this );
184 this.el.set_model ( child_1.el );
188 this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
191 // user defined functions
193 public class Xcls_dbcellrenderer : Object
195 public Gtk.CellRendererText el;
196 private NewBranch _this;
202 public Xcls_dbcellrenderer(NewBranch _owner )
205 _this.dbcellrenderer = this;
206 this.el = new Gtk.CellRendererText();
210 // set gobject values
213 // user defined functions
216 public class Xcls_dbmodel : Object
218 public Gtk.ListStore el;
219 private NewBranch _this;
225 public Xcls_dbmodel(NewBranch _owner )
228 _this.dbmodel = this;
229 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
233 // set gobject values
236 // user defined functions
237 public void loadTickets () {
239 RooTicket.singleton().loadTickets();
250 el.set_value(iter, 0, "");
251 el.set_value(iter, 1, "-- select a ticket --");
253 _this.build_module.el.set_active_iter(iter);
254 var tickets = RooTicket.singleton().tickets;
255 foreach(var ticket in tickets) {
260 el.set_value(iter, 0, ticket.id);
261 el.set_value(iter, 1, "#%s [%s] %s".printf( ticket.id, ticket.project_id_name , ticket.summary));
263 //if (data.get(i) == cur) {
264 // _this.build_module.el.set_active_iter(iter);
268 //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
274 public class Xcls_Label8 : Object
277 private NewBranch _this;
283 public Xcls_Label8(NewBranch _owner )
286 this.el = new Gtk.Label( "or use this as branch name" );
290 // set gobject values
291 this.el.justify = Gtk.Justification.RIGHT;
292 this.el.xalign = 0.900000f;
295 // user defined functions
298 public class Xcls_name : Object
301 private NewBranch _this;
307 public Xcls_name(NewBranch _owner )
311 this.el = new Gtk.Entry();
315 // set gobject values
316 this.el.visible = true;
319 // user defined functions
324 public class Xcls_Button10 : Object
326 public Gtk.Button el;
327 private NewBranch _this;
333 public Xcls_Button10(NewBranch _owner )
336 this.el = new Gtk.Button();
340 // set gobject values
341 this.el.relief = Gtk.ReliefStyle.NONE;
342 this.el.label = "Do not create Branch";
345 // user defined functions
348 public class Xcls_Button11 : Object
350 public Gtk.Button el;
351 private NewBranch _this;
357 public Xcls_Button11(NewBranch _owner )
360 this.el = new Gtk.Button();
364 // set gobject values
365 this.el.label = "Create Branch";
368 // user defined functions