src/Builder4/MainWindow.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 15 May 2015 08:17:38 +0000 (16:17 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 15 May 2015 08:17:38 +0000 (16:17 +0800)
src/Builder4/MainWindow.vala

src/Builder4/MainWindow.bjs
src/Builder4/MainWindow.vala

index 70deef5..0b01f0d 100644 (file)
         {
          "id" : "statusbar",
          "ulong handler_id" : "-1",
-         "* init" : "{\n     this.handler_id = Resources.singleton().updateProgress.connect((pos) => {\n        if (pos < 1) {\n            this.el.hide();\n            _this.mainpane.el.set_sensitive(true);\n            \n            return;\n        }\n         _this.mainpane.el.set_sensitive(false);\n       /*    \n        this.el.show();\n        var cid = this.el.get_context_id(\"resources\");\n        this.el.remove_all(cid);\n        this.el.push(cid,\"Fetching Resource : %s/7\".printf(pos.to_string()));\n        */ \n     });\n}\n",
+         "* init" : "{\n     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {\n        if (pos < 1) {\n            this.el.hide();\n            _this.mainpane.el.set_sensitive(true);\n            \n            return;\n        }\n         _this.mainpane.el.set_sensitive(false);\n         this.el.show();\n         this.el.set_fraction ((1.0f * pos) / (1.0f * total));\n         \n       /*    \n        this.el.show();\n        var cid = this.el.get_context_id(\"resources\");\n        this.el.remove_all(cid);\n        this.el.push(cid,\"Fetching Resource : %s/7\".printf(pos.to_string()));\n        */ \n     });\n}\n",
          "xtype" : "ProgressBar",
          "* pack" : "pack_start,true,true,0",
          "$ xns" : "Gtk"
index f39653f..b4b649c 100644 (file)
@@ -2172,7 +2172,7 @@ public class Xcls_MainWindow : Object
             // init method 
 
             {
-                 this.handler_id = Resources.singleton().updateProgress.connect((pos) => {
+                 this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
                     if (pos < 1) {
                         this.el.hide();
                         _this.mainpane.el.set_sensitive(true);
@@ -2180,6 +2180,9 @@ public class Xcls_MainWindow : Object
                         return;
                     }
                      _this.mainpane.el.set_sensitive(false);
+                     this.el.show();
+                     this.el.set_fraction ((1.0f * pos) / (1.0f * total));
+                     
                    /*    
                     this.el.show();
                     var cid = this.el.get_context_id("resources");