Revision: 2204
          http://synfig.svn.sourceforge.net/synfig/?rev=2204&view=rev
Author:   dooglus
Date:     2008-11-17 10:21:29 +0000 (Mon, 17 Nov 2008)

Log Message:
-----------
Show a warning when using file>import to import a .sif file which references 
itself recursively.

Modified Paths:
--------------
    synfig-studio/trunk/src/gtkmm/canvasview.cpp
    synfig-studio/trunk/src/synfigapp/canvasinterface.cpp
    synfig-studio/trunk/src/synfigapp/canvasinterface.h

Modified: synfig-studio/trunk/src/gtkmm/canvasview.cpp
===================================================================
--- synfig-studio/trunk/src/gtkmm/canvasview.cpp        2008-11-17 00:38:20 UTC 
(rev 2203)
+++ synfig-studio/trunk/src/gtkmm/canvasview.cpp        2008-11-17 10:21:29 UTC 
(rev 2204)
@@ -3461,8 +3461,11 @@
                                }
                                else
                                {
-                                       if(canvas_interface()->import(filename, 
App::resize_imported_images))
+                                       String errors, warnings;
+                                       if(canvas_interface()->import(filename, 
errors, warnings, App::resize_imported_images))
                                                success=true;
+                                       if (warnings != "")
+                                               
App::dialog_warning_blocking(_("Warnings"), strprintf("%s:\n\n%s", 
_("Warnings"), warnings.c_str()));
                                }
 
                                continue;
@@ -3569,8 +3572,13 @@
 {
        // String filename(dirname(get_canvas()->get_file_name()));
        String filename("*.*");
+       String errors, warnings;
        if(App::dialog_open_file(_("Import Image"), filename, 
IMAGE_DIR_PREFERENCE))
-               canvas_interface()->import(filename, 
App::resize_imported_images);
+       {
+               canvas_interface()->import(filename, errors, warnings, 
App::resize_imported_images);
+               if (warnings != "")
+                       App::dialog_warning_blocking(_("Warnings"), 
strprintf("%s:\n\n%s", _("Warnings"), warnings.c_str()));
+       }
 }
 
 Smach::event_result

Modified: synfig-studio/trunk/src/synfigapp/canvasinterface.cpp
===================================================================
--- synfig-studio/trunk/src/synfigapp/canvasinterface.cpp       2008-11-17 
00:38:20 UTC (rev 2203)
+++ synfig-studio/trunk/src/synfigapp/canvasinterface.cpp       2008-11-17 
10:21:29 UTC (rev 2204)
@@ -560,7 +560,7 @@
 }
 
 bool
-CanvasInterface::import(const synfig::String &filename, bool resize_image)
+CanvasInterface::import(const synfig::String &filename, synfig::String 
&errors, synfig::String &warnings, bool resize_image)
 {
        Action::PassiveGrouper group(get_instance().get(),_("Import Image"));
 
@@ -579,7 +579,6 @@
        // If this is a SIF file, then we need to do things slightly differently
        if(ext=="sif" || ext=="sifz")try
        {
-               String errors, warnings;
                Canvas::Handle outside_canvas(synfig::open_canvas(filename, 
errors, warnings));
                if(!outside_canvas)
                        throw String(_("Unable to open this composition")) + 
":\n\n" + errors;

Modified: synfig-studio/trunk/src/synfigapp/canvasinterface.h
===================================================================
--- synfig-studio/trunk/src/synfigapp/canvasinterface.h 2008-11-17 00:38:20 UTC 
(rev 2203)
+++ synfig-studio/trunk/src/synfigapp/canvasinterface.h 2008-11-17 10:21:29 UTC 
(rev 2204)
@@ -271,7 +271,7 @@
 
        void set_rend_desc(const synfig::RendDesc &rend_desc);
 
-       bool import(const synfig::String &filename, bool resize_image=false);
+       bool import(const synfig::String &filename, synfig::String &errors, 
synfig::String &warnings, bool resize_image=false);
 
 
        void waypoint_duplicate(synfigapp::ValueDesc 
value_desc,synfig::Waypoint waypoint);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to