X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Factions%2Fvaluenodedynamiclistremove.cpp;h=0f50d811bdf24b6739bdf3d03fe752d269796e09;hb=1e0ddeb566a2766b85bffc17e501721cc025d851;hp=36dc7da88f0e8da9a41055cc723a4e7883dd23b7;hpb=c34eaa5441242b3e9a7b7645e9ee4983d14eae85;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp index 36dc7da..0f50d81 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp @@ -2,10 +2,11 @@ /*! \file valuenodedynamiclistremove.cpp ** \brief Template File ** -** $Id: valuenodedynamiclistremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $ +** $Id$ ** ** \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 @@ -32,6 +33,8 @@ #include "valuenodedynamiclistremove.h" #include +#include + #endif using namespace std; @@ -43,13 +46,13 @@ using namespace Action; /* === M A C R O S ========================================================= */ ACTION_INIT(Action::ValueNodeDynamicListRemove); -ACTION_SET_NAME(Action::ValueNodeDynamicListRemove,"value_node_dynamic_list_remove"); -ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListRemove,"Remove Item"); +ACTION_SET_NAME(Action::ValueNodeDynamicListRemove,"ValueNodeDynamicListRemove"); +ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListRemove,N_("Remove Item")); ACTION_SET_TASK(Action::ValueNodeDynamicListRemove,"remove"); ACTION_SET_CATEGORY(Action::ValueNodeDynamicListRemove,Action::CATEGORY_VALUEDESC|Action::CATEGORY_VALUENODE|Action::CATEGORY_HIDDEN); ACTION_SET_PRIORITY(Action::ValueNodeDynamicListRemove,-19); ACTION_SET_VERSION(Action::ValueNodeDynamicListRemove,"0.0"); -ACTION_SET_CVS_ID(Action::ValueNodeDynamicListRemove,"$Id: valuenodedynamiclistremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $"); +ACTION_SET_CVS_ID(Action::ValueNodeDynamicListRemove,"$Id$"); /* === G L O B A L S ======================================================= */ @@ -78,15 +81,14 @@ Action::ValueNodeDynamicListRemove::get_param_vocab() bool Action::ValueNodeDynamicListRemove::is_candidate(const ParamList &x) { - if(candidate_check(get_param_vocab(),x)) - { - ValueDesc value_desc(x.find("value_desc")->second.get_value_desc()); - if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node())) - return false; + if (!candidate_check(get_param_vocab(),x)) + return false; - return true; - } - return false; + ValueDesc value_desc(x.find("value_desc")->second.get_value_desc()); + + return (value_desc.parent_is_value_node() && + // We need a dynamic list. + ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node())); } bool