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

Merge branch 'fixReadOnly' into 'master'

fix readOnly logic so that the server value is correctly considered when updating a parameter

See merge request gmsh/gmsh!36
parents fb515d0a 8a3d3a14
No related branches found
No related tags found
No related merge requests found
...@@ -1269,8 +1269,10 @@ void Msg::ExchangeOnelabParameter(const std::string &key, ...@@ -1269,8 +1269,10 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
bool noRange = true, noChoices = true, noLoop = true; bool noRange = true, noChoices = true, noLoop = true;
bool noGraph = true, noClosed = true; bool noGraph = true, noClosed = true;
if(ps.size()){ if(ps.size()){
if(fopt.count("ReadOnly") && fopt["ReadOnly"][0]) bool useLocalValue = ps[0].getReadOnly();
ps[0].setValues(val); // use local value if(fopt.count("ReadOnly")) useLocalValue = fopt["ReadOnly"][0];
if(useLocalValue){
ps[0].setValues(val);
else else
val = ps[0].getValues(); // use value from server val = ps[0].getValues(); // use value from server
// keep track of these attributes, which can be changed server-side (unless // keep track of these attributes, which can be changed server-side (unless
...@@ -1373,7 +1375,9 @@ void Msg::ExchangeOnelabParameter(const std::string &key, ...@@ -1373,7 +1375,9 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
_onelabClient->get(ps, name); _onelabClient->get(ps, name);
bool noChoices = true, noClosed = true, noMultipleSelection = true; bool noChoices = true, noClosed = true, noMultipleSelection = true;
if(ps.size()){ if(ps.size()){
if(fopt.count("ReadOnly") && fopt["ReadOnly"][0]) bool useLocalValue = ps[0].getReadOnly();
if(fopt.count("ReadOnly")) useLocalValue = fopt["ReadOnly"][0];
if(useLocalValue){
ps[0].setValue(val); // use local value ps[0].setValue(val); // use local value
else else
val = ps[0].getValue(); // use value from server val = ps[0].getValue(); // use value from server
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment