Fix 1988939: Error trying to change value of Filename property.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 24 Sep 2008 21:57:49 +0000 (21:57 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 24 Sep 2008 21:57:49 +0000 (21:57 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2071 1f10aa63-cdf2-0310-b900-c93c546f37ac

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

index 91538c0..a178614 100644 (file)
@@ -34,6 +34,7 @@
 #include <gtkmm/button.h>
 #include "widget_filename.h"
 #include "app.h"
+#include "canvasview.h"
 
 #include "general.h"
 
@@ -111,6 +112,11 @@ Widget_Filename::on_button_choose_pressed()
        string filename=entry_filename->get_text();
        if(filename.empty())
                filename=".";
+       else
+               filename = etl::absolute_path(
+                       etl::dirname(App::get_selected_canvas_view()->get_canvas()->get_file_name()) +
+                       ETL_DIRECTORY_SEPARATOR +
+                       filename);
        if(App::dialog_open_file(_("Choose File"), filename, MISC_DIR_PREFERENCE))
                entry_filename->set_text(filename);
 }