From d780ceae6fd8c579b28cd5b6dd1e9688e130fd2d Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 7 Jan 2008 17:26:34 +0000 Subject: [PATCH] Don't show the option of connecting to an existing Index parameter of the Duplicate layer. git-svn-id: http://svn.voria.com/code@1282 1f10aa63-cdf2-0310-b900-c93c546f37ac --- .../trunk/src/synfigapp/actions/valuedescconnect.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescconnect.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescconnect.cpp index fe4714b..062edee 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuedescconnect.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuedescconnect.cpp @@ -95,15 +95,31 @@ Action::ValueDescConnect::is_candidate(const ParamList &x) { if(candidate_check(get_param_vocab(),x)) { + // don't show the option of connecting to an existing Index parameter of the Duplicate layer + if(x.count("dest")) + { + ValueDesc value_desc=x.find("dest")->second.get_value_desc(); + + if (value_desc.parent_is_layer_param() && + value_desc.get_layer()->get_name() == "duplicate" && + value_desc.get_param_name() == "index") + return false; + } + if(x.count("src")) { ValueDesc value_desc=x.find("dest")->second.get_value_desc(); ValueNode::Handle value_node=x.find("src")->second.get_value_node(); if(value_desc.get_value_type()==value_node->get_type()) + { + printf("%s:%d\n", __FILE__, __LINE__); return true; + } } + printf("%s:%d\n", __FILE__, __LINE__); return true; } + printf("%s:%d\n", __FILE__, __LINE__); return false; } -- 2.7.4