X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Factions%2Fvaluenodedynamiclistremove.cpp;h=a4c4d5f55631567ad0d182d585ce07cd36c1c52c;hb=11f5539cc9a43c0407829c7949c375145d0e186e;hp=94965497dd164aa2e568886b22fdad6b627a9a07;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp index 9496549..a4c4d5f 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuenodedynamiclistremove.cpp @@ -32,6 +32,8 @@ #include "valuenodedynamiclistremove.h" #include +#include + #endif using namespace std; @@ -44,7 +46,7 @@ using namespace Action; ACTION_INIT(Action::ValueNodeDynamicListRemove); ACTION_SET_NAME(Action::ValueNodeDynamicListRemove,"value_node_dynamic_list_remove"); -ACTION_SET_LOCAL_NAME(Action::ValueNodeDynamicListRemove,"Remove Item"); +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); @@ -78,15 +80,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