From 5b6ffb96be7d341a83c92e56c0d4da09a08b1f37 Mon Sep 17 00:00:00 2001 From: dooglus Date: Sun, 13 Jan 2008 16:33:36 +0000 Subject: [PATCH] Moved the code that formats the ValueDesc description into value_desc.cpp, and call it there rather than having it local to this action. Other actions will want to use it as well. git-svn-id: http://svn.voria.com/code@1345 1f10aa63-cdf2-0310-b900-c93c546f37ac --- .../trunk/src/synfigapp/actions/valuedescset.cpp | 36 +++------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp index 85e1fce..7f6f686 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp @@ -77,38 +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", // layer -> parameter - value_desc.get_layer()->get_non_empty_description().c_str(), - value_desc.get_param_name().c_str()); - if (value_desc.is_exported()) - name += strprintf(" (%s)", value_desc.get_value_node()->get_id().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(node);node=*node->parent_set.begin()); - Layer::Handle parent_layer(dynamic_cast(node)); - if(parent_layer) - name = strprintf("'%s' => %s", // layer -> sub-parameter - 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()); // sub-parameter - if (value_desc.is_exported()) - name += strprintf(" (%s)", value_desc.get_value_node()->get_id().c_str()); - } - else if (value_desc.is_exported()) - name = strprintf(_("ValueNode (%s)"), value_desc.get_value_node()->get_id().c_str()); - - return strprintf(_("Set %s"), name.c_str()); + return strprintf(_("Set %s"), + value_desc + ? value_desc.get_description().c_str() + : _("ValueDesc")); } Action::ParamVocab -- 2.7.4