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

for view index for plugin script (not perfect when there are several views,

but better than leaving -1)
parent 15e0fa75
Branches
Tags
No related merge requests found
......@@ -109,8 +109,16 @@ static void add_scripting(GMSH_PostPlugin *p, PView *view)
if(!FlGui::instance()->plugins->record->value()) return;
std::string fileName;
if(view)
int oldIndex = -1;
if(view){
for(int i = 0; i < p->getNbOptions(); i++){
if(p->getOption(i)->str == "iView") {
oldIndex = p->getOption(i)->def;
p->getOption(i)->def = view->getIndex();
}
}
fileName = view->getData()->getFileName();
}
else
fileName = GModel::current()->getFileName();
......@@ -123,6 +131,14 @@ static void add_scripting(GMSH_PostPlugin *p, PView *view)
fprintf(fp, "%s", p->serialize().c_str());
fclose(fp);
}
if(view && oldIndex != -1){
for(int i = 0; i < p->getNbOptions(); i++){
if(p->getOption(i)->str == "iView"){
p->getOption(i)->def = oldIndex;
}
}
}
}
static void plugin_run_cb(Fl_Widget *w, void *data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment