Do not show context menu item "open in new tab" for currently selected fit
This commit is contained in:
@@ -15,8 +15,13 @@ class OpenFit(ContextMenu):
|
||||
def display(self, srcContext, selection):
|
||||
if not self.settings.get('openFit'):
|
||||
return False
|
||||
|
||||
return srcContext in ("projectedFit", "commandFit")
|
||||
if srcContext not in ("projectedFit", "commandFit"):
|
||||
return False
|
||||
currentFitID = self.mainFrame.getActiveFit()
|
||||
selectedFitID = selection[0].ID
|
||||
if currentFitID == selectedFitID:
|
||||
return False
|
||||
return True
|
||||
|
||||
def getText(self, itmContext, selection):
|
||||
return "Open Fit in New Tab"
|
||||
|
||||
@@ -14,13 +14,13 @@ class TabbedFits(ContextMenu):
|
||||
|
||||
def display(self, srcContext, selection):
|
||||
|
||||
if self.mainFrame.getActiveFit() is None or srcContext not in ("projected", "commandView"):
|
||||
if self.mainFrame.getActiveFit() is None or srcContext not in ('projected', 'commandView'):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def getText(self, itmContext, selection):
|
||||
return "Currently Open Fits"
|
||||
return 'Add Currently Open Fit'
|
||||
|
||||
def getSubMenu(self, context, selection, rootMenu, i, pitem):
|
||||
self.fitLookup = {}
|
||||
|
||||
Reference in New Issue
Block a user