1 static Xcls_DialogNewComponent _DialogNewComponent;
3 public class Xcls_DialogNewComponent : Object
6 private Xcls_DialogNewComponent _this;
8 public static Xcls_DialogNewComponent singleton()
10 if (_DialogNewComponent == null) {
11 _DialogNewComponent= new Xcls_DialogNewComponent();
13 return _DialogNewComponent;
15 public Xcls_build_module build_module;
16 public Xcls_dbcellrenderer dbcellrenderer;
17 public Xcls_dbmodel dbmodel;
18 public Xcls_name name;
23 public Xcls_DialogNewComponent()
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) => {
56 this.el.show.connect( (self) => {
62 // user defined functions
63 public void updateFileFromEntry () {
65 _this.file.title = _this.title.el.get_text();
66 _this.file.region = _this.region.el.get_text();
67 _this.file.parent = _this.parent.el.get_text();
68 _this.file.permname = _this.permname.el.get_text();
69 _this.file.modOrder = _this.modOrder.el.get_text();
71 if (_this.file.name.length > 0 && _this.file.name != _this.name.el.get_text()) {
72 _this.file.renameTo(_this.name.el.get_text());
74 // store the module...
75 _this.file.build_module = "";
77 if (_this.build_module.el.get_active_iter (out iter)) {
79 this.dbmodel.el.get_value (iter, 0, out vfname);
80 if (((string)vfname).length > 0) {
81 _this.file.build_module = (string)vfname;
94 //this.success = c.success;
98 public class Xcls_VBox2 : Object
101 private Xcls_DialogNewComponent _this;
107 public Xcls_VBox2(Xcls_DialogNewComponent _owner )
110 this.el = new Gtk.VBox( true, 0 );
114 // set gobject values
115 var child_0 = new Xcls_Table3( _this );
117 this.el.pack_start ( child_0.el , false,false,0 );
120 // user defined functions
122 public class Xcls_Table3 : Object
125 private Xcls_DialogNewComponent _this;
131 public Xcls_Table3(Xcls_DialogNewComponent _owner )
134 this.el = new Gtk.Table( 3, 2, true );
138 // set gobject values
139 var child_0 = new Xcls_Label4( _this );
141 this.el.attach_defaults ( child_0.el , 0,1,0,1 );
142 var child_1 = new Xcls_build_module( _this );
144 this.el.attach_defaults ( child_1.el , 1,2,0,1 );
145 var child_2 = new Xcls_Label8( _this );
147 this.el.attach_defaults ( child_2.el , 0,1,1,2 );
148 var child_3 = new Xcls_name( _this );
150 this.el.attach_defaults ( child_3.el , 1,2,1,2 );
153 // user defined functions
155 public class Xcls_Label4 : Object
158 private Xcls_DialogNewComponent _this;
164 public Xcls_Label4(Xcls_DialogNewComponent _owner )
167 this.el = new Gtk.Label( "Select Ticket" );
171 // set gobject values
172 this.el.justify = Gtk.Justification.RIGHT;
173 this.el.xalign = 0.900000f;
174 this.el.visible = true;
177 // user defined functions
180 public class Xcls_build_module : Object
182 public Gtk.ComboBox el;
183 private Xcls_DialogNewComponent _this;
189 public Xcls_build_module(Xcls_DialogNewComponent _owner )
192 _this.build_module = this;
193 this.el = new Gtk.ComboBox();
197 // set gobject values
198 var child_0 = new Xcls_dbcellrenderer( _this );
200 this.el.pack_start ( child_0.el , true );
201 var child_1 = new Xcls_dbmodel( _this );
203 this.el.set_model ( child_1.el );
207 this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
210 // user defined functions
212 public class Xcls_dbcellrenderer : Object
214 public Gtk.CellRendererText el;
215 private Xcls_DialogNewComponent _this;
221 public Xcls_dbcellrenderer(Xcls_DialogNewComponent _owner )
224 _this.dbcellrenderer = this;
225 this.el = new Gtk.CellRendererText();
229 // set gobject values
232 // user defined functions
235 public class Xcls_dbmodel : Object
237 public Gtk.ListStore el;
238 private Xcls_DialogNewComponent _this;
244 public Xcls_dbmodel(Xcls_DialogNewComponent _owner )
247 _this.dbmodel = this;
248 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
252 // set gobject values
255 // user defined functions
256 public void loadData (Gee.ArrayList<string> data, string cur) {
261 /// el.append(out iter);
264 // el.set_value(iter, 0, "");
265 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
270 el.set_value(iter, 0, "");
271 el.set_value(iter, 1, "-- select a module --");
272 _this.build_module.el.set_active_iter(iter);
274 for (var i = 0; i < data.size;i++) {
279 el.set_value(iter, 0, data.get(i));
280 el.set_value(iter, 1, data.get(i));
282 if (data.get(i) == cur) {
283 _this.build_module.el.set_active_iter(iter);
287 this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
293 public class Xcls_Label8 : Object
296 private Xcls_DialogNewComponent _this;
302 public Xcls_Label8(Xcls_DialogNewComponent _owner )
305 this.el = new Gtk.Label( "or use this as branch name" );
309 // set gobject values
310 this.el.justify = Gtk.Justification.RIGHT;
311 this.el.xalign = 0.900000f;
314 // user defined functions
317 public class Xcls_name : Object
320 private Xcls_DialogNewComponent _this;
326 public Xcls_name(Xcls_DialogNewComponent _owner )
330 this.el = new Gtk.Entry();
334 // set gobject values
335 this.el.visible = true;
338 // user defined functions
343 public class Xcls_Button10 : Object
345 public Gtk.Button el;
346 private Xcls_DialogNewComponent _this;
352 public Xcls_Button10(Xcls_DialogNewComponent _owner )
355 this.el = new Gtk.Button();
359 // set gobject values
360 this.el.label = "Do not create Branch";
363 // user defined functions
366 public class Xcls_Button11 : Object
368 public Gtk.Button el;
369 private Xcls_DialogNewComponent _this;
375 public Xcls_Button11(Xcls_DialogNewComponent _owner )
378 this.el = new Gtk.Button();
382 // set gobject values
383 this.el.label = "Create Branch";
386 // user defined functions