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);
71 public class Xcls_VBox2 : Object
74 private NewBranch _this;
80 public Xcls_VBox2(NewBranch _owner )
83 this.el = new Gtk.VBox( true, 0 );
88 var child_0 = new Xcls_Table3( _this );
90 this.el.pack_start ( child_0.el , false,false,0 );
93 // user defined functions
95 public class Xcls_Table3 : Object
98 private NewBranch _this;
104 public Xcls_Table3(NewBranch _owner )
107 this.el = new Gtk.Table( 2, 2, true );
111 // set gobject values
112 var child_0 = new Xcls_Label4( _this );
114 this.el.attach_defaults ( child_0.el , 0,1,0,1 );
115 var child_1 = new Xcls_build_module( _this );
117 this.el.attach_defaults ( child_1.el , 1,2,0,1 );
118 var child_2 = new Xcls_Label8( _this );
120 this.el.attach_defaults ( child_2.el , 0,1,1,2 );
121 var child_3 = new Xcls_name( _this );
123 this.el.attach_defaults ( child_3.el , 1,2,1,2 );
126 // user defined functions
128 public class Xcls_Label4 : Object
131 private NewBranch _this;
137 public Xcls_Label4(NewBranch _owner )
140 this.el = new Gtk.Label( "Select Ticket" );
144 // set gobject values
145 this.el.justify = Gtk.Justification.RIGHT;
146 this.el.xalign = 0.900000f;
147 this.el.visible = true;
150 // user defined functions
153 public class Xcls_build_module : Object
155 public Gtk.ComboBox el;
156 private NewBranch _this;
162 public Xcls_build_module(NewBranch _owner )
165 _this.build_module = this;
166 this.el = new Gtk.ComboBox();
170 // set gobject values
171 var child_0 = new Xcls_dbcellrenderer( _this );
173 this.el.pack_start ( child_0.el , true );
174 var child_1 = new Xcls_dbmodel( _this );
176 this.el.set_model ( child_1.el );
180 this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
183 // user defined functions
185 public class Xcls_dbcellrenderer : Object
187 public Gtk.CellRendererText el;
188 private NewBranch _this;
194 public Xcls_dbcellrenderer(NewBranch _owner )
197 _this.dbcellrenderer = this;
198 this.el = new Gtk.CellRendererText();
202 // set gobject values
205 // user defined functions
208 public class Xcls_dbmodel : Object
210 public Gtk.ListStore el;
211 private NewBranch _this;
217 public Xcls_dbmodel(NewBranch _owner )
220 _this.dbmodel = this;
221 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
225 // set gobject values
228 // user defined functions
229 public void loadTickets () {
231 RooTicket.singleton().loadTickets();
242 el.set_value(iter, 0, "");
243 el.set_value(iter, 1, "-- select a ticket --");
245 _this.build_module.el.set_active_iter(iter);
246 var tickets = RooTicket.singleton().tickets;
247 foreach(var ticket in tickets) {
252 el.set_value(iter, 0, ticket.id);
253 el.set_value(iter, 1, "#%s %s %s".printf( ticket.id, ticket.project_id_name , ticket.summary));
255 //if (data.get(i) == cur) {
256 // _this.build_module.el.set_active_iter(iter);
260 //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
266 public class Xcls_Label8 : Object
269 private NewBranch _this;
275 public Xcls_Label8(NewBranch _owner )
278 this.el = new Gtk.Label( "or use this as branch name" );
282 // set gobject values
283 this.el.justify = Gtk.Justification.RIGHT;
284 this.el.xalign = 0.900000f;
287 // user defined functions
290 public class Xcls_name : Object
293 private NewBranch _this;
299 public Xcls_name(NewBranch _owner )
303 this.el = new Gtk.Entry();
307 // set gobject values
308 this.el.visible = true;
311 // user defined functions
316 public class Xcls_Button10 : Object
318 public Gtk.Button el;
319 private NewBranch _this;
325 public Xcls_Button10(NewBranch _owner )
328 this.el = new Gtk.Button();
332 // set gobject values
333 this.el.relief = Gtk.ReliefStyle.NONE;
334 this.el.label = "Do not create Branch";
337 // user defined functions
340 public class Xcls_Button11 : Object
342 public Gtk.Button el;
343 private NewBranch _this;
349 public Xcls_Button11(NewBranch _owner )
352 this.el = new Gtk.Button();
356 // set gobject values
357 this.el.label = "Create Branch";
360 // user defined functions