From b62a9ce06cc4d21171c38e4a026cc7cb04c207b0 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 31 Jul 2015 11:45:01 +0200 Subject: [PATCH] Now opens the current directory in dialogs if no project path is set. --- src/window.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/window.cc b/src/window.cc index c56aa3c..259441f 100644 --- a/src/window.cc +++ b/src/window.cc @@ -302,6 +302,8 @@ void Window::open_folder_dialog() { Gtk::FileChooserDialog dialog("Please choose a folder", Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER); if(notebook.project_path.size()>0) gtk_file_chooser_set_current_folder((GtkFileChooser*)dialog.gobj(), notebook.project_path.c_str()); + else + gtk_file_chooser_set_current_folder((GtkFileChooser*)dialog.gobj(), boost::filesystem::current_path().string().c_str()); dialog.set_transient_for(*this); //Add response buttons the the dialog: dialog.add_button("_Cancel", Gtk::RESPONSE_CANCEL); @@ -320,6 +322,8 @@ void Window::open_file_dialog() { Gtk::FileChooserDialog dialog("Please choose a file", Gtk::FILE_CHOOSER_ACTION_OPEN); if(notebook.project_path.size()>0) gtk_file_chooser_set_current_folder((GtkFileChooser*)dialog.gobj(), notebook.project_path.c_str()); + else + gtk_file_chooser_set_current_folder((GtkFileChooser*)dialog.gobj(), boost::filesystem::current_path().string().c_str()); dialog.set_transient_for(*this); dialog.set_position(Gtk::WindowPosition::WIN_POS_CENTER_ALWAYS);