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

tweak

parent 5050e149
No related branches found
No related tags found
No related merge requests found
...@@ -222,7 +222,8 @@ static void change_print_parameter(int frame) ...@@ -222,7 +222,8 @@ static void change_print_parameter(int frame)
ParseString(CTX::instance()->print.parameterCommand); ParseString(CTX::instance()->print.parameterCommand);
} }
void CreateOutputFile(const std::string &fileName, int format, bool status) void CreateOutputFile(const std::string &fileName, int format,
bool status, bool redraw)
{ {
std::string name = fileName; std::string name = fileName;
if(name.empty()) name = GetDefaultFileName(format); if(name.empty()) name = GetDefaultFileName(format);
...@@ -238,7 +239,7 @@ void CreateOutputFile(const std::string &fileName, int format, bool status) ...@@ -238,7 +239,7 @@ void CreateOutputFile(const std::string &fileName, int format, bool status)
switch (format) { switch (format) {
case FORMAT_AUTO: case FORMAT_AUTO:
CreateOutputFile(name, GuessFileFormatFromFileName(name), false); CreateOutputFile(name, GuessFileFormatFromFileName(name), false, false);
break; break;
case FORMAT_OPT: case FORMAT_OPT:
...@@ -566,7 +567,8 @@ void CreateOutputFile(const std::string &fileName, int format, bool status) ...@@ -566,7 +567,8 @@ void CreateOutputFile(const std::string &fileName, int format, bool status)
if(cycle == 2) if(cycle == 2)
change_print_parameter(i); change_print_parameter(i);
if(fp) if(fp)
CreateOutputFile(CTX::instance()->homeDir + frames[i], FORMAT_PPM, false); CreateOutputFile(CTX::instance()->homeDir + frames[i], FORMAT_PPM,
false, false);
else{ else{
drawContext::global()->draw(); drawContext::global()->draw();
SleepInSeconds(CTX::instance()->post.animDelay); SleepInSeconds(CTX::instance()->post.animDelay);
...@@ -629,6 +631,6 @@ void CreateOutputFile(const std::string &fileName, int format, bool status) ...@@ -629,6 +631,6 @@ void CreateOutputFile(const std::string &fileName, int format, bool status)
Msg::StatusBar(true, "Done writing '%s'", name.c_str()); Msg::StatusBar(true, "Done writing '%s'", name.c_str());
#if defined(HAVE_OPENGL) #if defined(HAVE_OPENGL)
drawContext::global()->draw(); if(redraw) drawContext::global()->draw();
#endif #endif
} }
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
int GetFileFormatFromExtension(const std::string &fileName); int GetFileFormatFromExtension(const std::string &fileName);
int GuessFileFormatFromFileName(const std::string &fileName); int GuessFileFormatFromFileName(const std::string &fileName);
std::string GetDefaultFileName(int format); std::string GetDefaultFileName(int format);
void CreateOutputFile(const std::string &fileName, int format, bool status=true); void CreateOutputFile(const std::string &fileName, int format,
bool status=true, bool redraw=true);
#endif #endif
...@@ -500,7 +500,7 @@ int mpegFileDialog(const char *name) ...@@ -500,7 +500,7 @@ int mpegFileDialog(const char *name)
opt_print_delete_tmp_files(0, GMSH_SET | GMSH_GUI, (int)dialog->c[2]->value()); opt_print_delete_tmp_files(0, GMSH_SET | GMSH_GUI, (int)dialog->c[2]->value());
int format = (o == dialog->preview) ? FORMAT_MPEG_PREVIEW : FORMAT_MPEG; int format = (o == dialog->preview) ? FORMAT_MPEG_PREVIEW : FORMAT_MPEG;
dialog->buttons->deactivate(); dialog->buttons->deactivate();
CreateOutputFile(name, format, o == dialog->ok); CreateOutputFile(name, format, o == dialog->ok, true);
dialog->buttons->activate(); dialog->buttons->activate();
if(o == dialog->ok){ if(o == dialog->ok){
dialog->window->hide(); dialog->window->hide();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment