Skip to content
Snippets Groups Projects
Commit cf3b0131 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

only use preset file name the first time a file chooser is used; all later...

only use preset file name the first time a file chooser is used; all later times use the last-visited directory
parent be079ba9
No related branches found
No related tags found
No related merge requests found
......@@ -1505,8 +1505,9 @@ message(STATUS "Run 'ccmake ${CMAKE_CURRENT_SOURCE_DIR}' to fine-tune the config
message(STATUS "")
mark_as_advanced(GMSH_EXTRA_VERSION
ANN_INC ANN_LIB GMM_INC GMP_INC GMP_LIB MMG3D_INC MMG3D_LIB
TAUCS_INC TAUCS_LIB HDF5_LIB ACIS_LIB MED_LIB OCC_INC OCC_CONFIG_H
CGNS_INC SZ_LIB PETSC_LIBS SLEPC_INC SLEPC_INC2 SLEPC_LIB
ACIS_LIB ANN_INC ANN_LIB CAIRO_LIB CAIRO_INC CGNS_INC GMM_INC
GMP_INC GMP_LIB MMG3D_INC MMG3D_LIB TAUCS_INC TAUCS_LIB HDF5_LIB
MED_LIB OCC_INC OCC_CONFIG_H SZ_LIB
PETSC_LIBS SLEPC_INC SLEPC_INC2 SLEPC_LIB
BISON FLEX MAKEINFO TEXI2PDF FLTK_CONFIG_SCRIPT
GMSH_EXTERNAL_INCLUDE_DIRS GMSH_EXTERNAL_LIBRARIES)
......@@ -107,7 +107,18 @@ int fileChooser(FILE_CHOOSER_TYPE type, const char *message,
fc->title(message);
fc->filter(filter);
fc->filter_value(thefilterindex);
if(fname) fc->preset_file(fname);
static bool first = true;
if(fname && first){
// preset the path and the file only the first time in a given
// session. Afterwards, always reuse the last directory
fc->preset_file(fname);
first = false;
}
else{
fc->preset_file(0);
}
int ret = 0;
switch(fc->show()) {
case -1: break; // error
......@@ -141,7 +152,16 @@ int fileChooser(FILE_CHOOSER_TYPE type, const char *message,
fc->label(message);
fc->filter(thefilter);
fc->filter_value(thefilterindex);
if(fname) fc->value(fname);
static bool first = true;
if(fname && first){
// preset the path and the file only the first time in a given
// session. Afterwards, always reuse the last directory
fc->value(fname);
first = false;
}
else{
fc->value(0);
}
fc->show();
while(fc->shown()) Fl::wait();
thefilterindex = fc->filter_value();
......
......@@ -120,7 +120,7 @@ static const char *input_formats =
"Mesh - PLY2 Surface" TT "*.ply2" NN
"Post-processing - Gmsh POS" TT "*.pos" NN
#if defined(HAVE_MED)
"Post-processing - MED" TT "*.{rmed}" NN
"Post-processing - MED" TT "*.rmed" NN
#endif
"Image - BMP" TT "*.bmp" NN
#if defined(HAVE_LIBJPEG)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment