Skip to content

Commit

Permalink
add the delete action in the context menu of ModuleWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
Julia authored and Julia committed Nov 13, 2023
1 parent f296835 commit 22c0f97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/gui/src/module_widget/module_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ namespace hal
u32 module_id = getModuleItemFromIndex(index)->id();
auto module = gNetlist->get_module_by_id(module_id);

/*if(!(module == gNetlist->get_top_module()) && type == ModuleItem::TreeItemType::Module)
context_menu.addAction(&delete_action);*/
if(!(module == gNetlist->get_top_module()) && type == ModuleItem::TreeItemType::Module)
context_menu.addAction(&delete_action);

QAction* clicked = context_menu.exec(mTreeView->viewport()->mapToGlobal(point));

Expand Down Expand Up @@ -327,7 +327,7 @@ namespace hal
gNetlistRelay->changeModuleColor(getModuleItemFromIndex(index)->id());

if (clicked == &delete_action){
//gNetlistRelay->deleteModule(getModuleItemFromIndex(index)->id());
gNetlistRelay->deleteModule(getModuleItemFromIndex(index)->id());
}

if (clicked == &focus_in_view){
Expand Down Expand Up @@ -616,7 +616,7 @@ namespace hal
switch(getModuleItemFromIndex(mTreeView->currentIndex())->getType())
{
case ModuleItem::TreeItemType::Module: {
//gNetlistRelay->deleteModule(getModuleItemFromIndex(mTreeView->currentIndex())->id());
gNetlistRelay->deleteModule(getModuleItemFromIndex(mTreeView->currentIndex())->id());
break;
}
case ModuleItem::TreeItemType::Gate: break;
Expand Down

0 comments on commit 22c0f97

Please sign in to comment.