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 = Xcls_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);
106 GLib.debug("got error? %s" , e.message);
108 //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
113 //this.success = c.success;
115 public class Xcls_Box2 : Object
118 private EditProject _this;
124 public Xcls_Box2(EditProject _owner )
127 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
131 // set gobject values
132 this.el.homogeneous = false;
133 this.el.expand = true;
134 var child_0 = new Xcls_Box3( _this );
136 this.el.pack_start ( child_0.el , false,true,3 );
137 var child_1 = new Xcls_dir( _this );
139 this.el.pack_end ( child_1.el , true,true,5 );
142 // user defined functions
144 public class Xcls_Box3 : Object
147 private EditProject _this;
153 public Xcls_Box3(EditProject _owner )
156 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
160 // set gobject values
161 this.el.homogeneous = false;
162 var child_0 = new Xcls_Label4( _this );
164 this.el.pack_start ( child_0.el , false,true,3 );
165 var child_1 = new Xcls_xtype( _this );
167 this.el.pack_end ( child_1.el , true,true,3 );
170 // user defined functions
172 public class Xcls_Label4 : Object
175 private EditProject _this;
181 public Xcls_Label4(EditProject _owner )
184 this.el = new Gtk.Label( "Project type :" );
188 // set gobject values
191 // user defined functions
194 public class Xcls_xtype : Object
196 public Gtk.ComboBox el;
197 private EditProject _this;
203 public Xcls_xtype(EditProject _owner )
207 this.el = new Gtk.ComboBox();
211 // set gobject values
212 var child_0 = new Xcls_cellrender( _this );
214 this.el.pack_start ( child_0.el , true );
215 var child_1 = new Xcls_model( _this );
217 this.el.set_model ( child_1.el );
221 this.el.add_attribute(_this.cellrender.el , "markup", 1 );
224 // user defined functions
225 public string getValue () {
226 var ix = this.el.get_active();
241 public class Xcls_cellrender : Object
243 public Gtk.CellRendererText el;
244 private EditProject _this;
250 public Xcls_cellrender(EditProject _owner )
253 _this.cellrender = this;
254 this.el = new Gtk.CellRendererText();
258 // set gobject values
261 // user defined functions
264 public class Xcls_model : Object
266 public Gtk.ListStore el;
267 private EditProject _this;
273 public Xcls_model(EditProject _owner )
277 this.el = new Gtk.ListStore.newv( { typeof(string),typeof(string) } );
281 // set gobject values
284 // user defined functions
285 public void loadData ( ) {
291 el.set_value(iter, 0, "Roo");
292 el.set_value(iter, 1, "Roo Project");
295 el.set_value(iter, 0, "Gtk");
296 el.set_value(iter, 1, "Gtk Project");
299 el.set_value(iter, 0, "Flutter");
300 el.set_value(iter, 1, "Flutter Project");
308 public class Xcls_dir : Object
310 public Gtk.FileChooserWidget el;
311 private EditProject _this;
317 public Xcls_dir(EditProject _owner )
321 this.el = new Gtk.FileChooserWidget( Gtk.FileChooserAction.SELECT_FOLDER );
325 // set gobject values
326 this.el.expand = true;
327 this.el.create_folders = false;
328 this.el.select_multiple = false;
331 // user defined functions
335 public class Xcls_Button9 : Object
337 public Gtk.Button el;
338 private EditProject _this;
344 public Xcls_Button9(EditProject _owner )
347 this.el = new Gtk.Button();
351 // set gobject values
352 this.el.label = "OK";
355 // user defined functions
358 public class Xcls_Button10 : Object
360 public Gtk.Button el;
361 private EditProject _this;
367 public Xcls_Button10(EditProject _owner )
370 this.el = new Gtk.Button();
374 // set gobject values
375 this.el.label = "Cancel";
378 // user defined functions