Skip to content

Commit b2f197e

Browse files
committed
- Rename group added in popup menu
1 parent b4dda4c commit b2f197e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/QtComponents/QtGroupsPanel.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

859879
void 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);

src/QtComponents/protected/QtComponents/QtGroupsPanel.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,11 @@ class QtGroupsPanel : public QtEntitiesItemViewPanel, public Utils::SelectionMan
750750
*/
751751
virtual void unselectMeshCloudsCallback ( );
752752

753+
/**
754+
* Le groupe change de nom tout en conservant son contenu
755+
*/
756+
void updateGroupCallback ( );
757+
753758
/**
754759
* Destruction d'un groupe, on lui retire toute les entités qu'il contient
755760
*/

0 commit comments

Comments
 (0)