From: dooglus Date: Thu, 7 Feb 2008 09:46:30 +0000 (+0000) Subject: Attempting to open a file that is already open should just succeed quietly. It used... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=65e74a7098d70d3e4235bebb7a4fd69199b3bb4e;p=synfig.git Attempting to open a file that is already open should just succeed quietly. It used to pop up an error dialog and get the user to click 'OK'. This was particularly annoying when the file was specified on the command line that started studio, and was only already open because it had just been recovered from a previous crash. git-svn-id: http://svn.voria.com/code@1616 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index 6cd9715..4a312ed 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -1906,22 +1906,26 @@ App::open_as(std::string filename,std::string as) if(canvas && get_instance(canvas)) { get_instance(canvas)->find_canvas_view(canvas)->present(); - throw (String)strprintf(_("\"%s\" appears to already be open!"),filename.c_str()); + info("%s is already open", filename.c_str()); + // throw (String)strprintf(_("\"%s\" appears to already be open!"),filename.c_str()); } - if(!canvas) - throw (String)strprintf(_("Unable to open file \"%s\""),filename.c_str()); + else + { + if(!canvas) + throw (String)strprintf(_("Unable to open file \"%s\""),filename.c_str()); - add_recent_file(as); + add_recent_file(as); - handle instance(Instance::create(canvas)); + handle instance(Instance::create(canvas)); - if(!instance) - throw (String)strprintf(_("Unable to create instance for \"%s\""),filename.c_str()); + if(!instance) + throw (String)strprintf(_("Unable to create instance for \"%s\""),filename.c_str()); - one_moment.hide(); + one_moment.hide(); - if(instance->is_updated() && App::dialog_yes_no(_("CVS Update"), _("There appears to be a newer version of this file available on the CVS repository.\nWould you like to update now? (It would probably be a good idea)"))) - instance->dialog_cvs_update(); + if(instance->is_updated() && App::dialog_yes_no(_("CVS Update"), _("There appears to be a newer version of this file available on the CVS repository.\nWould you like to update now? (It would probably be a good idea)"))) + instance->dialog_cvs_update(); + } } catch(String x) {