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_VBox2( _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_VBox2 : Object
115 private EditProject _this;
121 public Xcls_VBox2(EditProject _owner )
124 this.el = new Gtk.VBox( false, 0 );
128 // set gobject values
129 var child_0 = new Xcls_HBox3( _this );
131 this.el.pack_start ( child_0.el , false,true,3 );
132 var child_1 = new Xcls_dir( _this );
134 this.el.pack_end ( child_1.el , true,true,5 );
137 // user defined functions
139 public class Xcls_HBox3 : Object
142 private EditProject _this;
148 public Xcls_HBox3(EditProject _owner )
151 this.el = new Gtk.HBox( false, 0 );
155 // set gobject values
156 var child_0 = new Xcls_Label4( _this );
158 this.el.pack_start ( child_0.el , false,true,3 );
159 var child_1 = new Xcls_xtype( _this );
161 this.el.pack_end ( child_1.el , true,true,3 );
164 // user defined functions
166 public class Xcls_Label4 : Object
169 private EditProject _this;
175 public Xcls_Label4(EditProject _owner )
178 this.el = new Gtk.Label( "Project type :" );
182 // set gobject values
185 // user defined functions
188 public class Xcls_xtype : Object
190 public Gtk.ComboBox el;
191 private EditProject _this;
197 public Xcls_xtype(EditProject _owner )
201 this.el = new Gtk.ComboBox();
205 // set gobject values
206 var child_0 = new Xcls_cellrender( _this );
208 this.el.pack_start ( child_0.el , true );
209 var child_1 = new Xcls_model( _this );
211 this.el.set_model ( child_1.el );
215 this.el.add_attribute(_this.cellrender.el , "markup", 1 );
218 // user defined functions
219 public string getValue () {
220 var ix = this.el.get_active();
233 public class Xcls_cellrender : Object
235 public Gtk.CellRendererText el;
236 private EditProject _this;
242 public Xcls_cellrender(EditProject _owner )
245 _this.cellrender = this;
246 this.el = new Gtk.CellRendererText();
250 // set gobject values
253 // user defined functions
256 public class Xcls_model : Object
258 public Gtk.ListStore el;
259 private EditProject _this;
265 public Xcls_model(EditProject _owner )
269 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
273 // set gobject values
276 // user defined functions
277 public void loadData ( ) {
284 el.set_value(iter, 0, "Roo");
285 el.set_value(iter, 1, "Roo Project");
288 el.set_value(iter, 0, "Gtk");
289 el.set_value(iter, 1, "Gtk Project");
298 public class Xcls_dir : Object
300 public Gtk.FileChooserWidget el;
301 private EditProject _this;
307 public Xcls_dir(EditProject _owner )
311 this.el = new Gtk.FileChooserWidget( Gtk.FileChooserAction.SELECT_FOLDER );
315 // set gobject values
316 this.el.create_folders = false;
317 this.el.select_multiple = false;
320 // user defined functions
324 public class Xcls_Button9 : Object
326 public Gtk.Button el;
327 private EditProject _this;
333 public Xcls_Button9(EditProject _owner )
336 this.el = new Gtk.Button();
340 // set gobject values
341 this.el.label = "OK";
344 // user defined functions
347 public class Xcls_Button10 : Object
349 public Gtk.Button el;
350 private EditProject _this;
356 public Xcls_Button10(EditProject _owner )
359 this.el = new Gtk.Button();
363 // set gobject values
364 this.el.label = "Cancel";
367 // user defined functions