Don't use try for fittingView, and don't show remove item for modes.

(cherry picked from commit fd224d6)
This commit is contained in:
Ebag333
2016-12-08 16:59:26 -08:00
parent 1a127bb1a6
commit 2eacadf08f
2 changed files with 16 additions and 4 deletions

View File

@@ -70,6 +70,17 @@ class ContextMenu(object):
if m.display(srcContext, selection):
amount += 1
texts = m.getText(itemContext, selection)
# Check the selected item to see if it has special reasons for not showing the menu item
skip_menu_item = False
for sel in selection:
if hasattr(sel, "_Mode__item") and texts == "Remove Module":
# Don't show remove for modes, these are special modules that cannot be removed
skip_menu_item = True
if skip_menu_item == True:
continue
if isinstance(texts, basestring):
texts = (texts,)