Fix 1796971: if the user tries to quit synfig or close a document when there's unsave...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 20 Sep 2007 20:53:22 +0000 (20:53 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 20 Sep 2007 20:53:22 +0000 (20:53 +0000)
git-svn-id: http://svn.voria.com/code@724 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/instance.cpp

index fc45528..81d692c 100644 (file)
@@ -626,14 +626,17 @@ Instance::safe_close()
        uim=find_canvas_view(get_canvas())->get_ui_interface();
 
        if(get_action_count())
-       {
-               string str=strprintf(_("Would you like to save your changes to %s?"),basename(get_file_name()).c_str() );
-               int answer=uim->yes_no_cancel(get_canvas()->get_name(),str,synfigapp::UIInterface::RESPONSE_YES);
-               if(answer==synfigapp::UIInterface::RESPONSE_YES)
-                       save();
-               if(answer==synfigapp::UIInterface::RESPONSE_CANCEL)
-                       return false;
-       }
+               do
+               {
+                       string str=strprintf(_("Would you like to save your changes to %s?"),basename(get_file_name()).c_str() );
+                       int answer=uim->yes_no_cancel(get_canvas()->get_name(),str,synfigapp::UIInterface::RESPONSE_YES);
+                       if(answer==synfigapp::UIInterface::RESPONSE_YES)
+                               if (save()) break;
+                       if(answer==synfigapp::UIInterface::RESPONSE_NO)
+                               break;
+                       if(answer==synfigapp::UIInterface::RESPONSE_CANCEL)
+                               return false;
+               } while (true);
 
        if(is_modified())
        {