Don't allow Duplicate ValueNodes in the Children dialog to be disconnected.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 7 Jan 2008 16:46:36 +0000 (16:46 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 7 Jan 2008 16:46:36 +0000 (16:46 +0000)
git-svn-id: http://svn.voria.com/code@1280 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/synfigapp/actions/valuedescdisconnect.cpp

index c387f1b..091ab9a 100644 (file)
@@ -36,6 +36,7 @@
 #include "valuedescdisconnect.h"
 #include <synfigapp/canvasinterface.h>
 #include <synfig/valuenode_const.h>
+#include <synfig/valuenode_duplicate.h>
 
 #include <synfigapp/general.h>
 
@@ -102,6 +103,12 @@ Action::ValueDescDisconnect::is_candidate(const ParamList &x)
                        return false;
                if(value_desc.is_value_node() && ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
                        return false;
+               // don't allow Duplicate ValueNodes in the Children dialog to be disconnected
+               if(value_desc.is_value_node() &&
+                  ValueNode_Duplicate::Handle::cast_dynamic(value_desc.get_value_node()) &&
+                  !value_desc.parent_is_layer_param() &&
+                  !value_desc.parent_is_value_node())
+                       return false;
                return true;
        }
        return false;