/*! \file activepointseton.cpp
** \brief Template File
**
-** $Id: activepointseton.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
#include "valuedescconnect.h"
#include <synfigapp/canvasinterface.h>
+#include <synfigapp/general.h>
+
#endif
using namespace std;
ACTION_INIT(Action::ActivepointSetOn);
ACTION_SET_NAME(Action::ActivepointSetOn,"activepoint_set_on");
-ACTION_SET_LOCAL_NAME(Action::ActivepointSetOn,_("Mark Activepoint as \"On\""));
+ACTION_SET_LOCAL_NAME(Action::ActivepointSetOn,N_("Mark Activepoint as \"On\""));
ACTION_SET_TASK(Action::ActivepointSetOn,"set_on");
ACTION_SET_CATEGORY(Action::ActivepointSetOn,Action::CATEGORY_ACTIVEPOINT|Action::CATEGORY_VALUEDESC);
ACTION_SET_PRIORITY(Action::ActivepointSetOn,-10);
ACTION_SET_VERSION(Action::ActivepointSetOn,"0.0");
-ACTION_SET_CVS_ID(Action::ActivepointSetOn,"$Id: activepointseton.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+ACTION_SET_CVS_ID(Action::ActivepointSetOn,"$Id$");
/* === G L O B A L S ======================================================= */
bool
Action::ActivepointSetOn::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