Skip to content

Commit

Permalink
Polishing ECU selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric PAILLE committed Dec 6, 2016
1 parent ccc4734 commit b83a03d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ddt4all.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ def __init__(self, ecuscan, treeview_ecu):
grp = ecu.group
if not grp:
grp = "000 - No group"

if not grp in stored_ecus:
stored_ecus[grp] = []

projects = "/".join(ecu.projects)
name = u' (' + projects + u')'

Expand All @@ -45,11 +47,14 @@ def __init__(self, ecuscan, treeview_ecu):
item = gui.QTreeWidgetItem(self.list, [e])
for t in stored_ecus[e]:
gui.QTreeWidgetItem(item, t)

self.list.sortItems(0, core.Qt.AscendingOrder)
self.list.doubleClicked.connect(self.ecuSel)

def ecuSel(self, index):
item = self.list.model().itemData(index)
if index.parent() == core.QModelIndex():
return
item = self.list.model().itemData(self.list.model().index(index.row(), 0, index.parent()))
selected = unicode(item[0].toPyObject().toUtf8(), encoding="UTF-8")
target = self.ecuscan.ecu_database.getTarget(selected)
if target:
Expand Down

0 comments on commit b83a03d

Please sign in to comment.