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 GtkClutter = imports.gi.GtkClutter;
11 console = imports.console;
12 XObject = imports.XObject.XObject;
13 EditProject=new XObject({
20 title : "Project Properties",
22 c = c || { name : '' , xtype : '' };
28 [ 'xtype' ].forEach(function(k) {
29 _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
34 this.success = c.success;
37 destroy_event : function (self, event) {
41 response : function (self, id) {
46 if (!this.get('xtype').getValue().length) {
47 this.get('/StandardErrorDialog').show("You have to set Project type");
50 if (!this.get('dir').el.get_filename().length) {
51 this.get('/StandardErrorDialog').show("You have to select a folder");
58 var fn = this.get('dir').el.get_filename();
60 this.project.name = GLib.basename(fn);
61 this.project.xtype = this.get('xtype').getValue();
62 this.project.paths = {};
63 this.project.paths[fn] = 'dir' ;
65 var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
74 pack : function(p,e) {
75 p.el.get_content_area().add(e.el)
80 pack : "pack_start,false,true,3",
84 pack : "pack_start,false,true,3",
85 label : "Project type :"
89 pack : "pack_end,true,true,3",
91 setValue : function(v)
95 this.get('model').data.forEach(function(n, ix) {
102 getValue : function() {
103 var ix = this.el.get_active();
107 return this.get('model').data[ix].xtype;
110 XObject.prototype.init.call(this);
111 this.el.add_attribute(this.items[0].el , 'markup', 1 );
115 xtype: Gtk.CellRendererText,
119 xtype: Gtk.ListStore,
122 XObject.prototype.init.call(this);
124 this.el.set_column_types ( 2, [
125 GObject.TYPE_STRING, // real key
126 GObject.TYPE_STRING // real type
132 { xtype: 'Roo', desc : "Roo Project" },
133 { xtype: 'Gtk', desc : "Gtk Project" },
134 //{ xtype: 'JS', desc : "Javascript Class" }
137 this.loadData(this.data);
140 loadData : function (data) {
142 var iter = new Gtk.TreeIter();
144 data.forEach(function(p) {
149 el.set_value(iter, 0, p.xtype);
150 el.set_value(iter, 1, p.desc);
163 xtype: Gtk.FileChooserWidget,
164 pack : "pack_end,true,true,5",
165 action : Gtk.FileChooserAction.SELECT_FOLDER,
167 select_multiple : false
173 pack : "add_action_widget,1",
178 pack : "add_action_widget,0",
184 XObject.cache['/EditProject'] = EditProject;