Skip to content

Commit

Permalink
How to display a GUID. We should use a bone-specific type I guess.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Moore committed Jan 4, 2009
1 parent c029d53 commit 9936c47
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

#include "cellrenderer_gradient.h"
#include "cellrenderer_value.h"
#include <synfig/valuenode_bone.h>

#include "widget_gradient.h"
#include "dialog_gradient.h"
Expand Down Expand Up @@ -453,6 +454,22 @@ CellRenderer_ValueBase::render_vfunc(
case ValueBase::TYPE_BONE:
property_text()=(Glib::ustring)_("Bone");
break;
case ValueBase::TYPE_GUID:
{
GUID guid(data.get(GUID()));
String name(_("No Parent"));
if (guid)
{
ValueNode_Bone::Handle bone_node(ValueNode_Bone::find(guid));
assert(bone_node);
name = (*(bone_node->get_link("name")))(get_canvas()->get_time()).get(String());
if (name.empty())
name = guid.get_string();
}

property_text()=(Glib::ustring)(name);
break;
}
default:
property_text()=static_cast<Glib::ustring>(_("UNKNOWN"));
break;
Expand Down

0 comments on commit 9936c47

Please sign in to comment.