From f98bdb3ec19028c8f382b1b3f440915a32288798 Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 14 Jan 2008 09:36:41 +0000 Subject: [PATCH] Refer the user to 'http://synfig.org/Convert#Compatibility' if we try to load a .sif file that uses a not-yet-implemented ValueNode type, or that tries using a ValueNode with a type which it doesn't yet support. Both of these are usually a sign that the .sif file was created with a newer version of synfig than the user has. git-svn-id: http://svn.voria.com/code@1356 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/loadcanvas.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/synfig-core/trunk/src/synfig/loadcanvas.cpp b/synfig-core/trunk/src/synfig/loadcanvas.cpp index 199a609..fa5eb40 100644 --- a/synfig-core/trunk/src/synfig/loadcanvas.cpp +++ b/synfig-core/trunk/src/synfig/loadcanvas.cpp @@ -88,6 +88,8 @@ test_class test_class_instance; /* === M A C R O S ========================================================= */ +#define VALUENODE_COMPATIBILITY_URL "http://synfig.org/Convert#Compatibility" + inline bool is_whitespace(char x) { return ((x)=='\n' || (x)=='\t' || (x)==' '); } /* === P R O C E D U R E S ================================================= */ @@ -1121,7 +1123,10 @@ CanvasParser::parse_linkable_value_node(xmlpp::Element *element,Canvas::Handle c if(!value_node) { - error(element,"Unknown ValueNode type "+element->get_name()); + error(element, strprintf(_("Error creating ValueNode <%s> with type '%s'. Refer to '%s'"), + element->get_name().c_str(), + ValueBase::type_local_name(type).c_str(), + VALUENODE_COMPATIBILITY_URL)); return 0; } @@ -1621,21 +1626,23 @@ CanvasParser::parse_value_node(xmlpp::Element *element,Canvas::Handle canvas) value_node=parse_dynamic_list(element,canvas); else if(LinkableValueNode::book().count(element->get_name())) + { value_node=parse_linkable_value_node(element,canvas); + if (!value_node) value_node = PlaceholderValueNode::create(); + } else if(element->get_name()=="canvas") value_node=ValueNode_Const::create(parse_canvas(element,canvas,true)); else { error_unexpected_element(element,element->get_name()); - error(element, "Expected a ValueNode"); + error(element, strprintf(_("Expected a ValueNode. Refer to '%s'"), + VALUENODE_COMPATIBILITY_URL)); value_node=PlaceholderValueNode::create(); } - value_node->set_root_canvas(canvas->get_root()); - // If we were successful, and our element has // an ID attribute, go ahead and add it to the // value_node list -- 2.7.4