@@ -855,6 +855,26 @@ void QtGroupsPanel::updateQuickButtons ( )
855855 _wireTopoCoEdgeButton->setChecked (0 == rep ? false : true );
856856} // QtGroupsPanel::updateQuickButtons
857857
858+ void QtGroupsPanel::updateGroupCallback ( )
859+ {
860+ vector<QtGroupTreeWidgetItem*> items = getSelectedGroupsItems ( );
861+ for (vector<QtGroupTreeWidgetItem*>::iterator it = items.begin ( ); items.end ( ) != it; it++)
862+ {
863+ if (true == (*it)->isSelected ( ))
864+ {
865+ QString newName;
866+ bool ok = true ;
867+ newName = QInputDialog::getText (this , " Magix 3D" , " Renommage de Groupe :" ,QLineEdit::Normal, " " ,&ok);
868+
869+ std::string str_newName = newName.toStdString ();
870+
871+ GroupEntity* gr = (*it)->getGroup ( );
872+ getContext ().getGroupManager ().changeGroupName (gr->getName (), str_newName, gr->getDim ());
873+
874+ updateGroup (*gr);
875+ }
876+ } // for (vector<QtGroupTreeWidgetItem*>::iterator it = ...
877+ } // QtGroupsPanel::displaySelectedGroups
858878
859879void QtGroupsPanel::clearGroupCallback ( )
860880{
@@ -1403,6 +1423,10 @@ void QtGroupsPanel::createPopupMenus ( )
14031423
14041424 _groupsPopupMenu->addSeparator ( );
14051425
1426+ QAction* updateGroupAction = createAction (*_groupsPopupMenu, QString::fromUtf8 (" Renommage d'un groupe" ),
1427+ QString::fromUtf8 (" Le groupe change de nom tout en conservant son contenu" ),
1428+ SLOT (updateGroupCallback ( )), this , false , OFF);
1429+
14061430 QAction* clearGroupAction = createAction (*_groupsPopupMenu, QString::fromUtf8 (" Destruction d'un groupe" ),
14071431 QString::fromUtf8 (" Un groupe perd toute les entités qu'il contenait et disparait" ),
14081432 SLOT (clearGroupCallback ( )), this , false , OFF);
0 commit comments