2 valac --pkg gio-2.0 --pkg posix --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0 --pkg libwnck-3.0 \
3 /tmp/EditProject.vala -o /tmp/EditProject
8 static int main (string[] args) {
10 new Xcls_EditProject();
11 EditProject.show_all();
18 public static Xcls_EditProject EditProject;
20 public class Xcls_EditProject : Object
23 private Xcls_EditProject _this;
25 public static Xcls_EditProject singleton()
27 if (EditProject == null) {
28 EditProject= new Xcls_EditProject();
32 public Xcls_xtype xtype;
33 public Xcls_cellrender cellrender;
34 public Xcls_model model;
40 public Xcls_EditProject()
43 this.el = new Gtk.Dialog();
48 this.el.border_width = 3;
49 this.el.default_height = 500;
50 this.el.default_width = 600;
51 this.el.deletable = true;
53 this.el.name = "EditProject";
54 this.el.title = "Project Properties";
55 var child_0 = new Xcls_VBox2( _this );
57 this.el. get_content_area().add
60 var child_1 = new Xcls_Button9( _this );
62 this.el.add_action_widget ( child_1.el , 1 );
63 var child_2 = new Xcls_Button10( _this );
65 this.el.add_action_widget ( child_2.el , 0 );
68 this.el.destroy_event.connect( (self, event) => {
75 // userdefined functions
76 public Project.Project? show() {
79 //[ 'xtype' ].forEach(function(k) {
80 // _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
83 _this.model.loadData();
86 var err_dialog = StandardErrorDialog.singleton();
97 if (_this.xtype.getValue().length < 1) {
99 err_dialog.show(_this.el,"You have to set Project type");
103 if (_this.dir.el.get_filename().length < 1) {
105 err_dialog.show(_this.el,"You have to select a folder");
117 var fn = _this.dir.el.get_filename();
118 print("add %s\n" , fn);
120 var project = Project.Project.factory(_this.xtype.getValue(), fn);
122 Project.projects.set(project.name,project);
124 //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
129 //this.success = c.success;
132 // skip |xns - no return type
133 public class Xcls_VBox2 : Object
136 private Xcls_EditProject _this;
142 public Xcls_VBox2(Xcls_EditProject _owner )
145 this.el = new Gtk.VBox( false, 0 );
149 // set gobject values
150 var child_0 = new Xcls_HBox3( _this );
152 this.el.pack_start ( child_0.el , false,true,3 );
153 var child_1 = new Xcls_dir( _this );
155 this.el.pack_end ( child_1.el , true,true,5 );
158 // userdefined functions
160 // skip |xns - no return type
162 public class Xcls_HBox3 : Object
165 private Xcls_EditProject _this;
171 public Xcls_HBox3(Xcls_EditProject _owner )
174 this.el = new Gtk.HBox( false, 0 );
178 // set gobject values
179 var child_0 = new Xcls_Label4( _this );
181 this.el.pack_start ( child_0.el , false,true,3 );
182 var child_1 = new Xcls_xtype( _this );
184 this.el.pack_end ( child_1.el , true,true,3 );
187 // userdefined functions
189 // skip |xns - no return type
191 public class Xcls_Label4 : Object
194 private Xcls_EditProject _this;
200 public Xcls_Label4(Xcls_EditProject _owner )
203 this.el = new Gtk.Label( "Project type :" );
207 // set gobject values
210 // userdefined functions
212 // skip |xns - no return type
214 public class Xcls_xtype : Object
216 public Gtk.ComboBox el;
217 private Xcls_EditProject _this;
223 public Xcls_xtype(Xcls_EditProject _owner )
227 this.el = new Gtk.ComboBox();
231 // set gobject values
232 var child_0 = new Xcls_cellrender( _this );
234 this.el.pack_start ( child_0.el , true );
235 var child_1 = new Xcls_model( _this );
237 this.el.set_model ( child_1.el );
240 this.el.add_attribute(_this.cellrender.el , "markup", 1 );
244 // userdefined functions
246 // skip |setValue - no return type
247 public string getValue () {
248 var ix = this.el.get_active();
261 // skip |xns - no return type
263 public class Xcls_cellrender : Object
265 public Gtk.CellRendererText el;
266 private Xcls_EditProject _this;
272 public Xcls_cellrender(Xcls_EditProject _owner )
275 _this.cellrender = this;
276 this.el = new Gtk.CellRendererText();
280 // set gobject values
283 // userdefined functions
285 // skip |xns - no return type
287 public class Xcls_model : Object
289 public Gtk.ListStore el;
290 private Xcls_EditProject _this;
296 public Xcls_model(Xcls_EditProject _owner )
300 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
304 // set gobject values
307 // userdefined functions
308 public void loadData ( ) {
315 el.set_value(iter, 0, "Roo");
316 el.set_value(iter, 1, "Roo Project");
319 el.set_value(iter, 0, "Gtk");
320 el.set_value(iter, 1, "Gtk Project");
326 // skip |xns - no return type
328 public class Xcls_dir : Object
330 public Gtk.FileChooserWidget el;
331 private Xcls_EditProject _this;
337 public Xcls_dir(Xcls_EditProject _owner )
341 this.el = new Gtk.FileChooserWidget( Gtk.FileChooserAction.SELECT_FOLDER );
345 // set gobject values
346 this.el.create_folders = false;
347 this.el.select_multiple = false;
350 // userdefined functions
352 // skip |xns - no return type
354 public class Xcls_Button9 : Object
356 public Gtk.Button el;
357 private Xcls_EditProject _this;
363 public Xcls_Button9(Xcls_EditProject _owner )
366 this.el = new Gtk.Button();
370 // set gobject values
371 this.el.label = "OK";
374 // userdefined functions
376 // skip |xns - no return type
378 public class Xcls_Button10 : Object
380 public Gtk.Button el;
381 private Xcls_EditProject _this;
387 public Xcls_Button10(Xcls_EditProject _owner )
390 this.el = new Gtk.Button();
394 // set gobject values
395 this.el.label = "Cancel";
398 // userdefined functions
400 // skip |xns - no return type