X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Factions%2Factivepointsetoff.cpp;h=887417a6304cd69206ef7e02d1424861d407e742;hb=b8b7bf129a4d7218e570102ee3c5cd7e584f0bcb;hp=cea48cd5591542898c428233e9946825287ec4c4;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/actions/activepointsetoff.cpp b/synfig-studio/trunk/src/synfigapp/actions/activepointsetoff.cpp index cea48cd..887417a 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/activepointsetoff.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/activepointsetoff.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 @@ -40,6 +41,8 @@ #include "valuedescconnect.h" #include +#include + #endif using namespace std; @@ -52,7 +55,7 @@ using namespace Action; ACTION_INIT(Action::ActivepointSetOff); ACTION_SET_NAME(Action::ActivepointSetOff,"activepoint_set_off"); -ACTION_SET_LOCAL_NAME(Action::ActivepointSetOff,_("Mark Activepoint as \"Off\"")); +ACTION_SET_LOCAL_NAME(Action::ActivepointSetOff,N_("Mark Activepoint as \"Off\"")); ACTION_SET_TASK(Action::ActivepointSetOff,"set_off"); ACTION_SET_CATEGORY(Action::ActivepointSetOff,Action::CATEGORY_ACTIVEPOINT|Action::CATEGORY_VALUEDESC); ACTION_SET_PRIORITY(Action::ActivepointSetOff,-9); @@ -97,22 +100,22 @@ Action::ActivepointSetOff::get_param_vocab() bool Action::ActivepointSetOff::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; - // We are only a candidate if this canvas is animated. - Canvas::Handle canvas(x.find("canvas")->second.get_canvas()); - if(canvas->rend_desc().get_time_start()==canvas->rend_desc().get_time_end()) - return false; + ValueDesc value_desc(x.find("value_desc")->second.get_value_desc()); - // We need either a activepoint or a time. - if(x.count("activepoint") || x.count("time")) - return true; - } - return false; + if (!(value_desc.parent_is_value_node() && + // We need a dynamic list. + ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))) + return false; + + Canvas::Handle canvas(x.find("canvas")->second.get_canvas()); + + // We are only a candidate if this canvas is animated. + return (canvas->rend_desc().get_time_start() != canvas->rend_desc().get_time_end() && + // We need either an activepoint or a time. + (x.count("activepoint") || x.count("time"))); } bool