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

GmshOption "Reset" to reset db + PViews + previous GModels

parent a4724c42
No related branches found
No related tags found
No related merge requests found
......@@ -807,7 +807,7 @@ void onelab_cb(Fl_Widget *w, void *data)
}
std::string fileName = "onelab.db";
// add user defined tag, if any
// add user defined tag, if any
std::vector<onelab::string> ps;
onelab::server::instance()->get(ps,"0Metamodel/9Tag");
if(ps.size()){
......@@ -1314,6 +1314,15 @@ static void setGmshOption(T &n)
FlGui::instance()->rebuildTree(false);
return;
}
if(opt == "Reset"){ // reset db + models except current one
resetDb(false);
for(int i = PView::list.size() - 1; i >= 0; i--)
delete PView::list[i];
for(int i = GModel::list.size() - 1; i >= 0; i--)
if(GModel::list[i] != GModel::current()) delete GModel::list[i];
FlGui::instance()->rebuildTree(false);
return;
}
std::string::size_type dot = opt.find('.');
if(dot == std::string::npos) return;
GmshSetOption(opt.substr(0, dot), opt.substr(dot + 1), n.getValue());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment