Fix 1924592: Editing the name, description, or id of a canvas should mark the canvas...
[synfig.git] / synfig-studio / trunk / src / synfigapp / actions / waypointadd.cpp
index 3354c8c..f080910 100644 (file)
@@ -33,6 +33,8 @@
 #include <synfigapp/canvasinterface.h>
 #include <synfigapp/main.h>
 
+#include <synfigapp/general.h>
+
 #endif
 
 using namespace std;
@@ -45,7 +47,7 @@ using namespace Action;
 
 ACTION_INIT(Action::WaypointAdd);
 ACTION_SET_NAME(Action::WaypointAdd,"waypoint_add");
-ACTION_SET_LOCAL_NAME(Action::WaypointAdd,"Add Waypoint");
+ACTION_SET_LOCAL_NAME(Action::WaypointAdd,N_("Add Waypoint"));
 ACTION_SET_TASK(Action::WaypointAdd,"add");
 ACTION_SET_CATEGORY(Action::WaypointAdd,Action::CATEGORY_WAYPOINT);
 ACTION_SET_PRIORITY(Action::WaypointAdd,0);
@@ -92,16 +94,11 @@ Action::WaypointAdd::get_param_vocab()
 bool
 Action::WaypointAdd::is_candidate(const ParamList &x)
 {
-       if(candidate_check(get_param_vocab(),x))
-       {
-               if(!ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()))
-                       return false;
-
-               // We need either a waypoint or a time.
-               if(x.count("waypoint") || x.count("time"))
-                       return true;
-       }
-       return false;
+       return (candidate_check(get_param_vocab(),x) &&
+                       // We need an animated valuenode.
+                       ValueNode_Animated::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()) &&
+                       // We need either a waypoint or a time.
+                       (x.count("waypoint") || x.count("time")));
 }
 
 bool