3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
10 console = imports.console;
11 XObject = imports.XObject.XObject;
12 EditProject=new XObject({
19 title : "Project Properties",
21 c = c || { name : '' , xtype : '' };
27 [ 'xtype' , 'name' ].forEach(function(k) {
28 _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
32 this.success = c.success;
35 "destroy_event":function (self, event) {
39 "response":function (self, id) {
44 if (!this.get('xtype').getValue().length) {
45 this.get('/StandardErrorDialog').show("You have to set Project type");
54 this.project.name = this.get('name').getValue();
55 this.project.xtype = this.get('xtype').getValue();
58 var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
67 pack : function(p,e) {
68 p.el.get_content_area().add(e.el)
73 pack : "pack_start,false,true,3",
77 pack : "pack_start,false,true,3",
78 label : "Project Name :"
82 pack : "pack_end,true,true,0",
84 getValue : function() {
85 return this.el.get_text();
87 setValue : function(v)
96 pack : "pack_start,false,true,3",
100 pack : "pack_start,false,true,0",
101 label : "Project type :"
105 pack : "pack_end,true,true,0",
107 setValue : function(v)
111 this.get('model').data.forEach(function(n, ix) {
118 getValue : function() {
119 var ix = this.el.get_active();
123 return this.get('model').data[ix].xtype;
126 XObject.prototype.init.call(this);
127 this.el.add_attribute(this.items[0].el , 'markup', 1 );
131 xtype: Gtk.CellRendererText,
135 xtype: Gtk.ListStore,
138 XObject.prototype.init.call(this);
140 this.el.set_column_types ( 2, [
141 GObject.TYPE_STRING, // real key
142 GObject.TYPE_STRING // real type
148 { xtype: 'Roo', desc : "Roo Project" },
149 { xtype: 'Gtk', desc : "Gtk Project" },
150 //{ xtype: 'JS', desc : "Javascript Class" }
153 this.loadData(this.data);
156 loadData : function (data) {
158 var iter = new Gtk.TreeIter();
160 data.forEach(function(p) {
165 el.set_value(iter, 0, p.xtype);
166 el.set_value(iter, 1, p.desc);
179 xtype: Gtk.FileChooserWidget,
180 pack : "pack_end,true,true,3",
181 action : Gtk.FileChooserAction.SELECT_FOLDER
187 pack : "add_action_widget,1",
192 pack : "add_action_widget,0",
198 XObject.cache['/EditProject'] = EditProject;