Merge branch 'master' into wx3
Conflicts: config.py staticdata/icons/icon01_08.png staticdata/icons/icon02_11.png staticdata/icons/icon105_46.png staticdata/icons/icon105_47.png staticdata/icons/icon105_48.png staticdata/icons/icon105_49.png staticdata/icons/icon108_5.png staticdata/icons/icon113_64_1.png staticdata/icons/icon113_64_2.png staticdata/icons/icon113_64_3.png staticdata/icons/icon34_16.png staticdata/icons/iconMarketIcon_16px_Amarr.png staticdata/icons/iconMarketIcon_16px_Caldari.png staticdata/icons/iconMarketIcon_16px_Gallente.png staticdata/icons/iconMarketIcon_16px_Minmatar.png
This commit is contained in:
@@ -18,9 +18,9 @@
|
||||
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
||||
#===============================================================================
|
||||
|
||||
from gui import builtinViewColumns
|
||||
from gui.viewColumn import ViewColumn
|
||||
from gui import bitmapLoader
|
||||
import gui.mainFrame
|
||||
|
||||
import wx
|
||||
from eos.types import Drone, Cargo, Fit, Module, Slot, Rack
|
||||
import service
|
||||
@@ -29,9 +29,12 @@ class BaseName(ViewColumn):
|
||||
name = "Base Name"
|
||||
def __init__(self, fittingView, params):
|
||||
ViewColumn.__init__(self, fittingView)
|
||||
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.columnText = "Name"
|
||||
self.shipImage = fittingView.imageList.GetImageIndex("ship_small", "icons")
|
||||
self.mask = wx.LIST_MASK_TEXT
|
||||
self.projectedView = isinstance(fittingView, gui.projectedView.ProjectedView)
|
||||
|
||||
def getText(self, stuff):
|
||||
if isinstance(stuff, Drone):
|
||||
@@ -39,7 +42,12 @@ class BaseName(ViewColumn):
|
||||
elif isinstance(stuff, Cargo):
|
||||
return "%dx %s" % (stuff.amount, stuff.item.name)
|
||||
elif isinstance(stuff, Fit):
|
||||
return "%s (%s)" % (stuff.name, stuff.ship.item.name)
|
||||
if self.projectedView:
|
||||
# we need a little more information for the projected view
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
return "%dx %s (%s)" % (stuff.getProjectionInfo(fitID).amount, stuff.name, stuff.ship.item.name)
|
||||
else:
|
||||
return "%s (%s)" % (stuff.name, stuff.ship.item.name)
|
||||
elif isinstance(stuff, Rack):
|
||||
if service.Fit.getInstance().serviceFittingOptions["rackLabels"]:
|
||||
if stuff.slot == Slot.MODE:
|
||||
|
||||
@@ -19,27 +19,21 @@
|
||||
|
||||
from gui.viewColumn import ViewColumn
|
||||
from gui import bitmapLoader
|
||||
import gui.mainFrame
|
||||
|
||||
import wx
|
||||
from eos.types import Drone, Module, Rack
|
||||
from eos.types import Drone, Module, Rack, Fit
|
||||
from eos.types import State as State_
|
||||
|
||||
class State(ViewColumn):
|
||||
name = "State"
|
||||
def __init__(self, fittingView, params):
|
||||
ViewColumn.__init__(self, fittingView)
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.resizable = False
|
||||
self.size = 16
|
||||
self.maxsize = self.size
|
||||
self.mask = wx.LIST_MASK_IMAGE
|
||||
for name, state in (("checked", wx.CONTROL_CHECKED), ("unchecked", 0)):
|
||||
bitmap = wx.EmptyBitmap(16, 16)
|
||||
dc = wx.MemoryDC()
|
||||
dc.SelectObject(bitmap)
|
||||
dc.SetBackground(wx.TheBrushList.FindOrCreateBrush(fittingView.GetBackgroundColour(), wx.SOLID))
|
||||
dc.Clear()
|
||||
wx.RendererNative.Get().DrawCheckBox(fittingView, dc, wx.Rect(0, 0, 16, 16), state)
|
||||
dc.Destroy()
|
||||
setattr(self, "%sId" % name, fittingView.imageList.Add(bitmap))
|
||||
|
||||
def getText(self, mod):
|
||||
return ""
|
||||
@@ -49,8 +43,14 @@ class State(ViewColumn):
|
||||
return State_.getName(mod.state).title()
|
||||
|
||||
def getImageId(self, stuff):
|
||||
generic_active = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(1).lower(), "icons")
|
||||
generic_inactive = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(-1).lower(), "icons")
|
||||
|
||||
if isinstance(stuff, Drone):
|
||||
return self.checkedId if stuff.amountActive > 0 else self.uncheckedId
|
||||
if stuff.amountActive > 0:
|
||||
return generic_active
|
||||
else:
|
||||
return generic_inactive
|
||||
elif isinstance(stuff, Rack):
|
||||
return -1
|
||||
elif isinstance(stuff, Module):
|
||||
@@ -58,11 +58,21 @@ class State(ViewColumn):
|
||||
return -1
|
||||
else:
|
||||
return self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(stuff.state).lower(), "icons")
|
||||
elif isinstance(stuff, Fit):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
projectionInfo = stuff.getProjectionInfo(fitID)
|
||||
|
||||
if projectionInfo is None:
|
||||
return -1
|
||||
if projectionInfo.active:
|
||||
return generic_active
|
||||
return generic_inactive
|
||||
else:
|
||||
active = getattr(stuff, "active", None)
|
||||
if active is None:
|
||||
return -1
|
||||
else:
|
||||
return self.checkedId if active else self.uncheckedId
|
||||
if active:
|
||||
return generic_active
|
||||
return generic_inactive
|
||||
|
||||
State.register()
|
||||
|
||||
Reference in New Issue
Block a user