From 4a0c74de2d5c8d50f94b6033731aa47e87bfb889 Mon Sep 17 00:00:00 2001 From: dooglus Date: Sun, 16 Sep 2007 17:47:23 +0000 Subject: [PATCH] Fix 1383736: use absolute pathnames when setting up Gtk file selector dialogs. git-svn-id: http://svn.voria.com/code@679 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/app.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index e4fbf96..c73cd35 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -1700,13 +1700,14 @@ App::dialog_open_file(const std::string &title, std::string &filename) synfig::String prev_path; if(!_preferences.get_value("curr_path",prev_path)) prev_path="."; + prev_path = absolute_path(prev_path); Gtk::FileChooserDialog *dialog=new Gtk::FileChooserDialog(title,Gtk::FILE_CHOOSER_ACTION_OPEN); dialog->set_current_folder(prev_path); dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_ACCEPT); if(!filename.empty()) - dialog->set_filename(filename); + dialog->set_filename(prev_path + ETL_DIRECTORY_SEPARATOR + filename); if(dialog->run()==GTK_RESPONSE_ACCEPT) { filename=dialog->get_filename(); delete dialog; @@ -1809,13 +1810,14 @@ App::dialog_save_file(const std::string &title, std::string &filename) synfig::String prev_path; if(!_preferences.get_value("curr_path",prev_path)) prev_path="."; + prev_path = absolute_path(prev_path); Gtk::FileChooserDialog *dialog=new Gtk::FileChooserDialog(title,Gtk::FILE_CHOOSER_ACTION_SAVE); dialog->set_current_folder(prev_path); dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog->add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT); if(!filename.empty()) - dialog->set_filename(filename); + dialog->set_filename(prev_path + ETL_DIRECTORY_SEPARATOR + filename); if(dialog->run()==GTK_RESPONSE_ACCEPT) { filename=dialog->get_filename(); delete dialog; @@ -1875,13 +1877,14 @@ App::dialog_saveas_file(const std::string &title, std::string &filename) synfig::String prev_path; if(!_preferences.get_value("curr_path",prev_path)) prev_path="."; + prev_path = absolute_path(prev_path); Gtk::FileChooserDialog *dialog=new Gtk::FileChooserDialog(title,Gtk::FILE_CHOOSER_ACTION_SAVE); dialog->set_current_folder(prev_path); dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog->add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT); if(!filename.empty()) - dialog->set_filename(filename); + dialog->set_filename(prev_path + ETL_DIRECTORY_SEPARATOR + filename); if(dialog->run()==GTK_RESPONSE_ACCEPT) { filename=dialog->get_filename(); delete dialog; -- 2.7.4