Change several context menus to use single-item class
This commit is contained in:
@@ -5,17 +5,18 @@ import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuCombined
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from service.fit import Fit
|
||||
from service.settings import ContextMenuSettings
|
||||
|
||||
|
||||
class DroneSplitStack(ContextMenuCombined):
|
||||
class DroneSplitStack(ContextMenuSingle):
|
||||
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.settings = ContextMenuSettings.getInstance()
|
||||
|
||||
def display(self, srcContext, mainItem, selection):
|
||||
def display(self, srcContext, mainItem):
|
||||
if srcContext != "droneItem":
|
||||
return False
|
||||
|
||||
@@ -24,10 +25,10 @@ class DroneSplitStack(ContextMenuCombined):
|
||||
|
||||
return mainItem.amount > 1
|
||||
|
||||
def getText(self, itmContext, mainItem, selection):
|
||||
def getText(self, itmContext, mainItem):
|
||||
return "Split {} Stack".format(itmContext)
|
||||
|
||||
def activate(self, fullContext, mainItem, selection, i):
|
||||
def activate(self, fullContext, mainItem, i):
|
||||
dlg = DroneStackSplit(self.mainFrame, mainItem.amount)
|
||||
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
|
||||
Reference in New Issue
Block a user