projects
/
app.Builder.js
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tools
[app.Builder.js]
/
Sample
/
EditProject.js
diff --git
a/Sample/EditProject.js
b/Sample/EditProject.js
index
7d2346c
..
456e1e5
100644
(file)
--- a/
Sample/EditProject.js
+++ b/
Sample/EditProject.js
@@
-11,11
+11,11
@@
console = imports.console;
XObject = imports.XObject.XObject;
EditProject=new XObject({
xtype: Gtk.Dialog,
XObject = imports.XObject.XObject;
EditProject=new XObject({
xtype: Gtk.Dialog,
- default_height :
3
00,
+ default_height :
5
00,
default_width : 600,
deletable : true,
modal : true,
default_width : 600,
deletable : true,
modal : true,
- border_width :
0
,
+ border_width :
3
,
title : "Project Properties",
show : function(c) {
c = c || { name : '' , xtype : '' };
title : "Project Properties",
show : function(c) {
c = c || { name : '' , xtype : '' };
@@
-33,28
+33,33
@@
EditProject=new XObject({
this.success = c.success;
},
listeners : {
this.success = c.success;
},
listeners : {
-
"destroy_event":
function (self, event) {
+
destroy_event :
function (self, event) {
this.el.hide();
return false;
},
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) {
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;
}
return;
}
+ if (!this.get('dir').el.get_filename().length) {
+ this.get('/StandardErrorDialog').show("You have to select a folder");
+ return;
+ }
+
this.el.hide();
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.xtype = this.get('xtype').getValue();
-
+ this.project.paths = {};
+ this.project.paths[fn] = 'dir' ;
var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
@@
-66,8
+71,8
@@
EditProject=new XObject({
{
xtype: Gtk.VBox,
pack : function(p,e) {
{
xtype: Gtk.VBox,
pack : function(p,e) {
-
p.el.get_content_area().add(e.el)
-
},
+ p.el.get_content_area().add(e.el)
+ },
items : [
{
xtype: Gtk.HBox,
items : [
{
xtype: Gtk.HBox,
@@
-155,8
+160,10
@@
EditProject=new XObject({
},
{
xtype: Gtk.FileChooserWidget,
},
{
xtype: Gtk.FileChooserWidget,
- pack : "pack_end,true,true,3",
- action : Gtk.FileChooserAction.SELECT_FOLDER
+ pack : "pack_end,true,true,5",
+ action : Gtk.FileChooserAction.SELECT_FOLDER,
+ id : "dir",
+ select_multiple : false
}
]
},
}
]
},