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

automatic calls to OpenProject in onelab should not change the window title

parent 5453afb2
No related branches found
No related tags found
No related merge requests found
......@@ -262,7 +262,7 @@ static int defineSolver(const std::string &name)
return NUM_SOLVERS - 1;
}
int MergeFile(const std::string &fileName, bool warnIfMissing)
int MergeFile(const std::string &fileName, bool warnIfMissing, bool setWindowTitle)
{
if(GModel::current()->getName() == ""){
GModel::current()->setFileName(fileName);
......@@ -270,7 +270,7 @@ int MergeFile(const std::string &fileName, bool warnIfMissing)
}
#if defined(HAVE_FLTK)
if(FlGui::available())
if(FlGui::available() && setWindowTitle)
FlGui::instance()->setGraphicTitle(GModel::current()->getFileName());
#endif
......@@ -303,7 +303,7 @@ int MergeFile(const std::string &fileName, bool warnIfMissing)
Msg::Error("Failed to uncompress `%s': check directory permissions",
fileName.c_str());
GModel::current()->setFileName(noExt);
return MergeFile(noExt);
return MergeFile(noExt, true, setWindowTitle);
}
}
......@@ -497,8 +497,10 @@ int MergeFile(const std::string &fileName, bool warnIfMissing)
if(!status) Msg::Error("Error loading '%s'", fileName.c_str());
Msg::StatusBar(true, "Done reading '%s'", fileName.c_str());
CTX::instance()->fileread=true;
// merge the associated option file if there is one
CTX::instance()->fileread = true;
// merge the associated option file if there is one
if(!StatFile(fileName + ".opt"))
MergeFile(fileName + ".opt");
......@@ -620,7 +622,7 @@ void ClearProject()
Msg::ResetErrorCounter();
}
void OpenProject(const std::string &fileName)
void OpenProject(const std::string &fileName, bool setWindowTitle)
{
if(CTX::instance()->lock) {
Msg::Info("I'm busy! Ask me that later...");
......@@ -657,7 +659,7 @@ void OpenProject(const std::string &fileName)
ResetTemporaryBoundingBox();
// merge the file
if(MergeFile(fileName)) {
if(MergeFile(fileName, true, setWindowTitle)) {
if(fileName != CTX::instance()->recentFiles.front())
CTX::instance()->recentFiles.insert
(CTX::instance()->recentFiles.begin(), fileName);
......
......@@ -10,9 +10,10 @@
int ParseFile(const std::string &fileName, bool close, bool warnIfMissing=false);
void ParseString(const std::string &str);
void OpenProject(const std::string &filename);
void OpenProject(const std::string &filename, bool setWindowTitle=true);
void OpenProjectMacFinder(const char *fileName);
int MergeFile(const std::string &fileName, bool warnIfMissing=false);
int MergeFile(const std::string &fileName, bool warnIfMissing=false,
bool setWindowTitle=true);
int MergePostProcessingFile(const std::string &fileName, bool showLastStep=false,
bool hideNewViews=false, bool warnIfMissing=false);
void ClearProject();
......
......@@ -317,7 +317,7 @@ namespace onelabUtils {
// name has changed
modelName = GModel::current()->getName();
redraw = true;
OpenProject(GModel::current()->getFileName());
OpenProject(GModel::current()->getFileName(), false);
}
}
else if(action == "compute"){
......@@ -327,7 +327,7 @@ namespace onelabUtils {
// have been modified or if the model name has changed
modelName = GModel::current()->getName();
redraw = true;
OpenProject(GModel::current()->getFileName());
OpenProject(GModel::current()->getFileName(), false);
if(getFirstComputationFlag() && !StatFile(mshFileName)){
Msg::Info("Skipping mesh generation: assuming '%s' is up-to-date",
mshFileName.c_str());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment