From d48af4d3a9b2e6cd68030a3194a8eaf9d010ba98 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 12 Nov 2012 10:21:52 +0000
Subject: [PATCH] avoid reentrant check/compute

---
 Fltk/onelabGroup.cpp | 5 +++++
 demos/indheat.geo    | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp
index 1fbd26f20e..262c90cbd1 100644
--- a/Fltk/onelabGroup.cpp
+++ b/Fltk/onelabGroup.cpp
@@ -537,6 +537,11 @@ void onelab_cb(Fl_Widget *w, void *data)
     action = "check";
   }
 
+  if(FlGui::instance()->onelab->isBusy()){
+    Msg::Info("I'm busy! Ask me that later...");
+    return;
+  }
+
   FlGui::instance()->onelab->setButtonMode("", "stop");
 
   if(action == "compute") initializeLoops();
diff --git a/demos/indheat.geo b/demos/indheat.geo
index 75cab3f369..e5e5775c64 100644
--- a/demos/indheat.geo
+++ b/demos/indheat.geo
@@ -12,8 +12,8 @@ DefineConstant
  rt2 = {0.092, Label "Tube external radius", Path "Parameters"},
  lb = {1, Label "Infinite box width", Path "Parameters"},
  left = {1, Choices{0,1}, Label "Terminals on the left?", Path "Parameters"}
- macro = {"title.script", Label "Run my macro!", Path "Actions",
-          Macro "Gmsh", AutoCheck "0"},
+ macro = {"title.script", Label "Add title", Path "Macros",
+          Macro "Gmsh", AutoCheck "0", Highlight "Turquoise"},
  showLines = {Geometry.Lines, Choices {0,1}, Label "Show lines?", Path "Options",
               GmshOption "Geometry.Lines", AutoCheck "0"}
 ];
-- 
GitLab