From f59a3af4d4b80f01665d3aef8aba48b6a5a50aee Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 31 Oct 2012 11:33:41 +0000
Subject: [PATCH] also launch onelab in file open/merge

---
 Fltk/menuWindow.cpp   | 4 ++++
 Fltk/onelabWindow.cpp | 2 ++
 doc/gmsh.html         | 8 ++++----
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Fltk/menuWindow.cpp b/Fltk/menuWindow.cpp
index e281f24736..42e547abdc 100644
--- a/Fltk/menuWindow.cpp
+++ b/Fltk/menuWindow.cpp
@@ -147,6 +147,8 @@ static void file_open_cb(Fl_Widget *w, void *data)
   }
   if(n != (int)PView::list.size())
     FlGui::instance()->menu->setContext(menu_post, 0);
+  if(CTX::instance()->launchOnelabAtStartup != -2)
+    solver_cb(0, (void*)CTX::instance()->launchOnelabAtStartup);
 }
 
 static void file_merge_cb(Fl_Widget *w, void *data)
@@ -161,6 +163,8 @@ static void file_merge_cb(Fl_Widget *w, void *data)
   }
   if(n != (int)PView::list.size())
     FlGui::instance()->menu->setContext(menu_post, 0);
+  if(CTX::instance()->launchOnelabAtStartup != -2)
+    solver_cb(0, (void*)CTX::instance()->launchOnelabAtStartup);
 }
 
 static void file_open_recent_cb(Fl_Widget *w, void *data)
diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp
index 40f58dc914..8d9a56eead 100644
--- a/Fltk/onelabWindow.cpp
+++ b/Fltk/onelabWindow.cpp
@@ -1391,6 +1391,8 @@ void solver_cb(Fl_Widget *w, void *data)
     FlGui::instance()->onelab->show();
   else
     onelab_cb(0, (num >= 0) ? (void*)"check" : (void*)"refresh");
+
+  CTX::instance()->launchOnelabAtStartup = -2;
 }
 
 void flgui_wait_cb(double time)
diff --git a/doc/gmsh.html b/doc/gmsh.html
index cb11d9ee13..f5b086d122 100644
--- a/doc/gmsh.html
+++ b/doc/gmsh.html
@@ -300,16 +300,16 @@ thumbnail"></a>
   </ul>
   High-order meshing and visualization
   <ul class="small">
-    <li>J.-F. Remacle, N. Chevaugeon, E. Marchandise and
-      C. Geuzaine. <em>Efficient Visualization of High-Order Finite
-      Elements</em>. International Journal for Numerical Methods in Engineering
-      69(4), pp. 750-771, 2007. (<a href="gmsh_visu_preprint.pdf">PDF</a>)
     <li>A. Johnen, J.-F. Remacle and C. Geuzaine. <em>Geometric validity of
       High-Order Triangular Finite Elements</em>. Engineering with Computers, in
       press, 2012. (<a href="gmsh_curved2_preprint.pdf">PDF</a>)
     <li>A. Johnen, J.-F. Remacle and C. Geuzaine. <em>Geometric validity of
         Curvilinear Finite elements</em>. Journal of Computational Physics, in
       press, 2012. (<a href="gmsh_curved_preprint.pdf">PDF</a>)
+    <li>J.-F. Remacle, N. Chevaugeon, E. Marchandise and
+      C. Geuzaine. <em>Efficient Visualization of High-Order Finite
+      Elements</em>. International Journal for Numerical Methods in Engineering
+      69(4), pp. 750-771, 2007. (<a href="gmsh_visu_preprint.pdf">PDF</a>)
   </ul>
   Ocean meshing
   <ul class="small">
-- 
GitLab