From: dooglus Date: Sun, 13 Jan 2008 22:46:34 +0000 (+0000) Subject: Add an optional parameter to ValueDesc::get_description() to suppress reporting the... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6084e4453c8726a94bc3796cfdefcef113571f83;p=synfig.git Add an optional parameter to ValueDesc::get_description() to suppress reporting the exported name. git-svn-id: http://svn.voria.com/code@1348 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/synfigapp/value_desc.cpp b/synfig-studio/trunk/src/synfigapp/value_desc.cpp index 96f04f6..425f25b 100644 --- a/synfig-studio/trunk/src/synfigapp/value_desc.cpp +++ b/synfig-studio/trunk/src/synfigapp/value_desc.cpp @@ -48,16 +48,19 @@ using namespace synfigapp; /* === M E T H O D S ======================================================= */ String -ValueDesc::get_description()const +ValueDesc::get_description(bool show_exported_name)const { String description(_("ValueDesc")); + if (show_exported_name && !is_exported()) + show_exported_name = false; + if (parent_is_layer_param()) { description = strprintf("'%s' -> %s", // layer -> parameter get_layer()->get_non_empty_description().c_str(), get_param_name().c_str()); - if (is_exported()) + if (show_exported_name) description += strprintf(" (%s)", get_value_node()->get_id().c_str()); } else if (parent_is_value_node()) @@ -72,10 +75,10 @@ ValueDesc::get_description()const value_node->link_local_name(get_index()).c_str()); else description = value_node->link_local_name(get_index()); // sub-parameter - if (is_exported()) + if (show_exported_name) description += strprintf(" (%s)", get_value_node()->get_id().c_str()); } - else if (is_exported()) + else if (show_exported_name) description = strprintf(_("ValueNode (%s)"), get_value_node()->get_id().c_str()); return description; diff --git a/synfig-studio/trunk/src/synfigapp/value_desc.h b/synfig-studio/trunk/src/synfigapp/value_desc.h index d7767d3..509f871 100644 --- a/synfig-studio/trunk/src/synfigapp/value_desc.h +++ b/synfig-studio/trunk/src/synfigapp/value_desc.h @@ -177,7 +177,7 @@ public: } synfig::String - get_description()const; + get_description(bool show_exported_name = true)const; }; // END of class ValueDesc }; // END of namespace synfigapp_instance