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_Box3( _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_Box3 : Object
142 private EditProject _this;
148 public Xcls_Box3(EditProject _owner )
151 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
155 // set gobject values
156 this.el.homogeneous = false;
157 var child_0 = new Xcls_Label4( _this );
159 this.el.pack_start ( child_0.el , false,true,3 );
160 var child_1 = new Xcls_xtype( _this );
162 this.el.pack_end ( child_1.el , true,true,3 );
165 // user defined functions
167 public class Xcls_Label4 : Object
170 private EditProject _this;
176 public Xcls_Label4(EditProject _owner )
179 this.el = new Gtk.Label( "Project type :" );
183 // set gobject values
186 // user defined functions
189 public class Xcls_xtype : Object
191 public Gtk.ComboBox el;
192 private EditProject _this;
198 public Xcls_xtype(EditProject _owner )
202 this.el = new Gtk.ComboBox();
206 // set gobject values
207 var child_0 = new Xcls_cellrender( _this );
209 this.el.pack_start ( child_0.el , true );
210 var child_1 = new Xcls_model( _this );
212 this.el.set_model ( child_1.el );
216 this.el.add_attribute(_this.cellrender.el , "markup", 1 );
219 // user defined functions
220 public string getValue () {
221 var ix = this.el.get_active();
234 public class Xcls_cellrender : Object
236 public Gtk.CellRendererText el;
237 private EditProject _this;
243 public Xcls_cellrender(EditProject _owner )
246 _this.cellrender = this;
247 this.el = new Gtk.CellRendererText();
251 // set gobject values
254 // user defined functions
257 public class Xcls_model : Object
259 public Gtk.ListStore el;
260 private EditProject _this;
266 public Xcls_model(EditProject _owner )
270 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
274 // set gobject values
277 // user defined functions
278 public void loadData ( ) {
285 el.set_value(iter, 0, "Roo");
286 el.set_value(iter, 1, "Roo Project");
289 el.set_value(iter, 0, "Gtk");
290 el.set_value(iter, 1, "Gtk Project");
299 public class Xcls_dir : Object
301 public Gtk.FileChooserWidget el;
302 private EditProject _this;
308 public Xcls_dir(EditProject _owner )
312 this.el = new Gtk.FileChooserWidget( Gtk.FileChooserAction.SELECT_FOLDER );
316 // set gobject values
317 this.el.create_folders = false;
318 this.el.select_multiple = false;
321 // user defined functions
325 public class Xcls_Button9 : Object
327 public Gtk.Button el;
328 private EditProject _this;
334 public Xcls_Button9(EditProject _owner )
337 this.el = new Gtk.Button();
341 // set gobject values
342 this.el.label = "OK";
345 // user defined functions
348 public class Xcls_Button10 : Object
350 public Gtk.Button el;
351 private EditProject _this;
357 public Xcls_Button10(EditProject _owner )
360 this.el = new Gtk.Button();
364 // set gobject values
365 this.el.label = "Cancel";
368 // user defined functions