X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fwidget_canvaschooser.cpp;h=c91a45c105719c28b8097deec5f9a316677884f5;hb=0348d0c0f02151293190a0db10ce92d7b112aa9e;hp=c6f97cd38b0bb09c156a7ee803efb8f1ce6aa922;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/widget_canvaschooser.cpp b/synfig-studio/trunk/src/gtkmm/widget_canvaschooser.cpp index c6f97cd..c91a45c 100644 --- a/synfig-studio/trunk/src/gtkmm/widget_canvaschooser.cpp +++ b/synfig-studio/trunk/src/gtkmm/widget_canvaschooser.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -33,6 +34,8 @@ #include #include "app.h" +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -129,7 +132,21 @@ void Widget_CanvasChooser::chooser_menu() { String canvas_name; - App::dialog_entry(_("Choose Canvas"),_("Enter the relative name of the canvas that you want"),canvas_name); + + if (!App::dialog_entry(_("Choose Canvas"),_("Enter the relative name of the canvas that you want"),canvas_name)) + { + // the user hit 'cancel', so set the parameter back to its previous value + set_value_(canvas); + return; + } + + if (canvas_name == "") + { + App::dialog_error_blocking(_("Error"),_("No canvas name was specified")); + set_value_(canvas); + return; + } + Canvas::Handle new_canvas; try {