diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp index a1c6a5b0cf9f4b8150b9c6977dc2991ed1229532..9e9952ecd89c8807b3c98b741285595b15cd6e64 100644 --- a/Common/GmshMessage.cpp +++ b/Common/GmshMessage.cpp @@ -650,10 +650,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key, _onelabClient->get(ps, name); bool noRange = true, noChoices = true, noLoop = true, noGraph = true; if(ps.size()){ - if(ps[0].getReadOnly()) - ps[0].setValue(val[0]); // use value from gmsh (so it is updated if necessary) - else - val[0] = ps[0].getValue(); // use value from server + val[0] = ps[0].getValue(); // always use value from server // keep track of these attributes, which can be changed server-side if(ps[0].getMin() != -onelab::parameter::maxNumber() || ps[0].getMax() != onelab::parameter::maxNumber() || @@ -686,7 +683,13 @@ void Msg::ExchangeOnelabParameter(const std::string &key, if(copt.count("Choices")) ps[0].setChoiceLabels(copt["Choices"]); } if(fopt.count("Visible")) ps[0].setVisible(fopt["Visible"][0] ? true : false); - if(fopt.count("ReadOnly")) ps[0].setReadOnly(fopt["ReadOnly"][0] ? true : false); + if(fopt.count("ReadOnly")) { + ps[0].setReadOnly(fopt["ReadOnly"][0] ? true : false); + // If the parameter is set "read-only" here, + // the local value is used instead of that from the server + if(ps[0].getReadOnly()) + ps[0].setValue(val[0]); + } if(copt.count("Help")) ps[0].setHelp(copt["Help"][0]); if(copt.count("Label")) ps[0].setLabel(copt["Label"][0]); if(copt.count("ShortHelp")) ps[0].setLabel(copt["ShortHelp"][0]);