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) => {
62 // user defined functions
65 // this.el.set_gravity(Gdk.Gravity.NORTH);
66 this.el.move((Gdk.Screen.width() / 2)- 250 ,0);
70 public class Xcls_VBox2 : Object
73 private NewBranch _this;
79 public Xcls_VBox2(NewBranch _owner )
82 this.el = new Gtk.VBox( true, 0 );
87 var child_0 = new Xcls_Table3( _this );
89 this.el.pack_start ( child_0.el , false,false,0 );
92 // user defined functions
94 public class Xcls_Table3 : Object
97 private NewBranch _this;
103 public Xcls_Table3(NewBranch _owner )
106 this.el = new Gtk.Table( 2, 2, true );
110 // set gobject values
111 var child_0 = new Xcls_Label4( _this );
113 this.el.attach_defaults ( child_0.el , 0,1,0,1 );
114 var child_1 = new Xcls_build_module( _this );
116 this.el.attach_defaults ( child_1.el , 1,2,0,1 );
117 var child_2 = new Xcls_Label8( _this );
119 this.el.attach_defaults ( child_2.el , 0,1,1,2 );
120 var child_3 = new Xcls_name( _this );
122 this.el.attach_defaults ( child_3.el , 1,2,1,2 );
125 // user defined functions
127 public class Xcls_Label4 : Object
130 private NewBranch _this;
136 public Xcls_Label4(NewBranch _owner )
139 this.el = new Gtk.Label( "Select Ticket" );
143 // set gobject values
144 this.el.justify = Gtk.Justification.RIGHT;
145 this.el.xalign = 0.900000f;
146 this.el.visible = true;
149 // user defined functions
152 public class Xcls_build_module : Object
154 public Gtk.ComboBox el;
155 private NewBranch _this;
161 public Xcls_build_module(NewBranch _owner )
164 _this.build_module = this;
165 this.el = new Gtk.ComboBox();
169 // set gobject values
170 var child_0 = new Xcls_dbcellrenderer( _this );
172 this.el.pack_start ( child_0.el , true );
173 var child_1 = new Xcls_dbmodel( _this );
175 this.el.set_model ( child_1.el );
179 this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
182 // user defined functions
184 public class Xcls_dbcellrenderer : Object
186 public Gtk.CellRendererText el;
187 private NewBranch _this;
193 public Xcls_dbcellrenderer(NewBranch _owner )
196 _this.dbcellrenderer = this;
197 this.el = new Gtk.CellRendererText();
201 // set gobject values
204 // user defined functions
207 public class Xcls_dbmodel : Object
209 public Gtk.ListStore el;
210 private NewBranch _this;
216 public Xcls_dbmodel(NewBranch _owner )
219 _this.dbmodel = this;
220 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
224 // set gobject values
227 // user defined functions
228 public void loadData (Gee.ArrayList<string> data, string cur) {
233 /// el.append(out iter);
236 // el.set_value(iter, 0, "");
237 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
242 el.set_value(iter, 0, "");
243 el.set_value(iter, 1, "-- select a module --");
244 _this.build_module.el.set_active_iter(iter);
246 for (var i = 0; i < data.size;i++) {
251 el.set_value(iter, 0, data.get(i));
252 el.set_value(iter, 1, data.get(i));
254 if (data.get(i) == cur) {
255 _this.build_module.el.set_active_iter(iter);
259 this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
265 public class Xcls_Label8 : Object
268 private NewBranch _this;
274 public Xcls_Label8(NewBranch _owner )
277 this.el = new Gtk.Label( "or use this as branch name" );
281 // set gobject values
282 this.el.justify = Gtk.Justification.RIGHT;
283 this.el.xalign = 0.900000f;
286 // user defined functions
289 public class Xcls_name : Object
292 private NewBranch _this;
298 public Xcls_name(NewBranch _owner )
302 this.el = new Gtk.Entry();
306 // set gobject values
307 this.el.visible = true;
310 // user defined functions
315 public class Xcls_Button10 : Object
317 public Gtk.Button el;
318 private NewBranch _this;
324 public Xcls_Button10(NewBranch _owner )
327 this.el = new Gtk.Button();
331 // set gobject values
332 this.el.relief = Gtk.ReliefStyle.NONE;
333 this.el.label = "Do not create Branch";
336 // user defined functions
339 public class Xcls_Button11 : Object
341 public Gtk.Button el;
342 private NewBranch _this;
348 public Xcls_Button11(NewBranch _owner )
351 this.el = new Gtk.Button();
355 // set gobject values
356 this.el.label = "Create Branch";
359 // user defined functions