src/Builder4/PopoverProperty.bjs
authorAlan <alan@roojs.com>
Thu, 9 Jun 2022 05:59:49 +0000 (13:59 +0800)
committerAlan <alan@roojs.com>
Thu, 9 Jun 2022 05:59:49 +0000 (13:59 +0800)
src/Builder4/PopoverProperty.vala

src/Builder4/PopoverProperty.bjs
src/Builder4/PopoverProperty.vala

index f747a89..1dac5c4 100644 (file)
            "\t\t// error should already be showing?",
            "\t\treturn;",
            "\t}",
+           "\tthis.updateProp();",
+           "\t",
+           "\t// since we can't add listeners?!?!?",
+           "\t// only check props.",
+           "\t",
+           "\tif (this.node.props.has_key(prop.to_index_key())) {",
+           "\t\t_this.error.setError(\"Property already exists\");",
+           "\t\treturn;",
+           "\t",
+           "\t}",
+           "\tthis.node.set_prop(prop);",
+           "\tthis.is_new = false;",
+           "\t",
            "\t",
            "\t",
            "\t// check if property already exists in node.",
index 1a7b08b..64cb72a 100644 (file)
@@ -722,6 +722,19 @@ public class Xcls_PopoverProperty : Object
                        // error should already be showing?
                        return;
                }
+               this.updateProp();
+               
+               // since we can't add listeners?!?!?
+               // only check props.
+               
+               if (this.node.props.has_key(prop.to_index_key())) {
+                       _this.error.setError("Property already exists");
+                       return;
+               
+               }
+               this.node.set_prop(prop);
+               this.is_new = false;
+               
                
                
                // check if property already exists in node.