Skip to content

Commit

Permalink
remove the option to delete a module
Browse files Browse the repository at this point in the history
  • Loading branch information
Julia authored and Julia committed Nov 13, 2023
1 parent 28c42e4 commit 7570df1
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 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 @@ -613,7 +613,16 @@ namespace hal
ModuleItem* selectedItem = getModuleItemFromIndex(mTreeView->currentIndex());
if(selectedItem->getParent() != nullptr)
{
gNetlistRelay->deleteModule(getModuleItemFromIndex(mTreeView->currentIndex())->id());
switch(getModuleItemFromIndex(mTreeView->currentIndex())->getType())
{
case ModuleItem::TreeItemType::Module: {
//gNetlistRelay->deleteModule(getModuleItemFromIndex(mTreeView->currentIndex())->id());
break;
}
case ModuleItem::TreeItemType::Gate: break;
case ModuleItem::TreeItemType::Net: break;

}
}
}

Expand Down

0 comments on commit 7570df1

Please sign in to comment.