Ensure that there is always some text in command fit name, even if fit itself has empty name

This commit is contained in:
Anton Vorobyov
2022-11-29 20:57:15 +04:00
parent 74daf99aed
commit 69221eac24

View File

@@ -44,7 +44,6 @@ class AddCommandFit(ContextMenuUnconditional):
def display(self, callingWindow, srcContext):
if self.mainFrame.getActiveFit() is None or len(self.__class__.commandFits) == 0 or srcContext != "commandView":
return False
return True
def getText(self, callingWindow, itmContext):
@@ -52,6 +51,8 @@ class AddCommandFit(ContextMenuUnconditional):
def addFit(self, menu, fit, includeShip=False):
label = fit.name if not includeShip else "({}) {}".format(fit.ship.item.name, fit.name)
if not label:
label = ' '
id = ContextMenuUnconditional.nextID()
self.fitMenuItemIds[id] = fit
menuItem = wx.MenuItem(menu, id, label)