diff --git a/Fltk/menuWindow.cpp b/Fltk/menuWindow.cpp index 908262d67e4c7fc72652322146777cb7fb8a92ff..c22b25c226d5d91caadb9d5e52c451f67175528f 100644 --- a/Fltk/menuWindow.cpp +++ b/Fltk/menuWindow.cpp @@ -61,7 +61,8 @@ typedef unsigned long intptr_t; static void file_new_cb(Fl_Widget *w, void *data) { test: - if(fileChooser(FILE_CHOOSER_CREATE, "New", "")) { + if(fileChooser(FILE_CHOOSER_CREATE, "New", "", + GModel::current()->getFileName().c_str())) { std::string name = fileChooserGetName(1); if(!StatFile(name)){ if(fl_choice("File '%s' already exists.\n\nDo you want to erase it?", @@ -135,7 +136,8 @@ static const char *input_formats = static void file_open_cb(Fl_Widget *w, void *data) { int n = PView::list.size(); - if(fileChooser(FILE_CHOOSER_SINGLE, "Open", input_formats)) { + if(fileChooser(FILE_CHOOSER_SINGLE, "Open", input_formats, + GModel::current()->getFileName().c_str())) { OpenProject(fileChooserGetName(1)); drawContext::global()->draw(); } @@ -146,7 +148,8 @@ static void file_open_cb(Fl_Widget *w, void *data) static void file_merge_cb(Fl_Widget *w, void *data) { int n = PView::list.size(); - int f = fileChooser(FILE_CHOOSER_MULTI, "Merge", input_formats); + int f = fileChooser(FILE_CHOOSER_MULTI, "Merge", input_formats, + GModel::current()->getFileName().c_str()); if(f) { for(int i = 1; i <= f; i++) MergeFile(fileChooserGetName(i)); @@ -413,7 +416,8 @@ static void file_save_as_cb(Fl_Widget *w, void *data) } test: - if(fileChooser(FILE_CHOOSER_CREATE, "Save As", pat)) { + if(fileChooser(FILE_CHOOSER_CREATE, "Save As", pat, + GModel::current()->getFileName().c_str())) { std::string name = fileChooserGetName(1); if(CTX::instance()->confirmOverwrite) { if(!StatFile(name)) diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp index 5ce7ab007393be9e8ad8718e90f7b417a4516746..671c7815fadf445997b8aaaabc7e4b7e18a1416e 100644 --- a/Fltk/onelabWindow.cpp +++ b/Fltk/onelabWindow.cpp @@ -701,7 +701,7 @@ static void onelab_input_choice_cb(Fl_Widget *w, void *data) static void onelab_input_choice_file_chooser_cb(Fl_Widget *w, void *data) { Fl_Input_Choice *but = (Fl_Input_Choice*)w->parent(); - if(fileChooser(FILE_CHOOSER_SINGLE, "Choose", "")){ + if(fileChooser(FILE_CHOOSER_SINGLE, "Choose", "", but->value())){ but->value(fileChooserGetName(1).c_str()); but->do_callback(but, data); }