XObject = imports.XObject.XObject;
EditProject=new XObject({
xtype: Gtk.Dialog,
- default_height : 300,
+ default_height : 500,
default_width : 600,
deletable : true,
modal : true,
- border_width : 10,
+ border_width : 3,
title : "Project Properties",
show : function(c) {
c = c || { name : '' , xtype : '' };
this.success = c.success;
},
listeners : {
- "destroy_event":function (self, event) {
+ destroy_event : function (self, event) {
this.el.hide();
return false;
},
- "response":function (self, id) {
+ response : function (self, id) {
if (id < 1) {
this.el.hide();
return;
}
if (!this.get('xtype').getValue().length) {
- this.get('/StandardErrorDialog').show("You have to set Project type");
-
+ this.get('/StandardErrorDialog').show("You have to set Project type");
return;
}
+ if (!this.get('dir').el.get_filename().length) {
+ this.get('/StandardErrorDialog').show("You have to select a folder");
+ return;
+ }
+
this.el.hide();
+ var fn = this.get('dir').el.get_filename();
-
- this.project.name = this.get('name').getValue();
+ this.project.name = GLib.basename(fn);
this.project.xtype = this.get('xtype').getValue();
-
+ this.project.paths = {};
+ this.project.paths[fn] = 'dir' ;
var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
items : [
{
xtype: Gtk.HBox,
- pack : "pack_start,false,true,0",
+ pack : "pack_start,false,true,3",
items : [
{
xtype: Gtk.Label,
},
{
xtype: Gtk.FileChooserWidget,
- pack : "add",
- action : Gtk.FileChooserAction.SELECT_FOLDER
+ pack : "pack_end,true,true,5",
+ action : Gtk.FileChooserAction.SELECT_FOLDER,
+ id : "dir",
+ select_multiple : false
}
]
},