X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Factions%2Fwaypointsimpleadd.cpp;h=1fda94559e3007403e3e201bf5173810fee540c9;hb=6989d1403b14b5b27dbf81b2c1cf6889511adf97;hp=0873a3bbf410a300c9f8bc848fa70e965f805791;hpb=ce408de81ca266b1f334ee9bc6c8fb7ba1492ed4;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/actions/waypointsimpleadd.cpp b/synfig-studio/trunk/src/synfigapp/actions/waypointsimpleadd.cpp index 0873a3b..1fda945 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/waypointsimpleadd.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/waypointsimpleadd.cpp @@ -2,7 +2,7 @@ /*! \file waypointsimpleadd.cpp ** \brief Simple add waypoint File ** -** $Id: waypointsimpleadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2004 Adrian Bentley @@ -32,6 +32,8 @@ #include "waypointsimpleadd.h" #include +#include + #endif using namespace std; @@ -43,13 +45,13 @@ using namespace Action; /* === M A C R O S ========================================================= */ ACTION_INIT(Action::WaypointSimpleAdd); -ACTION_SET_NAME(Action::WaypointSimpleAdd,"waypoint_simpleadd"); -ACTION_SET_LOCAL_NAME(Action::WaypointSimpleAdd,"Simply Add Waypoint"); +ACTION_SET_NAME(Action::WaypointSimpleAdd,"WaypointSimpleAdd"); +ACTION_SET_LOCAL_NAME(Action::WaypointSimpleAdd,N_("Simply Add Waypoint")); ACTION_SET_TASK(Action::WaypointSimpleAdd,"add"); ACTION_SET_CATEGORY(Action::WaypointSimpleAdd,Action::CATEGORY_WAYPOINT); ACTION_SET_PRIORITY(Action::WaypointSimpleAdd,0); ACTION_SET_VERSION(Action::WaypointSimpleAdd,"0.0"); -ACTION_SET_CVS_ID(Action::WaypointSimpleAdd,"$Id: waypointsimpleadd.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $"); +ACTION_SET_CVS_ID(Action::WaypointSimpleAdd,"$Id$"); /* === G L O B A L S ======================================================= */ @@ -67,7 +69,7 @@ Action::ParamVocab Action::WaypointSimpleAdd::get_param_vocab() { ParamVocab ret(Action::CanvasSpecific::get_param_vocab()); - + ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE) .set_local_name(_("Destination ValueNode (Animated)")) ); @@ -81,9 +83,9 @@ Action::WaypointSimpleAdd::get_param_vocab() } bool -Action::WaypointSimpleAdd::is_canidate(const ParamList &x) +Action::WaypointSimpleAdd::is_candidate(const ParamList &x) { - return canidate_check(get_param_vocab(),x); + return candidate_check(get_param_vocab(),x); } bool @@ -92,13 +94,13 @@ Action::WaypointSimpleAdd::set_param(const synfig::String& name, const Action::P if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE) { value_node=ValueNode_Animated::Handle::cast_dynamic(param.get_value_node()); - + return static_cast(value_node); } if(name=="waypoint" && param.get_type()==Param::TYPE_WAYPOINT) { waypoint = param.get_waypoint(); - + return true; } @@ -115,20 +117,21 @@ Action::WaypointSimpleAdd::is_ready()const void Action::WaypointSimpleAdd::perform() -{ +{ //remove any pretenders that lie at our destination ValueNode_Animated::findresult iter = value_node->find_time(waypoint.get_time()); - + time_overwrite = false; if(iter.second) { overwritten_wp = *iter.first; time_overwrite = true; + value_node->erase(overwritten_wp); } - + //add the value node in since it's safe value_node->add(waypoint); - + // Signal that a valuenode has been changed value_node->changed(); } @@ -138,20 +141,20 @@ Action::WaypointSimpleAdd::undo() { //remove our old version... ValueNode_Animated::findresult iter = value_node->find_uid(waypoint); - + if(!iter.second) { throw Error(_("The waypoint to remove no longer exists")); } - + //remove the offending value value_node->erase(*iter.first); //could also just use waypoint - + if(time_overwrite) { - value_node->add(overwritten_wp); + value_node->add(overwritten_wp); } - + // Signal that a valuenode has been changed value_node->changed(); }