Sample/EditProject.js
authorAlan Knowles <alan@akbkhome.com>
Tue, 25 May 2010 04:38:49 +0000 (12:38 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 25 May 2010 04:38:49 +0000 (12:38 +0800)
Sample/EditProject.js

index da99902..9fd3c18 100644 (file)
@@ -43,18 +43,22 @@ EditProject=new XObject({
                     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 = [ fn ];
                 
                 var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);