Use the Implant toggle in the booster view too
This commit is contained in:
@@ -22,9 +22,11 @@ import service
|
||||
import gui.display as d
|
||||
import gui.fittingView as fv
|
||||
import gui.marketBrowser as mb
|
||||
from gui.builtinViewColumns.implantCheckbox import ImplantCheckbox
|
||||
|
||||
class BoosterView(d.Display):
|
||||
DEFAULT_COLS = ["Name",
|
||||
DEFAULT_COLS = ["Implant Checkbox",
|
||||
"Name",
|
||||
"attr:boosterness"]
|
||||
|
||||
def __init__(self, parent):
|
||||
@@ -32,6 +34,7 @@ class BoosterView(d.Display):
|
||||
self.mainFrame.Bind(fv.FIT_CHANGED, self.fitChanged)
|
||||
self.mainFrame.Bind(mb.ITEM_SELECTED, self.addItem)
|
||||
self.Bind(wx.EVT_LEFT_DCLICK, self.removeItem)
|
||||
self.Bind(wx.EVT_LEFT_DOWN, self.click)
|
||||
|
||||
def fitChanged(self, event):
|
||||
cFit = service.Fit.getInstance()
|
||||
@@ -59,3 +62,14 @@ class BoosterView(d.Display):
|
||||
cFit = service.Fit.getInstance()
|
||||
cFit.removeBooster(fitID, self.GetItemData(row))
|
||||
wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
|
||||
|
||||
def click(self, event):
|
||||
row, _ = self.HitTest(event.Position)
|
||||
if row != -1:
|
||||
col = self.getColumn(event.Position)
|
||||
if col == self.getColIndex(ImplantCheckbox):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
cFit = service.Fit.getInstance()
|
||||
cFit.toggleBooster(fitID, row)
|
||||
wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
|
||||
|
||||
|
||||
@@ -24,8 +24,9 @@ class PreferenceDialog(wx.Dialog):
|
||||
def __init__(self, parent):
|
||||
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, size=wx.Size(600, 400), style=wx.DEFAULT_DIALOG_STYLE)
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.listbook = wx.Listbook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LB_DEFAULT)
|
||||
self.listbook.GetListView().SetMinSize((500, -1))
|
||||
self.listbook.GetListView().SetSize((500, -1))
|
||||
|
||||
mainSizer.Add(self.listbook, 1, wx.EXPAND | wx.ALL, 5)
|
||||
self.SetSizer(mainSizer)
|
||||
|
||||
Reference in New Issue
Block a user