src/Builder4/PopoverFileDetails.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 13 Nov 2015 07:26:57 +0000 (15:26 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 13 Nov 2015 07:26:57 +0000 (15:26 +0800)
src/Builder4/PopoverFileDetails.vala

src/Builder4/PopoverFileDetails.bjs
src/Builder4/PopoverFileDetails.vala

index 749643f..e965ebc 100644 (file)
         },
         {
          "listeners" : {
-          "changed" : "() => {\n\tGtk.TreeIter iter;\n\tbool is_bjs = true;\n\tif (this.el.get_active_iter(out iter)) {\n\t\tValue vfname;\n\t\t_this.ftdbmodel.el.get_value (iter, 0, out vfname);\n\t\t is_bjs = ((string)vfname) == \"bjs\";\n\t}\n    \n   for (var i = 2; i < 9;i++) {\n\t\tvar el = _this.grid.el.get_child_at(0,i);\n\t\t\n\t\tvar showhide= is_bjs;\n\t\tif (i> 7) {\n\t\t\tshowhide = !showhide;\n\t\t}\n\t\t\n\t\tif (showhide) {\n\t\t   el.show();\n\t\t} else {\n\t\t\tel.hide();\n\t\t}\n\t\t el = _this.grid.el.get_child_at(1,i);\n\t\tif (showhide) {\n\t\t   el.show();\n\t\t} else {\n\t\t\tel.hide();\n\t\t}     \n    }\n    // directory is only available for non-bjs \n     \n\n\n}\n"
+          "changed" : "() => {\n\tGtk.TreeIter iter;\n\tbool is_bjs = true;\n\tif (this.el.get_active_iter(out iter)) {\n\t\tValue vfname;\n\t\t_this.ftdbmodel.el.get_value (iter, 0, out vfname);\n\t\t is_bjs = ((string)vfname) == \"bjs\";\n\t}\n    \n  \n    // directory is only available for non-bjs \n     \n\n\n}\n"
          },
          "id" : "filetype",
          "* init" : "this.el.add_attribute(_this.ftdbcellrenderer.el , \"markup\", 1 );",
          "* pack" : "attach,1,0,1,1",
          "xtype" : "ComboBox",
-         "| void showhide" : "() {\n\n}\n",
+         "| void showhide" : "(bool is_bjs) {\n\tfor (var i = 2; i < 9;i++) {\n\t\tvar el = _this.grid.el.get_child_at(0,i);\n\t\t\n\t\tvar showhide= is_bjs;\n\t\tif (i> 7) {\n\t\t\tshowhide = !showhide;\n\t\t}\n\t\t\n\t\tif (showhide) {\n\t\t   el.show();\n\t\t} else {\n\t\t\tel.hide();\n\t\t}\n\t\t el = _this.grid.el.get_child_at(1,i);\n\t\tif (showhide) {\n\t\t   el.show();\n\t\t} else {\n\t\t\tel.hide();\n\t\t}     \n    }\n}\n",
          "$ xns" : "Gtk",
          "items" : [
           {
index 30e94c0..a0effb0 100644 (file)
@@ -373,26 +373,7 @@ public class Xcls_PopoverFileDetails : Object
                         is_bjs = ((string)vfname) == "bjs";
                }
                 
-               for (var i = 2; i < 9;i++) {
-                       var el = _this.grid.el.get_child_at(0,i);
-                       
-                       var showhide= is_bjs;
-                       if (i> 7) {
-                               showhide = !showhide;
-                       }
-                       
-                       if (showhide) {
-                          el.show();
-                       } else {
-                               el.hide();
-                       }
-                        el = _this.grid.el.get_child_at(1,i);
-                       if (showhide) {
-                          el.show();
-                       } else {
-                               el.hide();
-                       }     
-                }
+              
                 // directory is only available for non-bjs 
                  
             
@@ -401,8 +382,27 @@ public class Xcls_PopoverFileDetails : Object
         }
 
         // user defined functions
-        public void showhide () {
-        
+        public void showhide (bool is_bjs) {
+               for (var i = 2; i < 9;i++) {
+                       var el = _this.grid.el.get_child_at(0,i);
+                       
+                       var showhide= is_bjs;
+                       if (i> 7) {
+                               showhide = !showhide;
+                       }
+                       
+                       if (showhide) {
+                          el.show();
+                       } else {
+                               el.hide();
+                       }
+                        el = _this.grid.el.get_child_at(1,i);
+                       if (showhide) {
+                          el.show();
+                       } else {
+                               el.hide();
+                       }     
+            }
         }
     }
     public class Xcls_ftdbcellrenderer : Object