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

only ask question once

parent 77fe7798
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@
void add_infile(const std::string &text, const std::string &fileName, bool forceDestroy)
{
Msg::Debug("Adding `%s' to file `%s'", text.c_str(), fileName.c_str());
std::vector<std::string> split = SplitFileName(fileName);
std::string noExt = split[0] + split[1], ext = split[2];
#if defined(HAVE_COMPRESSED_IO) && defined(HAVE_LIBZ)
......@@ -39,7 +40,8 @@ void add_infile(const std::string &text, const std::string &fileName, bool force
}
#endif
// make sure we don't add stuff in a non-geo file
if(!CTX::instance()->expertMode) {
static bool proceed = false;
if(!CTX::instance()->expertMode && !proceed) {
if(ext.size() && ext != ".geo" && ext != ".GEO" ){
std::ostringstream sstream;
sstream <<
......@@ -72,6 +74,8 @@ void add_infile(const std::string &text, const std::string &fileName, bool force
OpenProject(newFileName);
return;
}
else if(ret == 1)
proceed = true;
else if(ret == 0)
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment