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' ].forEach(function(k) {
28 _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
33 this.success = c.success;
36 "destroy_event":function (self, event) {
40 "response":function (self, id) {
45 if (!this.get('xtype').getValue().length) {
46 this.get('/StandardErrorDialog').show("You have to set Project type");
55 this.project.name = this.get('name').getValue();
56 this.project.xtype = this.get('xtype').getValue();
59 var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
68 pack : function(p,e) {
69 p.el.get_content_area().add(e.el)
74 pack : "pack_start,false,true,3",
78 pack : "pack_start,false,true,3",
79 label : "Project type :"
83 pack : "pack_end,true,true,3",
85 setValue : function(v)
89 this.get('model').data.forEach(function(n, ix) {
96 getValue : function() {
97 var ix = this.el.get_active();
101 return this.get('model').data[ix].xtype;
104 XObject.prototype.init.call(this);
105 this.el.add_attribute(this.items[0].el , 'markup', 1 );
109 xtype: Gtk.CellRendererText,
113 xtype: Gtk.ListStore,
116 XObject.prototype.init.call(this);
118 this.el.set_column_types ( 2, [
119 GObject.TYPE_STRING, // real key
120 GObject.TYPE_STRING // real type
126 { xtype: 'Roo', desc : "Roo Project" },
127 { xtype: 'Gtk', desc : "Gtk Project" },
128 //{ xtype: 'JS', desc : "Javascript Class" }
131 this.loadData(this.data);
134 loadData : function (data) {
136 var iter = new Gtk.TreeIter();
138 data.forEach(function(p) {
143 el.set_value(iter, 0, p.xtype);
144 el.set_value(iter, 1, p.desc);
157 xtype: Gtk.FileChooserWidget,
159 action : Gtk.FileChooserAction.SELECT_FOLDER
165 pack : "add_action_widget,1",
170 pack : "add_action_widget,0",
176 XObject.cache['/EditProject'] = EditProject;