Skip to content

Commit

Permalink
put grouping related actions into a submenu
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaleee committed Sep 14, 2024
1 parent 62dc03d commit a413694
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions plugins/gui/src/module_context_menu/module_context_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,16 @@ namespace hal {
if(gSelectionRelay->selectedModules().contains(id))
act->setEnabled(false);

sm = contextMenu->addMenu(" To grouping …");
QString actionText = " Assign module to grouping";
if(module->get_grouping() != nullptr)
actionText = " Reassign module to grouping";
contextMenu->addAction(actionText,
sm->addAction(actionText,
[id]()
{gContentManager->getGroupingManagerWidget()->assignElementsToGroupingDialog({id});}
);

act = contextMenu->addAction(" Remove module from grouping",
act = sm->addAction(" Remove module from grouping",
[id]()
{gContentManager->getGroupingManagerWidget()->removeElementsFromGrouping({id});}
);
Expand Down Expand Up @@ -150,15 +151,16 @@ namespace hal {
if(gSelectionRelay->selectedGates().contains(id))
act->setEnabled(false);

sm = contextMenu->addMenu(" To grouping …");
QString actionText = " Assign gate to grouping";
if(gate->get_grouping() != nullptr)
actionText = " Reassign gate to grouping";
contextMenu->addAction(actionText,
sm->addAction(actionText,
[id]()
{gContentManager->getGroupingManagerWidget()->assignElementsToGroupingDialog({},{id});}
);

act = contextMenu->addAction(" Remove gate from grouping",
act = sm->addAction(" Remove gate from grouping",
[id]()
{gContentManager->getGroupingManagerWidget()->removeElementsFromGrouping({},{id});}
);
Expand Down Expand Up @@ -219,15 +221,16 @@ namespace hal {
if(gSelectionRelay->selectedNets().contains(id))
act->setEnabled(false);

sm = contextMenu->addMenu(" To grouping …");
QString actionText = " Assign net to grouping";
if(net->get_grouping() != nullptr)
actionText = " Reassign net to grouping";
contextMenu->addAction(actionText,
sm->addAction(actionText,
[id]()
{gContentManager->getGroupingManagerWidget()->assignElementsToGroupingDialog({},{},{id});}
);

act = contextMenu->addAction(" Remove net from grouping",
act = sm->addAction(" Remove net from grouping",
[id]()
{gContentManager->getGroupingManagerWidget()->removeElementsFromGrouping({},{},{id});}
);
Expand Down

0 comments on commit a413694

Please sign in to comment.