1 static EditProject _EditProject;
3 public class EditProject : Object
6 private EditProject _this;
8 public static EditProject singleton()
10 if (_EditProject == null) {
11 _EditProject= new EditProject();
15 public Xcls_xtype xtype;
16 public Xcls_cellrender cellrender;
17 public Xcls_model model;
26 this.el = new Gtk.Dialog();
31 this.el.title = "Project Properties";
32 this.el.name = "EditProject";
33 this.el.border_width = 3;
34 this.el.default_height = 500;
35 this.el.default_width = 600;
36 this.el.deletable = true;
38 var child_0 = new Xcls_Box2( _this );
40 this.el.get_content_area().add ( child_0.el );
41 var child_1 = new Xcls_Button9( _this );
43 this.el.add_action_widget ( child_1.el , 1 );
44 var child_2 = new Xcls_Button10( _this );
46 this.el.add_action_widget ( child_2.el , 0 );
49 this.el.destroy_event.connect( (self, event) => {
56 // user defined functions
57 public Project.Project? show () {
60 //[ 'xtype' ].forEach(function(k) {
61 // _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
64 _this.model.loadData();
67 var err_dialog = StandardErrorDialog.singleton();
78 if (_this.xtype.getValue().length < 1) {
80 err_dialog.show(_this.el,"You have to set Project type");
84 if (_this.dir.el.get_filename().length < 1) {
86 err_dialog.show(_this.el,"You have to select a folder");
98 var fn = _this.dir.el.get_filename();
99 print("add %s\n" , fn);
101 var project = Project.Project.factory(_this.xtype.getValue(), fn);
103 Project.projects.set(project.name,project);
105 //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
110 //this.success = c.success;
112 public class Xcls_Box2 : Object
115 private EditProject _this;
121 public Xcls_Box2(EditProject _owner )
124 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
128 // set gobject values
129 this.el.homogeneous = false;
130 this.el.expand = true;
131 var child_0 = new Xcls_Box3( _this );
133 this.el.pack_start ( child_0.el , false,true,3 );
134 var child_1 = new Xcls_dir( _this );
136 this.el.pack_end ( child_1.el , true,true,5 );
139 // user defined functions
141 public class Xcls_Box3 : Object
144 private EditProject _this;
150 public Xcls_Box3(EditProject _owner )
153 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
157 // set gobject values
158 this.el.homogeneous = false;
159 var child_0 = new Xcls_Label4( _this );
161 this.el.pack_start ( child_0.el , false,true,3 );
162 var child_1 = new Xcls_xtype( _this );
164 this.el.pack_end ( child_1.el , true,true,3 );
167 // user defined functions
169 public class Xcls_Label4 : Object
172 private EditProject _this;
178 public Xcls_Label4(EditProject _owner )
181 this.el = new Gtk.Label( "Project type :" );
185 // set gobject values
188 // user defined functions
191 public class Xcls_xtype : Object
193 public Gtk.ComboBox el;
194 private EditProject _this;
200 public Xcls_xtype(EditProject _owner )
204 this.el = new Gtk.ComboBox();
208 // set gobject values
209 var child_0 = new Xcls_cellrender( _this );
211 this.el.pack_start ( child_0.el , true );
212 var child_1 = new Xcls_model( _this );
214 this.el.set_model ( child_1.el );
218 this.el.add_attribute(_this.cellrender.el , "markup", 1 );
221 // user defined functions
222 public string getValue () {
223 var ix = this.el.get_active();
236 public class Xcls_cellrender : Object
238 public Gtk.CellRendererText el;
239 private EditProject _this;
245 public Xcls_cellrender(EditProject _owner )
248 _this.cellrender = this;
249 this.el = new Gtk.CellRendererText();
253 // set gobject values
256 // user defined functions
259 public class Xcls_model : Object
261 public Gtk.ListStore el;
262 private EditProject _this;
268 public Xcls_model(EditProject _owner )
272 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
276 // set gobject values
279 // user defined functions
280 public void loadData ( ) {
287 el.set_value(iter, 0, "Roo");
288 el.set_value(iter, 1, "Roo Project");
291 el.set_value(iter, 0, "Gtk");
292 el.set_value(iter, 1, "Gtk Project");
301 public class Xcls_dir : Object
303 public Gtk.FileChooserWidget el;
304 private EditProject _this;
310 public Xcls_dir(EditProject _owner )
314 this.el = new Gtk.FileChooserWidget( Gtk.FileChooserAction.SELECT_FOLDER );
318 // set gobject values
319 this.el.expand = true;
320 this.el.create_folders = false;
321 this.el.select_multiple = false;
324 // user defined functions
328 public class Xcls_Button9 : Object
330 public Gtk.Button el;
331 private EditProject _this;
337 public Xcls_Button9(EditProject _owner )
340 this.el = new Gtk.Button();
344 // set gobject values
345 this.el.label = "OK";
348 // user defined functions
351 public class Xcls_Button10 : Object
353 public Gtk.Button el;
354 private EditProject _this;
360 public Xcls_Button10(EditProject _owner )
363 this.el = new Gtk.Button();
367 // set gobject values
368 this.el.label = "Cancel";
371 // user defined functions