From 7c3d22b4b5d344551fb8893885bac0cbfa634d4e Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Fri, 22 May 2009 21:53:52 +0000 Subject: [PATCH] fix GUI coherence when changing names of views with aliases --- Common/Options.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Common/Options.cpp b/Common/Options.cpp index 111e90add3..93d0ae9d7b 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1931,10 +1931,17 @@ std::string opt_view_name(OPT_ARGS_STR) if(action & GMSH_SET) { data->setName(val); #if defined(HAVE_FLTK) - if(GUI::available() && num >= 0 && - num < (int)GUI::instance()->menu->toggle.size()) { - GUI::instance()->menu->toggle[num]->copy_label(data->getName().c_str()); - GUI::instance()->menu->toggle[num]->redraw(); + // change name in GUI for the view and its aliases + if(GUI::available()){ + for(unsigned int i = 0; i < PView::list.size(); i++){ + if((i == num || + PView::list[i]->getAliasOf() == view->getNum() || + PView::list[i]->getNum() == view->getAliasOf()) && + i < (int)GUI::instance()->menu->toggle.size()) { + GUI::instance()->menu->toggle[i]->copy_label(data->getName().c_str()); + GUI::instance()->menu->toggle[i]->redraw(); + } + } } #endif } -- GitLab