**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2008 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
#include <gtkmm/button.h>
#include "widget_filename.h"
#include "app.h"
+#include "canvasview.h"
#include "general.h"
void
-Widget_Filename::set_value(const string &data)
+Widget_Filename::set_value(const std::string &data)
{
entry_filename->set_text(data);
}
string filename=entry_filename->get_text();
if(filename.empty())
filename=".";
- if(App::dialog_open_file(_("Choose File"),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);
}