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;
12 console = imports.console;
13 XObject = imports.XObject.XObject;
14 EditProject=new XObject({
21 title : "Project Properties",
23 c = c || { name : '' , xtype : '' };
29 [ 'xtype' ].forEach(function(k) {
30 _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
35 this.success = c.success;
38 destroy_event : function (self, event) {
42 response : function (self, id) {
47 if (!this.get('xtype').getValue().length) {
48 this.get('/StandardErrorDialog').show("You have to set Project type");
51 if (!this.get('dir').el.get_filename().length) {
52 this.get('/StandardErrorDialog').show("You have to select a folder");
59 var fn = this.get('dir').el.get_filename();
61 this.project.name = GLib.basename(fn);
62 this.project.xtype = this.get('xtype').getValue();
63 this.project.paths = {};
64 this.project.paths[fn] = 'dir' ;
66 var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
75 pack : function(p,e) {
76 p.el.get_content_area().add(e.el)
81 pack : "pack_start,false,true,3",
85 pack : "pack_start,false,true,3",
86 label : "Project type :"
90 pack : "pack_end,true,true,3",
92 setValue : function(v)
96 this.get('model').data.forEach(function(n, ix) {
103 getValue : function() {
104 var ix = this.el.get_active();
108 return this.get('model').data[ix].xtype;
111 XObject.prototype.init.call(this);
112 this.el.add_attribute(this.items[0].el , 'markup', 1 );
116 xtype: Gtk.CellRendererText,
120 xtype: Gtk.ListStore,
123 XObject.prototype.init.call(this);
125 this.el.set_column_types ( 2, [
126 GObject.TYPE_STRING, // real key
127 GObject.TYPE_STRING // real type
133 { xtype: 'Roo', desc : "Roo Project" },
134 { xtype: 'Gtk', desc : "Gtk Project" },
135 //{ xtype: 'JS', desc : "Javascript Class" }
138 this.loadData(this.data);
141 loadData : function (data) {
143 var iter = new Gtk.TreeIter();
145 data.forEach(function(p) {
150 el.set_value(iter, 0, p.xtype);
151 el.set_value(iter, 1, p.desc);
164 xtype: Gtk.FileChooserWidget,
165 pack : "pack_end,true,true,5",
166 action : Gtk.FileChooserAction.SELECT_FOLDER,
168 select_multiple : false
174 pack : "add_action_widget,1",
179 pack : "add_action_widget,0",
185 XObject.cache['/EditProject'] = EditProject;