Skip to content

Commit

Permalink
Enable/disable the duplicate menu item based on Access.packageDuplica…
Browse files Browse the repository at this point in the history
…te annotation.
  • Loading branch information
adeas31 committed Dec 4, 2017
1 parent cbb329b commit 93d2d76
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -2921,6 +2921,13 @@ void LibraryTreeView::showContextMenu(QPoint point)
if (!(StringHandler::getFirstWordBeforeDot(pLibraryTreeItem->getNameStructure()).compare("OpenModelica") == 0)) {
menu.addSeparator();
menu.addAction(mpDuplicateClassAction);
if ((pLibraryTreeItem->getAccess() >= LibraryTreeItem::packageDuplicate)
|| (pLibraryTreeItem->getRestriction() != StringHandler::Package
&& pLibraryTreeItem->getAccess() == LibraryTreeItem::nonPackageDuplicate)) {
mpDuplicateClassAction->setEnabled(true);
} else {
mpDuplicateClassAction->setEnabled(false);
}
}
if (pLibraryTreeItem->isTopLevel()) {
mpUnloadClassAction->setText(Helper::unloadClass);
Expand Down

0 comments on commit 93d2d76

Please sign in to comment.