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

MultipleChoice -> MultipleSelection

parent f8bfa5d8
No related branches found
No related tags found
No related merge requests found
...@@ -924,7 +924,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key, ...@@ -924,7 +924,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
std::vector<onelab::string> ps; std::vector<onelab::string> ps;
_onelabClient->get(ps, name); _onelabClient->get(ps, name);
bool noChoices = true, noClosed = true, noMultipleChoice = true; bool noChoices = true, noClosed = true, noMultipleSelection = true;
if(ps.size()){ if(ps.size()){
if(fopt.count("ReadOnly") && fopt["ReadOnly"][0]) if(fopt.count("ReadOnly") && fopt["ReadOnly"][0])
ps[0].setValue(val); // use local value ps[0].setValue(val); // use local value
...@@ -933,7 +933,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key, ...@@ -933,7 +933,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
// keep track of these attributes, which can be changed server-side // keep track of these attributes, which can be changed server-side
if(ps[0].getChoices().size()) noChoices = false; if(ps[0].getChoices().size()) noChoices = false;
if(ps[0].getAttribute("Closed").size()) noClosed = false; if(ps[0].getAttribute("Closed").size()) noClosed = false;
if(ps[0].getAttribute("MultipleChoice").size()) noMultipleChoice = false; if(ps[0].getAttribute("MultipleSelection").size()) noMultipleSelection = false;
} }
else{ else{
ps.resize(1); ps.resize(1);
...@@ -943,8 +943,8 @@ void Msg::ExchangeOnelabParameter(const std::string &key, ...@@ -943,8 +943,8 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
if(copt.count("Kind")) ps[0].setKind(copt["Kind"][0]); if(copt.count("Kind")) ps[0].setKind(copt["Kind"][0]);
if(noChoices && copt.count("Choices")) ps[0].setChoices(copt["Choices"]); if(noChoices && copt.count("Choices")) ps[0].setChoices(copt["Choices"]);
if(noClosed && copt.count("Closed")) ps[0].setAttribute("Closed", copt["Closed"][0]); if(noClosed && copt.count("Closed")) ps[0].setAttribute("Closed", copt["Closed"][0]);
if(noMultipleChoice && copt.count("MultipleChoice")) if(noMultipleSelection && copt.count("MultipleSelection"))
ps[0].setAttribute("MultipleChoice", copt["MultipleChoice"][0]); ps[0].setAttribute("MultipleSelection", copt["MultipleSelection"][0]);
_setStandardOptions(&ps[0], fopt, copt); _setStandardOptions(&ps[0], fopt, copt);
_onelabClient->set(ps[0]); _onelabClient->set(ps[0]);
#endif #endif
......
...@@ -1150,7 +1150,7 @@ static void onelab_string_input_choice_cb(Fl_Widget *w, void *data) ...@@ -1150,7 +1150,7 @@ static void onelab_string_input_choice_cb(Fl_Widget *w, void *data)
} }
} }
if(choices.size()) if(choices.size())
strings[0].setAttribute("MultipleChoice", choices); strings[0].setAttribute("MultipleSelection", choices);
onelab::server::instance()->set(strings[0]); onelab::server::instance()->set(strings[0]);
autoCheck(old, strings[0]); autoCheck(old, strings[0]);
} }
...@@ -1181,7 +1181,7 @@ static void onelab_input_choice_file_merge_cb(Fl_Widget *w, void *data) ...@@ -1181,7 +1181,7 @@ static void onelab_input_choice_file_merge_cb(Fl_Widget *w, void *data)
drawContext::global()->draw(); drawContext::global()->draw();
} }
static void multiple_choice_menu_cb(Fl_Widget *w, void *data) static void multiple_selection_menu_cb(Fl_Widget *w, void *data)
{ {
Fl_Menu_Button *menu = (Fl_Menu_Button*)w; Fl_Menu_Button *menu = (Fl_Menu_Button*)w;
std::string val; std::string val;
...@@ -1239,17 +1239,17 @@ Fl_Widget *onelabGroup::_addParameterWidget(onelab::string &p, Fl_Tree_Item *n, ...@@ -1239,17 +1239,17 @@ Fl_Widget *onelabGroup::_addParameterWidget(onelab::string &p, Fl_Tree_Item *n,
// general string input // general string input
Fl_Input_Choice *but = new Fl_Input_Choice(1, 1, ww, 1); Fl_Input_Choice *but = new Fl_Input_Choice(1, 1, ww, 1);
std::string multipleChoice = p.getAttribute("MultipleChoice"); std::string multipleSelection = p.getAttribute("MultipleSelection");
if(multipleChoice.size()) if(multipleSelection.size())
but->menubutton()->callback(multiple_choice_menu_cb, but); but->menubutton()->callback(multiple_selection_menu_cb, but);
std::vector<Fl_Menu_Item> menu; std::vector<Fl_Menu_Item> menu;
for(unsigned int j = 0; j < p.getChoices().size(); j++){ for(unsigned int j = 0; j < p.getChoices().size(); j++){
char *str = strdup(p.getChoices()[j].c_str()); char *str = strdup(p.getChoices()[j].c_str());
_treeStrings.push_back(str); _treeStrings.push_back(str);
bool divider = (p.getKind() == "file" && bool divider = (p.getKind() == "file" &&
j == p.getChoices().size() - 1); j == p.getChoices().size() - 1);
int choice = multipleChoice.size() ? FL_MENU_TOGGLE : 0; int choice = multipleSelection.size() ? FL_MENU_TOGGLE : 0;
if(multipleChoice.size() > j && multipleChoice[j] == '1') if(multipleSelection.size() > j && multipleSelection[j] == '1')
choice |= FL_MENU_VALUE; choice |= FL_MENU_VALUE;
Fl_Menu_Item it = {str, 0, 0, 0, divider ? FL_MENU_DIVIDER : choice}; Fl_Menu_Item it = {str, 0, 0, 0, divider ? FL_MENU_DIVIDER : choice};
menu.push_back(it); menu.push_back(it);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment