X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftags%2Fstable%2Fsrc%2Fsynfigapp%2Factions%2Fvaluedescconnect.cpp;h=7c2dfb2ba6e100e0837a8d94e092524c0485ccac;hb=47fce282611fbba1044921d22ca887f9b53ad91a;hp=420e17e46016db87fb66d92234ec5f3fc6c0db68;hpb=f6184c2a9c2245aae802c31c8f3300e1b744359c;p=synfig.git diff --git a/synfig-studio/tags/stable/src/synfigapp/actions/valuedescconnect.cpp b/synfig-studio/tags/stable/src/synfigapp/actions/valuedescconnect.cpp index 420e17e..7c2dfb2 100644 --- a/synfig-studio/tags/stable/src/synfigapp/actions/valuedescconnect.cpp +++ b/synfig-studio/tags/stable/src/synfigapp/actions/valuedescconnect.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -36,6 +37,8 @@ #include "valuedescconnect.h" #include +#include + #endif using namespace std; @@ -46,9 +49,9 @@ using namespace Action; /* === M A C R O S ========================================================= */ -ACTION_INIT(Action::ValueDescConnect); +ACTION_INIT_NO_GET_LOCAL_NAME(Action::ValueDescConnect); ACTION_SET_NAME(Action::ValueDescConnect,"value_desc_connect"); -ACTION_SET_LOCAL_NAME(Action::ValueDescConnect,"Connect"); +ACTION_SET_LOCAL_NAME(Action::ValueDescConnect,N_("Connect")); ACTION_SET_TASK(Action::ValueDescConnect,"connect"); ACTION_SET_CATEGORY(Action::ValueDescConnect,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE); ACTION_SET_PRIORITY(Action::ValueDescConnect,0); @@ -65,6 +68,15 @@ Action::ValueDescConnect::ValueDescConnect() { } +synfig::String +Action::ValueDescConnect::get_local_name()const +{ + // TRANSLATORS: This is used in the 'history' dialog when a connection is made. + return strprintf(_("Connect '%s' to '%s'"), + value_desc.get_description(false).c_str(), + value_node->get_id().c_str()); +} + Action::ParamVocab Action::ValueDescConnect::get_param_vocab() { @@ -93,6 +105,17 @@ 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(); @@ -213,5 +236,5 @@ Action::ValueDescConnect::prepare() return; } - throw Error(_("ValueDesc is not recognised or supported.")); + throw Error(_("ValueDesc is not recognized or supported.")); }