WindowLog.js
[gitlive] / FixBug.js
index b5fc8ee..6b8357f 100644 (file)
--- a/FixBug.js
+++ b/FixBug.js
@@ -20,25 +20,25 @@ FixBug=new XObject({
         },
         response : function (self, id) {
           // hide
-         if (id < 1) {
+             if (id < 1) {
                 this.el.hide();
                 return;
             }
-            if (!this.get('bug').getValue().length) {
+            if (typeof(this.get('bug').getValue()) != 'object') {
                 print("ERROR");
-                    return;
-                }
+                return;
+            }
          
-                this.el.hide();
+            this.el.hide();
                 
-                var val = this.get('bug').getValue();
-                Seed.print(val);
+            //var val = this.get('bug').getValue();
+             //   Seed.print(val);
         }
     },
     border_width : 3,
-    default_height : 150,
+    default_height : 400,
     default_width : 600,
-    title : "Project Properties",
+    title : "Select Active Bug",
     deletable : true,
     modal : true,
     show : function(c) {
@@ -52,7 +52,20 @@ FixBug=new XObject({
         });
        // shouild set path..
         */
+    
+        
         this.el.show_all();
+        this.get('/ok_button').el.set_sensitive(false);
+        
+        // block until we return.
+        var run_ret = this.el.run();
+        if (run_ret < 1 ) {
+            return false;
+        }
+        print("RUN RETURN : " + run_ret);
+        
+        //print(JSON.stringify(this.get('bug').getValue()));
+        return this.get('bug').getValue();
         //this.success = c.success;
     },
     items : [
@@ -77,6 +90,7 @@ FixBug=new XObject({
                                 changed : function (self) {
                                     var d = this.getValue();
                                     this.get('/view').load(d.description);
+                                      this.get('/ok_button').el.set_sensitive(true);
                                 }
                             },
                             id : "bug",
@@ -194,6 +208,7 @@ FixBug=new XObject({
                                     xtype: GtkSource.Buffer,
                                     listeners : {
                                         changed : function (self) {
+                                            /*
                                             var s = new Gtk.TextIter();
                                             var e = new Gtk.TextIter();
                                             this.el.get_start_iter(s);
@@ -215,6 +230,7 @@ FixBug=new XObject({
                                                    }));
                                             
                                              this.get('/LeftPanel.model').changed(  str , false);
+                                             */
                                         }
                                     },
                                     pack : "set_buffer"
@@ -227,13 +243,14 @@ FixBug=new XObject({
         },
         {
             xtype: Gtk.Button,
-            pack : "add_action_widget,1",
-            label : "OK"
+            label : "Cancel",
+            pack : "add_action_widget,0"
         },
         {
             xtype: Gtk.Button,
-            pack : "add_action_widget,0",
-            label : "Cancel"
+            id : "ok_button",
+            label : "OK",
+            pack : "add_action_widget,1"
         }
     ]
 });