From de70b939b826b886ff5e71da4187da457693ab4e Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 3 Oct 2011 14:48:26 +0000
Subject: [PATCH] onelab work

---
 Fltk/onelabWindow.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Fltk/onelabWindow.cpp b/Fltk/onelabWindow.cpp
index db28e8200f..a9dd15d2a6 100644
--- a/Fltk/onelabWindow.cpp
+++ b/Fltk/onelabWindow.cpp
@@ -10,7 +10,9 @@
 #include <FL/Fl_Box.H>
 #include "GmshMessage.h"
 #include "Context.h"
+#include "Options.h"
 #include "OS.h"
+#include "StringUtils.h"
 #include "OpenFile.h"
 #include "drawContext.h"
 #include "PView.h"
@@ -228,7 +230,7 @@ void onelab_cb(Fl_Widget *w, void *data)
     if(action == "check")
       c->run(what);
     else if(action == "compute"){
-      if(c->getName() == "getdp"){
+      if(c->getName() == "GetDP"){
         std::vector<onelab::string> str;
         onelab::server::instance()->get(str, "GetDP/Resolution");
         if(str.size()) what += " -solve " + str[0].getValue();
@@ -282,9 +284,10 @@ onelabWindow::onelabWindow(int deltaFontSize)
 
   _model = new Fl_Input(WB, WB, width - 2*WB - (2*BB)/3, BH);
   _model->align(FL_ALIGN_RIGHT);
-  _model->value("/Users/geuzaine/src/getdp/demos/test.pro");
   _model->callback(onelab_cb, (void*)"check");
   _model->when(FL_WHEN_RELEASE|FL_WHEN_ENTER_KEY);
+  std::vector<std::string> split = SplitFileName(GModel::current()->getFileName());
+  _model->value((split[0]+split[1]+".pro").c_str());
 
   Fl_Button *choose = new Fl_Button(width - WB - (2*BB)/3, WB, (2*BB)/3, BH, "Choose");
   choose->callback(onelab_cb, (void*)"choose model");
@@ -308,7 +311,8 @@ onelabWindow::onelabWindow(int deltaFontSize)
   FL_NORMAL_SIZE += deltaFontSize;
 
   onelab::server::instance()->registerClient
-    (new onelab::localNetworkClient("getdp", "/Users/geuzaine/src/getdp/bin/getdp"));
+    (new onelab::localNetworkClient("GetDP",
+                                    opt_solver_executable0(0, GMSH_GET, "")));
 }
 
 static std::string getShortName(const std::string &name) 
-- 
GitLab