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
69 public class Xcls_VBox2 : Object
72 private NewBranch _this;
78 public Xcls_VBox2(NewBranch _owner )
81 this.el = new Gtk.VBox( true, 0 );
86 var child_0 = new Xcls_Table3( _this );
88 this.el.pack_start ( child_0.el , false,false,0 );
91 // user defined functions
93 public class Xcls_Table3 : Object
96 private NewBranch _this;
102 public Xcls_Table3(NewBranch _owner )
105 this.el = new Gtk.Table( 2, 2, true );
109 // set gobject values
110 var child_0 = new Xcls_Label4( _this );
112 this.el.attach_defaults ( child_0.el , 0,1,0,1 );
113 var child_1 = new Xcls_build_module( _this );
115 this.el.attach_defaults ( child_1.el , 1,2,0,1 );
116 var child_2 = new Xcls_Label8( _this );
118 this.el.attach_defaults ( child_2.el , 0,1,1,2 );
119 var child_3 = new Xcls_name( _this );
121 this.el.attach_defaults ( child_3.el , 1,2,1,2 );
124 // user defined functions
126 public class Xcls_Label4 : Object
129 private NewBranch _this;
135 public Xcls_Label4(NewBranch _owner )
138 this.el = new Gtk.Label( "Select Ticket" );
142 // set gobject values
143 this.el.justify = Gtk.Justification.RIGHT;
144 this.el.xalign = 0.900000f;
145 this.el.visible = true;
148 // user defined functions
151 public class Xcls_build_module : Object
153 public Gtk.ComboBox el;
154 private NewBranch _this;
160 public Xcls_build_module(NewBranch _owner )
163 _this.build_module = this;
164 this.el = new Gtk.ComboBox();
168 // set gobject values
169 var child_0 = new Xcls_dbcellrenderer( _this );
171 this.el.pack_start ( child_0.el , true );
172 var child_1 = new Xcls_dbmodel( _this );
174 this.el.set_model ( child_1.el );
178 this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
181 // user defined functions
183 public class Xcls_dbcellrenderer : Object
185 public Gtk.CellRendererText el;
186 private NewBranch _this;
192 public Xcls_dbcellrenderer(NewBranch _owner )
195 _this.dbcellrenderer = this;
196 this.el = new Gtk.CellRendererText();
200 // set gobject values
203 // user defined functions
206 public class Xcls_dbmodel : Object
208 public Gtk.ListStore el;
209 private NewBranch _this;
215 public Xcls_dbmodel(NewBranch _owner )
218 _this.dbmodel = this;
219 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
223 // set gobject values
226 // user defined functions
227 public void loadData (Gee.ArrayList<string> data, string cur) {
232 /// el.append(out iter);
235 // el.set_value(iter, 0, "");
236 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
241 el.set_value(iter, 0, "");
242 el.set_value(iter, 1, "-- select a module --");
243 _this.build_module.el.set_active_iter(iter);
245 for (var i = 0; i < data.size;i++) {
250 el.set_value(iter, 0, data.get(i));
251 el.set_value(iter, 1, data.get(i));
253 if (data.get(i) == cur) {
254 _this.build_module.el.set_active_iter(iter);
258 this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
264 public class Xcls_Label8 : Object
267 private NewBranch _this;
273 public Xcls_Label8(NewBranch _owner )
276 this.el = new Gtk.Label( "or use this as branch name" );
280 // set gobject values
281 this.el.justify = Gtk.Justification.RIGHT;
282 this.el.xalign = 0.900000f;
285 // user defined functions
288 public class Xcls_name : Object
291 private NewBranch _this;
297 public Xcls_name(NewBranch _owner )
301 this.el = new Gtk.Entry();
305 // set gobject values
306 this.el.visible = true;
309 // user defined functions
314 public class Xcls_Button10 : Object
316 public Gtk.Button el;
317 private NewBranch _this;
323 public Xcls_Button10(NewBranch _owner )
326 this.el = new Gtk.Button();
330 // set gobject values
331 this.el.relief = Gtk.ReliefStyle.NONE;
332 this.el.label = "Do not create Branch";
335 // user defined functions
338 public class Xcls_Button11 : Object
340 public Gtk.Button el;
341 private NewBranch _this;
347 public Xcls_Button11(NewBranch _owner )
350 this.el = new Gtk.Button();
354 // set gobject values
355 this.el.label = "Create Branch";
358 // user defined functions