Populate the itemView with items when a marketGroup is selected.

Note: We're using a treeview instead of a listView here, because it looks exactly like we want out of the box.
This commit is contained in:
cncfanatics
2010-08-15 21:15:45 +02:00
parent 313836bd7a
commit 9093748407
2 changed files with 36 additions and 3 deletions

View File

@@ -29,6 +29,21 @@ class Market():
return cls.instance
def getItems(self, id):
"""
Get the items contained in the marketGroup with the passed id.
Returns a list, where each element is a tuple container:
the id, the name, the icon
"""
items = []
group = eos.db.getMarketGroup(id)
for item in group.items:
icon = item.icon.iconFile if item.icon else ""
items.append((item.ID, item.name, icon))
return items
def getChildren(self, id):
"""
Get the children of the group or marketGroup with the passed id.