Merge branch 'master' into genete_smart_link
authorCarlos Lopez <genetita@gmail.com>
Sat, 11 Sep 2010 12:42:03 +0000 (14:42 +0200)
committerCarlos Lopez <genetita@gmail.com>
Sat, 11 Sep 2010 12:42:03 +0000 (14:42 +0200)
synfig-studio/src/gui/trees/canvastreestore.cpp
synfig-studio/src/synfigapp/actions/valuedesclink.cpp

index 57fd42a..6b928f1 100644 (file)
@@ -210,7 +210,9 @@ CanvasTreeStore::get_value_vfunc(const Gtk::TreeModel::iterator& iter, int colum
                        if(value_desc.get_value_node())
                        {
                                lname=value_desc.get_value_node()->get_name();
-                               if (lname=="animated" || lname=="static")
+                               if (lname=="animated" || lname=="static" ||
+                               synfig::LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node())
+                               )
                                        stype+=" (" + value_desc.get_value_node()->get_local_name() + ")";
                        }
                        else if(value_desc.parent_is_layer_param())
index 66c736e..7f98228 100644 (file)
@@ -180,6 +180,25 @@ Action::ValueDescLink::set_param(const synfig::String& name, const Action::Param
                                        status_message = _("There's a tie for most referenced, and both are animated; using the one with the most waypoints.");
                                }
                        }
+                       // If both are Linkable Value Nodes and has waypoint in its children, use the one with more waypoints
+                       else if(LinkableValueNode::Handle::cast_dynamic(link_value_node) &&
+                                       LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node()) &&
+                                       LinkableValueNode::Handle::cast_dynamic(link_value_node)->get_times().size() !=
+                                       LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node())->get_times().size())
+                       {
+                               if(LinkableValueNode::Handle::cast_dynamic(link_value_node)->get_times().size() <
+                               LinkableValueNode::Handle::cast_dynamic(value_desc.get_value_node())->get_times().size())
+                               {
+                                       status_level = 4;
+                                       status_message = _("There's a tie for most referenced, and both are linkable value node animated; using the one with the most waypoints.");
+                                       link_value_node=value_desc.get_value_node();
+                               }
+                               else if (status_level <= 4)
+                               {
+                                       status_level = 4;
+                                       status_message = _("There's a tie for most referenced, and both are linkable value node animated; using the one with the most waypoints.");
+                               }
+                       }
                        // Use the one that was least recently changed
                        else if(link_value_node->get_time_last_changed()!=value_desc.get_value_node()->get_time_last_changed())
                        {