Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-studio / trunk / src / synfigapp / actions / valuedescset.cpp
index e5edf2a..e3959ce 100644 (file)
@@ -6,7 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-**     Copyright (c) 2007 Chris Moore
+**     Copyright (c) 2007, 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
@@ -55,7 +55,7 @@ using namespace Action;
 /* === M A C R O S ========================================================= */
 
 ACTION_INIT_NO_GET_LOCAL_NAME(Action::ValueDescSet);
-ACTION_SET_NAME(Action::ValueDescSet,"value_desc_set");
+ACTION_SET_NAME(Action::ValueDescSet,"ValueDescSet");
 ACTION_SET_LOCAL_NAME(Action::ValueDescSet,N_("Set ValueDesc"));
 ACTION_SET_TASK(Action::ValueDescSet,"set");
 ACTION_SET_CATEGORY(Action::ValueDescSet,Action::CATEGORY_VALUEDESC);
@@ -77,30 +77,10 @@ Action::ValueDescSet::ValueDescSet():
 synfig::String
 Action::ValueDescSet::get_local_name()const
 {
-       String name("ValueDesc");
-
-       if(!value_desc)
-       {
-       }
-       else if(value_desc.parent_is_layer_param())
-               name = strprintf(_("'%s' -> %s"),
-                                                value_desc.get_layer()->get_non_empty_description().c_str(),
-                                                value_desc.get_param_name().c_str());
-       else if(value_desc.parent_is_value_node())
-       {
-               synfig::LinkableValueNode::Handle value_node(synfig::LinkableValueNode::Handle::cast_reinterpret(value_desc.get_parent_value_node()));
-               synfig::Node* node;
-               for(node=value_node.get();!node->parent_set.empty() && !dynamic_cast<Layer*>(node);node=*node->parent_set.begin());
-               Layer::Handle parent_layer(dynamic_cast<Layer*>(node));
-               if(parent_layer)
-                       name = strprintf(_("'%s' => %s"),
-                                                        parent_layer->get_non_empty_description().c_str(),
-                                                        value_node->link_local_name(value_desc.get_index()).c_str());
-               else
-                       name = value_node->link_local_name(value_desc.get_index());
-       }
-
-       return strprintf(_("Set %s"), name.c_str());
+       return strprintf(_("Set %s"),
+                                        value_desc
+                                        ? value_desc.get_description().c_str()
+                                        : _("ValueDesc"));
 }
 
 Action::ParamVocab
@@ -179,8 +159,6 @@ Action::ValueDescSet::prepare()
                (value_desc.get_index()==4 || value_desc.get_index()==5) &&
                (*value_desc.get_parent_value_node())(time).get(BLinePoint()).get_split_tangent_flag()==false)
        {
-               printf("a tangent got changed - #%d\n", value_desc.get_index()-3);
-
                {
                        ValueNode_Composite::Handle parent_value_node;
                        parent_value_node=parent_value_node.cast_dynamic(value_desc.get_parent_value_node());
@@ -188,21 +166,18 @@ Action::ValueDescSet::prepare()
 
                        Vector t1((*parent_value_node->get_link("t1"))(time));
                        Vector t2((*parent_value_node->get_link("t2"))(time));
-                       printf("current values are: t1(%.2f, %2.f)  t2(%.2f, %.2f)\n", t1[0], t1[1], t2[0], t2[1]);
                }
 
                if (value_desc.get_index()==4) {
-                       printf("copying change to tangent 2\n");
-                       DEBUGPOINT();
                        ValueNode_Composite::Handle parent_value_node;
                        parent_value_node=parent_value_node.cast_dynamic(value_desc.get_parent_value_node());
 
                        assert(parent_value_node);
 
-                       Action::Handle action(Action::create("value_desc_set"));
+                       Action::Handle action(Action::create("ValueDescSet"));
 
                        if(!action)
-                               throw Error(_("Unable to find action value_desc_set (bug)"));
+                               throw Error(_("Unable to find action ValueDescSet (bug)"));
 
                        action->set_param("canvas",get_canvas());
                        action->set_param("canvas_interface",get_canvas_interface());
@@ -224,10 +199,10 @@ Action::ValueDescSet::prepare()
        {
                ValueDesc reference_value_desc(ValueNode_Reference::Handle::cast_dynamic(value_desc.get_value_node()),0);
 
-               Action::Handle action(Action::create("value_desc_set"));
+               Action::Handle action(Action::create("ValueDescSet"));
 
                if(!action)
-                       throw Error(_("Unable to find action value_desc_set (bug)"));
+                       throw Error(_("Unable to find action ValueDescSet (bug)"));
 
                action->set_param("canvas",get_canvas());
                action->set_param("canvas_interface",get_canvas_interface());
@@ -292,10 +267,10 @@ Action::ValueDescSet::prepare()
                {
                        ValueDesc component_value_desc(ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()),i);
 
-                       Action::Handle action(Action::create("value_desc_set"));
+                       Action::Handle action(Action::create("ValueDescSet"));
 
                        if(!action)
-                               throw Error(_("Unable to find action value_desc_set (bug)"));
+                               throw Error(_("Unable to find action ValueDescSet (bug)"));
 
                        action->set_param("canvas",get_canvas());
                        action->set_param("canvas_interface",get_canvas_interface());
@@ -350,10 +325,10 @@ Action::ValueDescSet::prepare()
                {
                        ValueDesc component_value_desc(ValueNode_RadialComposite::Handle::cast_dynamic(value_desc.get_value_node()),i);
 
-                       Action::Handle action(Action::create("value_desc_set"));
+                       Action::Handle action(Action::create("ValueDescSet"));
 
                        if(!action)
-                               throw Error(_("Unable to find action value_desc_set (bug)"));
+                               throw Error(_("Unable to find action ValueDescSet (bug)"));
 
                        action->set_param("canvas",get_canvas());
                        action->set_param("canvas_interface",get_canvas_interface());
@@ -387,10 +362,10 @@ Action::ValueDescSet::prepare()
            {
                        // we are splitting tangents
 
-                       Action::Handle action(Action::create("value_desc_set"));
+                       Action::Handle action(Action::create("ValueDescSet"));
 
                        if(!action)
-                               throw Error(_("Unable to find action value_desc_set (bug)"));
+                               throw Error(_("Unable to find action ValueDescSet (bug)"));
 
                        action->set_param("canvas",get_canvas());
                        action->set_param("canvas_interface",get_canvas_interface());
@@ -412,10 +387,10 @@ Action::ValueDescSet::prepare()
                                                           (Vector)((*parent_value_node->get_link("t2"))(time))) / 2);
 
                        {
-                               Action::Handle action(Action::create("value_desc_set"));
+                               Action::Handle action(Action::create("ValueDescSet"));
 
                                if(!action)
-                                       throw Error(_("Unable to find action value_desc_set (bug)"));
+                                       throw Error(_("Unable to find action ValueDescSet (bug)"));
 
                                action->set_param("canvas",get_canvas());
                                action->set_param("canvas_interface",get_canvas_interface());
@@ -430,10 +405,10 @@ Action::ValueDescSet::prepare()
                        }
 
                        {
-                               Action::Handle action(Action::create("value_desc_set"));
+                               Action::Handle action(Action::create("ValueDescSet"));
 
                                if(!action)
-                                       throw Error(_("Unable to find action value_desc_set (bug)"));
+                                       throw Error(_("Unable to find action ValueDescSet (bug)"));
 
                                action->set_param("canvas",get_canvas());
                                action->set_param("canvas_interface",get_canvas_interface());
@@ -500,7 +475,7 @@ Action::ValueDescSet::prepare()
                        }
                        else
                        {
-                               action=Action::create("value_node_replace");
+                               action=Action::create("ValueNodeReplace");
                                action->set_param("dest",value_desc.get_value_node());
                                action->set_param("src",ValueNode::Handle(value_node));
                        }
@@ -511,7 +486,6 @@ Action::ValueDescSet::prepare()
                        if(!action->is_ready())
                                throw Error(Error::TYPE_NOTREADY);
 
-                               DEBUGPOINT();
                        add_action_front(action);
                }
                else
@@ -519,7 +493,6 @@ Action::ValueDescSet::prepare()
                        value_node=value_node.cast_dynamic(value_desc.get_value_node());
                }
 
-                               DEBUGPOINT();
                if(!value_node)
                        throw Error(_("Direct manipulation of this ValueNode type is not yet supported"));
 
@@ -541,7 +514,6 @@ Action::ValueDescSet::prepare()
                if(!action->is_ready())
                        throw Error(Error::TYPE_NOTREADY);
 
-                               DEBUGPOINT();
                add_action(action);
 
                return;